Skip to content

nvidia: add RmForceExternalGpu registry key - #984

Open
roger-pmta wants to merge 1 commit into
NVIDIA:mainfrom
roger-pmta:force-egpu
Open

roger-pmta wants to merge 1 commit into
NVIDIA:mainfrom
roger-pmta:force-egpu

Conversation

@roger-pmta

@roger-pmta roger-pmta commented Dec 11, 2025 •

Copy link
Copy Markdown

Thunderbolt 4/5 eGPU enclosures fail automatic external GPU detection
because they are not in the approved TB3 bridge list and do not report
the required slot capabilities (HotPlug+ and Surprise+).

Add RmForceExternalGpu registry key to bypass bridge detection and
unconditionally set PDB_PROP_GPU_IS_EXTERNAL_GPU, enabling proper eGPU
handling throughout the driver.

Usage:

Global (all GPUs):

  NVreg_RegistryDwords="RmForceExternalGpu=1"

Per-device (specific GPU only):

  NVreg_RegistryDwordsPerDevice="pci=DDDD:BB:DD.F;RmForceExternalGpu=1"

The per-device option allows targeting specific GPUs in multi-GPU systems.

@roger-pmta

Copy link
Copy Markdown
Author

Workaround for #979

@roger-pmta

Copy link
Copy Markdown
Author

@mtijanic

Copy link
Copy Markdown
Collaborator

Hi. Sorry, I'm not really familiar with eGPU details to know what kind of effects such a change can invoke, but I can make a couple of comments:

I'm actually surprised that this works. You've declared a top level module param, but are reading it as if it's an RM registry dword. The typical way to read top level params is to just declare them as extern vars and read them directly, like e.g. here.

The osReadRegistryDwords() function is meant for reading keys as defined in nvrm_registry.h, and those are supposed to be passed to the driver as option nvidia NVreg_RegistryDwords="foo=1;bar=0x3f".

However, the registry dword is IMO the better thing to use here, for two reasons:

  1. It can also be set per-GPU, by using NVreg_RegistryDwordsPerDevice and passing the PCI ID for which GPU to apply it to. See here for docs)
  2. The registry dwords interface is a lot more experimental/unstable and is more suitable for these WARs. I can see us merging something like that, because it implies a lot less support than the top level params.

To use this, revert your nv-reg.h changes, and add your key to nvrm_registry.h. See other keys defined there for examples.

@roger-pmta

Copy link
Copy Markdown
Author

Thanks for the feedback @mtijanic! Updated the patch with your suggestions and confirmed working 🙌

@roger-pmta roger-pmta changed the title nvidia: add NVreg_ForceExternalGpu module parameter nvidia: add RmForceExternalGpu registry key Dec 11, 2025
@bdandy

bdandy commented Dec 18, 2025 •

Copy link
Copy Markdown

I'm curious why you decided to make this as registry dwords, not kernel module option so it would be visible in modinfo?

Thunderbolt 4/5 eGPU enclosures fail automatic external GPU detection
because they are not in the approved TB3 bridge list and do not report
the required slot capabilities (HotPlug+ and Surprise+).

Add RmForceExternalGpu registry key to bypass bridge detection and
unconditionally set PDB_PROP_GPU_IS_EXTERNAL_GPU, enabling proper eGPU
handling throughout the driver.

Usage:
  Global (all GPUs):
    NVreg_RegistryDwords="RmForceExternalGpu=1"

  Per-device (specific GPU only):
    NVreg_RegistryDwordsPerDevice="pci=DDDD:BB:DD.F;RmForceExternalGpu=1"

The per-device option allows targeting specific GPUs in multi-GPU systems.
@orkineric

Copy link
Copy Markdown

Confirmed working on RTX 5090 + Gigabyte Aorus RTX 5090 AI Box (TB5) / Fedora 43 / kernel 7.0.0-rc7 alongside PR #1109, which makes the ReBAR resize non-fatal (and adds a pci_is_thunderbolt_attached() fast-path) so the nvidia driver actually binds the eGPU in the first place — without that, your RmForceExternalGpu registry key has no GPU to apply to on TB5. Both patches deployed together on a dual-5090 workstation (internal PCIe 5.0 x16 + Aorus AI Box over TB5), CUDA workloads including ollama multi-GPU inference across both cards running cleanly with no Xid errors.

@pstreet

pstreet commented Nov 15, 2026

Copy link
Copy Markdown

I've been struggling recently with a new Gigabyte AI Box with RTX 5090 hitting issues on my MS-S1 Strix Halo machine as well that likely could benefit from this change. Is there anything remaining to be done to help get this merged in @roger-pmta ?

@bdandy

bdandy commented Nov 15, 2026

Copy link
Copy Markdown

@pstreet I guess only nvidia engineers good will... or you can build your fork, like I did for archlinux with few patches including this in nvidia-open-egpu-dkms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants