Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions src/nvidia/arch/nvalloc/unix/src/osinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,10 +1310,29 @@ RmInitNvDevice(
}

// Configure eGPU setting
if (RmCheckForExternalGpu(pGpu, pCl))
{
pGpu->setProperty(pGpu, PDB_PROP_GPU_IS_EXTERNAL_GPU, NV_TRUE);
nv->is_external_gpu = NV_TRUE;
NvU32 forceExternalGpu = 0;
NvBool isExternalGpu = NV_FALSE;

// Check if user has forced eGPU mode via RmForceExternalGpu registry key
if ((osReadRegistryDword(pGpu, NV_REG_STR_RM_FORCE_EXTERNAL_GPU, &forceExternalGpu) == NV_OK) &&
(forceExternalGpu != 0))
{
NV_PRINTF(LEVEL_NOTICE, "Forcing external GPU mode via RmForceExternalGpu registry key\n");
isExternalGpu = NV_TRUE;
}
else
{
// Otherwise, use automatic detection
isExternalGpu = RmCheckForExternalGpu(pGpu, pCl);
}

if (isExternalGpu)
{
NV_PRINTF(LEVEL_NOTICE, "GPU treated as external GPU (eGPU)\n");
pGpu->setProperty(pGpu, PDB_PROP_GPU_IS_EXTERNAL_GPU, NV_TRUE);
nv->is_external_gpu = NV_TRUE;
}
}
status->rmStatus = gpumgrStateInitGpu(pGpu);
if (status->rmStatus != NV_OK)
Expand Down
11 changes: 11 additions & 0 deletions src/nvidia/interface/nvrm_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,17 @@
// If set, this will cause RM mark GPU as lost when it detects 0xFF from register
// access.

//
// Type DWORD
// Force external GPU mode, bypassing automatic Thunderbolt bridge detection.
// Useful for Thunderbolt 4/5 enclosures not in the driver's approved bridge list.
//
// Encoding:
// 0 (default) - use automatic eGPU detection
// 1 - force GPU to be treated as external
//
#define NV_REG_STR_RM_FORCE_EXTERNAL_GPU "RmForceExternalGpu"

#define NV_REG_STR_RM_BLACKLIST_ADDRESSES "RmBlackListAddresses"
// Type BINARY:
// struct
Expand Down