summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_rm_emulation.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-08 05:44:31 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-08 05:44:31 -0500
commit5e6cd3cf5df1ab61208848866c30c29ce8907530 (patch)
tree414e60295b35ffe5bd0b5d9dcc84324a9d2b1bd6 /kernel/gsp_rm_emulation.c
parent2089f26f66626647c2e952cc1a758ef10930a58a (diff)
downloadopen-iov-5e6cd3cf5df1ab61208848866c30c29ce8907530.tar.gz
open-iov-5e6cd3cf5df1ab61208848866c30c29ce8907530.zip
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.
Diffstat (limited to 'kernel/gsp_rm_emulation.c')
-rw-r--r--kernel/gsp_rm_emulation.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/gsp_rm_emulation.c b/kernel/gsp_rm_emulation.c
index 3157a24..b05ee3d 100644
--- a/kernel/gsp_rm_emulation.c
+++ b/kernel/gsp_rm_emulation.c
@@ -2671,6 +2671,18 @@ static void gsp_rm_handle_kgr_get_info(struct gsp_emu_context *ctx,
info->infoList[TU104_GR_INFO_IDX_MAX_LEGACY_SUBCONTEXT_COUNT].data = TU104_MAX_SUBCONTEXT_COUNT;
info->infoList[TU104_GR_INFO_IDX_MAX_PER_ENGINE_SUBCONTEXT_COUNT].data = TU104_MAX_SUBCONTEXT_COUNT;
+ /*
+ * GR identity for the nvidia-3d library. SM_VERSION in particular
+ * gates nv3dAllocDevice (GetSpaVersion -> FALSE on
+ * SM_VERSION_NONE), which makes nvHsAllocDevice fail silently and
+ * nvidia-drm report "Failed to allocate NvKmsKapiDevice".
+ */
+ info->infoList[TU104_GR_INFO_IDX_SM_VERSION].data = TU104_GR_INFO_SM_VERSION_7_5;
+ info->infoList[TU104_GR_INFO_IDX_MAX_WARPS_PER_SM].data = TU104_MAX_WARPS_PER_SM;
+ info->infoList[TU104_GR_INFO_IDX_MAX_THREADS_PER_WARP].data = TU104_MAX_THREADS_PER_WARP;
+ info->infoList[TU104_GR_INFO_IDX_THREAD_STACK_SCALING_FACTOR].data =
+ TU104_THREAD_STACK_SCALING_FACTOR;
+
*out_params_size = TU104_GR_INFO_MAX_ENGINES *
sizeof(struct tu104_gr_static_info);
*out_status = 0;