From 5e6cd3cf5df1ab61208848866c30c29ce8907530 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Sun, 8 Nov 2026 05:44:31 -0500 Subject: vgsp-rm: report TU104 GR identity in KGR_GET_INFO (SM_VERSION 7.5) nv3dAllocDevice reads SM_VERSION (GR info index 0x0c) through the 3D library; with the emulated KGR reply leaving it 0 it gets SM_VERSION_NONE, GetSpaVersion fails, nvHsAllocDevice returns FALSE silently and nvidia-drm reports 'Failed to allocate NvKmsKapiDevice' (r1626 gdb: nvHsAllocDevice -> nvHs3dAllocDevice -> nv3dAllocDevice). Fill SM_VERSION=0x705 (7.5) plus MAX_WARPS_PER_SM=64, MAX_THREADS_PER_WARP=32 and THREAD_STACK_SCALING_FACTOR=1. --- kernel/gsp_rm_tu104.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'kernel/gsp_rm_tu104.h') diff --git a/kernel/gsp_rm_tu104.h b/kernel/gsp_rm_tu104.h index d0850f2..033014b 100644 --- a/kernel/gsp_rm_tu104.h +++ b/kernel/gsp_rm_tu104.h @@ -985,7 +985,11 @@ struct tu104_gr_static_info { /* infoList indices we populate (ctrl0080gr.h) */ #define TU104_GR_INFO_IDX_SHADER_PIPE_COUNT 0x07 +#define TU104_GR_INFO_IDX_THREAD_STACK_SCALING_FACTOR 0x08 #define TU104_GR_INFO_IDX_SHADER_PIPE_SUB_COUNT 0x09 +#define TU104_GR_INFO_IDX_SM_VERSION 0x0c +#define TU104_GR_INFO_IDX_MAX_WARPS_PER_SM 0x0d +#define TU104_GR_INFO_IDX_MAX_THREADS_PER_WARP 0x0e #define TU104_GR_INFO_IDX_LITTER_NUM_GPCS 0x14 #define TU104_GR_INFO_IDX_LITTER_NUM_TPC_PER_GPC 0x17 #define TU104_GR_INFO_IDX_GPU_CORE_COUNT 0x1d @@ -1010,6 +1014,20 @@ struct tu104_gr_static_info { /* TU104 max subcontexts (NV_PGRAPH_PRI_FE_CHIP_DEF_INFO_MAX_VEID_COUNT_INIT) */ #define TU104_MAX_SUBCONTEXT_COUNT 64 +/* + * GR identity values the nvidia-3d library reads through GR_GET_INFO. + * SM_VERSION must be NV2080_CTRL_GR_INFO_SM_VERSION_7_5 (0x705): the 3D + * device allocation maps the SM version through a table and returns FALSE + * when it reads SM_VERSION_NONE (0). On the guest that surfaces as + * nvHsAllocDevice -> nvHs3dAllocDevice failing silently, and nvidia-drm + * reports "Failed to allocate NvKmsKapiDevice" (r1626 gdb: after_hs + * rax=0x0, hs_hs3d_fail_block). Warps/threads are the TU104 limits. + */ +#define TU104_GR_INFO_SM_VERSION_7_5 0x00000705 +#define TU104_MAX_WARPS_PER_SM 64 +#define TU104_MAX_THREADS_PER_WARP 32 +#define TU104_THREAD_STACK_SCALING_FACTOR 1 + /* NV2080_CTRL_INTERNAL_STATIC_GR_FLOORSWEEPING_MASKS (ctrl2080internal.h) * + STATIC_KGR_GET_FLOORSWEEPING_MASKS cmd = 0x20800a26. * Driver computes numGpcs from floorsweepingMasks.gpcMask - zero kills -- cgit v1.2.3