open-gpu-kernel-modules icon indicating copy to clipboard operation
open-gpu-kernel-modules copied to clipboard

RTX 5080 via Thunderbolt 5 eGPU: Hard lock on CUDA operations (nvidia-smi works at idle)

Open roger-pmta opened this issue 11 months ago • 49 comments

NVIDIA Open GPU Kernel Modules Version

590.44.01 and 580.105.08, both from the NVIDIA's official CUDA rhel10 repo

Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.

  • [ ] I confirm that this does not happen with the proprietary driver package.

Operating System and Version

Rocky Linux 10.1 (Red Quartz)

Kernel Release

6.12.0-124.13.1.el10_1.x86_64 (PREEMPT_DYNAMIC)

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • [x] I am running on a stable kernel release.

Hardware: GPU

NVIDIA GeForce RTX 5080

Describe the bug

RTX 5080 connected via Thunderbolt 5 eGPU enclosure (Sonnet Breakaway Box 850T5) initializes correctly and is visible to nvidia-smi at idle. Any CUDA operation causes immediate system hard-lock requiring power cycle. No kernel panic, no Xid error logged, no SysRq response.

This appears related to closed issue #900 (RTX 5090 via OCuLink), which showed identical symptoms: GPU functional at idle, crash under load, GSP firmware bootstrap errors. That issue was resolved by switching OCuLink docks, but dock alternatives for Thunderbolt 5 are extremely limited.

PCIe link negotiates correctly at 16GT/s x4 (PCIe 4.0 x4) - optimal for Thunderbolt 4 host controller bandwidth. BAR allocation succeeds with hotplug resource reservation parameters. Driver loads and initializes without error.

Minimal reproducer:

nvidia-smi                    # Works - GPU visible, ~2W idle
python3 -c "import torch; torch.zeros(1, device='cuda')"   # Hard lock

Hardware:

  • GPU: NVIDIA GeForce RTX 5080 (GB203)
  • eGPU Enclosure: Sonnet Breakaway Box 850T5 (Thunderbolt 5)
  • Host: Lenovo ThinkPad X1 Carbon Gen 11
  • Thunderbolt Controller: Intel Raptor Lake-P Thunderbolt 4 (host), USB4/TB5 (enclosure)
  • OS: Rocky Linux 10.1

Required kernel parameters: pcie_ports=native pcie_aspm=off pcie_port_pm=off pci=assign-busses,realloc

Without pcie_ports=native, GPU enters D3cold and driver fails with "Unable to change power state from D3cold to D0".

To Reproduce

  1. Connect RTX 5080 to Sonnet Breakaway Box 850T5 (Thunderbolt 5 eGPU enclosure)
  2. Connect enclosure to host via Thunderbolt cable
  3. Boot system with kernel parameters: pcie_ports=native pcie_aspm=off pcie_port_pm=off pci=assign-busses,realloc
  4. Confirm GPU detected: nvidia-smi (shows GPU at idle, ~2W, ~30°C)
  5. Run any CUDA operation: python3 -c "import torch; torch.zeros(1, device='cuda')"
  6. System hard-locks immediately. No kernel panic, no SysRq response. Power cycle required.

Bug Incidence

Always

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

More Info

Also reported at https://forums.developer.nvidia.com/t/590-release-feedback-discussion/353310/53, cross-posted to https://forums.developer.nvidia.com/t/580-release-feedback-discussion/341205/898, and and linux-bugs

roger-pmta avatar Dec 04 '25 20:12 roger-pmta

For folks who find this, @morgwai and I have been troubleshooting in the PR (#981) and the thread at https://egpu.io/forums/thunderbolt-linux-setup/rtx-5080-via-thunderbolt-5-egpu-hard-lock-on-cuda-operations-nvidia-smi-works-at-idle/ too.

roger-pmta avatar Dec 06 '25 20:12 roger-pmta

NVIDIA RTX 5080 eGPU on Linux - Working Configuration

Hardware:

  • Laptop: Lenovo ThinkPad X1 Carbon Gen 11 (Thunderbolt 4)
  • eGPU Enclosure: Sonnet Breakaway Box 850T5 (Thunderbolt 5, JHL9480)
  • GPU: NVIDIA GeForce RTX 5080 (Blackwell, GB203)
  • Device ID: 10de:2c02
  • OS: Rocky Linux 10.1, Kernel 6.12.0-124.16.1.el10_1.x86_64

BIOS Settings:

  • Thunderbolt 4: Enabled
  • PCIe Tunneling: Enabled
  • Kernel DMA Protection: Enabled (can stay enabled)

Kernel Parameters (add via grubby):

sudo grubby --update-kernel=ALL --args="pci=assign-busses,hpbussize=0x10,hpmmiosize=64M,hpmmioprefsize=384M,realloc pcie_port_pm=off pcie_aspm.policy=performance intel_iommu=off thunderbolt.clx=0"

Parameters explained:

pci=assign-busses      - Kernel reassigns PCI bus numbers (helps Thunderbolt)
hpbussize=0x10         - Reserve 16 bus numbers per hotplug bridge
hpmmiosize=64M         - Reserve 64MB non-prefetchable MMIO per hotplug bridge (for BAR0)
hpmmioprefsize=384M    - Reserve 384MB prefetchable MMIO per hotplug bridge (for BAR1+BAR3)
realloc                - Force PCI resource reallocation for hotplug
pcie_port_pm=off       - Disable PCIe port power management (prevents D3cold freeze on cold boot)
pcie_aspm.policy=performance - Minimize ASPM power state transitions
intel_iommu=off        - Disable IOMMU (reduces DMA latency for eGPU)
thunderbolt.clx=0      - Disable Thunderbolt low-power states on high-speed lanes

Also blacklist nouveau in initramfs:

rd.driver.blacklist=nouveau rd.driver.blacklist=nova-core

Driver: Patched 590.44.01 Open (NVreg_ForceExternalGpu module parameter)

The stock NVIDIA driver does not recognize Thunderbolt 4/5 bridges as valid eGPU enclosures. Without proper eGPU detection, power management code runs that can cause PCIe link instability.

Required patch hacks around this by adding a NVreg_ForceExternalGpu module parameter (long-term fix will likely require fixes in the GSP firmware)

  • kernel-open/nvidia/nv-reg.h: Define ForceExternalGpu parameter
  • src/nvidia/arch/nvalloc/unix/src/osinit.c: Check parameter and force eGPU mode
  • See attached patch

When NVreg_ForceExternalGpu=1, the driver bypasses automatic Thunderbolt bridge detection and treats the GPU as external, which:

  • Sets PDB_PROP_GPU_IS_EXTERNAL_GPU property
  • Skips Platform Request Handler power management
  • Works with any Thunderbolt enclosure (TB3, TB4, TB5, future)

Setup

Step 1: Add CUDA repository

sudo dnf config-manager --add-repo <https://developer.download.nvidia.com/compute/cuda/repos/rhel10/x86_64/cuda-rhel10.repo>
sudo dnf config-manager --set-enabled cuda-rhel10-x86_64

Step 2: Install packages

sudo dnf install kmod-nvidia-open-dkms nvidia-driver-cuda nvidia-gpu-firmware

Installed packages:
  kmod-nvidia-open-dkms-590.44.01-1.el10.noarch
  nvidia-driver-cuda-590.44.01-1.el10.x86_64
  nvidia-driver-cuda-libs-590.44.01-1.el10.x86_64
  nvidia-gpu-firmware-20251008-15.8.el10_0.noarch
  nvidia-kmod-common-590.44.01-1.el10.noarch
  nvidia-modprobe-590.44.01-1.el10.x86_64
  nvidia-persistenced-590.44.01-1.el10.x86_64
  libnvidia-cfg-590.44.01-1.el10.x86_64
  libnvidia-gpucomp-590.44.01-1.el10.x86_64
  libnvidia-ml-590.44.01-1.el10.x86_64

Step 3: Build and install patched driver

Note: the official NVIDIA repo installs modules to /lib/modules/$(uname -r)/extra which supersedes the default install location of /lib/modules/$(uname -r)/kernel/drivers/video.

cd /path/to/open-gpu-kernel-modules
git apply 0001-nvidia-add-NVreg_ForceExternalGpu-module-parameter.patch
make -j$(nproc) DEBUG=1 modules
sudo make modules_install

Step 4: Configure nvidia module options

Create /etc/modprobe.d/nvidia.conf:

# Blacklist display modules for compute-only
blacklist nvidia_drm
blacklist nvidia_modeset

# Override system softdep - only load nvidia-uvm, skip drm/modeset (compute-only)
softdep nvidia post: nvidia-uvm

# Disable Resizable BAR (resize fails with small bridge windows)
options nvidia NVreg_EnableResizableBar=0

# Disable dynamic power management (prevents D3cold issues over Thunderbolt)
options nvidia NVreg_DynamicPowerManagement=0

# Force eGPU mode (bypasses Thunderbolt bridge detection for TB4/TB5 enclosures)
options nvidia NVreg_ForceExternalGpu=1

# Lock clocks after driver loads (prevents ASPM-triggered link degradation)
install nvidia /usr/local/bin/nvidia-egpu-setup.sh $CMDLINE_OPTS

Step 5: Enable nvidia-persistenced

sudo systemctl enable nvidia-persistenced

Step 5a: Set up automatic clock locking (prevents PCIe link degradation)

The PCIe link degrades from Gen4 to Gen1 due to ASPM common clock reconfiguration during power state transitions. Locking GPU clocks prevents this by keeping the GPU active.

Create /usr/local/bin/nvidia-egpu-setup.sh:

#!/bin/bash
# Clock locking wrapper for nvidia module load

logger -t nvidia-egpu "Install directive triggered"

# Load the actual nvidia module first
/sbin/modprobe --ignore-install nvidia "$@"
ret=$?

if [ $ret -ne 0 ]; then
    logger -t nvidia-egpu "modprobe failed with $ret"
    exit $ret
fi

logger -t nvidia-egpu "Module loaded, waiting for nvidia-smi..."

# Wait for nvidia-smi to respond
for i in {1..60}; do
    if nvidia-smi --query-gpu=name --format=csv,noheader &>/dev/null; then
        logger -t nvidia-egpu "nvidia-smi responding after ${i}s"
        break
    fi
    sleep 1
done

if ! nvidia-smi --query-gpu=name --format=csv,noheader &>/dev/null; then
    logger -t nvidia-egpu "Timeout - nvidia-smi not responding"
    exit 0  # Don't fail module load
fi

sleep 2

logger -t nvidia-egpu "Locking clocks..."
nvidia-smi -pm 1
nvidia-smi -lgc 3090,3090
nvidia-smi -lmc 15001,15001
nvidia-smi -pl 390
logger -t nvidia-egpu "Complete"

Then mark it as executable

sudo chmod +x /usr/local/bin/nvidia-egpu-setup.sh

The install directive intercepts modprobe nvidia, runs the script which loads the module synchronously, then locks clocks. This avoids backgrounding issues where scripts get killed before completion.

Logs go to syslog (journalctl -t nvidia-egpu).

Step 6: Enroll Thunderbolt device for auto-authorization

sudo boltctl enroll <UUID>  # Get UUID from: sudo boltctl list

The enrolled device, in my case:

UUID: e4ec8780-0079-3b72-ffff-ffffffffffff
Policy: auto

Step 7: Reboot with eGPU connected

Verification:

nvidia-smi
sudo lspci -vvs 14:00.0 | grep LnkSta  # Should show 16GT/s
lsmod | grep nvidia  # Should NOT show nvidia_modeset or nvidia_drm
dmesg | grep -i "external.*gpu"  # Should show eGPU detected

Current Status

  • nvidia-smi: Working
  • nvidia-persistenced: Enabled
  • BAR1: 256MB (ReBAR disabled due to bridge window constraints)
  • Thunderbolt: Auto-authorized via boltctl enrollment
  • PCIe Link: Gen4 (16GT/s) x4 - maintained via clock locking
  • Bandwidth: ~4 GiB/s (Host↔Device)
  • Compute: ~40 TFLOP/s, confirmed with gpu-burn

Technical Details

Why Automatic eGPU Detection Fails (without NVreg_ForceExternalGpu):

The NVIDIA driver's RmCheckForExternalGpu() function checks if a GPU is connected via a Thunderbolt eGPU enclosure by:

  1. Looking for Intel vendor ID (0x8086) on upstream bridge
  2. Querying closed-source approved TB3 bridge list
  3. Checking for HotPlug+ AND Surprise+ slot capabilities

Thunderbolt 4/5 bridges fail because:

  • They're not in the closed-source TB3 approved bridge list
  • TB4/TB5 bridges may report HotPlug- Surprise+ (OR)

Without eGPU detection, PDB_PROP_GPU_IS_EXTERNAL_GPU is not set, causing the Platform Request Handler to run power management code intended for internal GPUs.

Why These Settings:

  1. pcie_port_pm=off: Prevents Thunderbolt bridges from entering D3cold, which causes "Unable to change power state from D3cold to D0" errors and system freeze on cold boot.

  2. hpmmiosize=64M, hpmmioprefsize=384M: Sized for actual BAR needs:

    • BAR0: 64MB non-prefetchable
    • BAR1: 256MB prefetchable
    • BAR3: 32MB prefetchable

    Larger values starve other bridges since 4 bridges share ~49GB. I believe this only applies to hotplug devices.

  3. NVreg_EnableResizableBar=0: ReBAR resize fails with ENOENT because the bridge prefetchable window is too small after allocation.

  4. NVreg_DynamicPowerManagement=0: Prevents GPU from entering low power states that cause link issues over Thunderbolt.

  5. NVreg_ForceExternalGpu=1: Forces eGPU mode, bypassing automatic Thunderbolt bridge detection. Required for TB4/TB5 enclosures. See patch.

  6. softdep nvidia post: nvidia-uvm: Overrides system default that loads nvidia-drm (which pulls in nvidia_modeset). Only nvidia and nvidia-uvm are needed for compute.

PCIe Link Speed Issue (Gen4 → Gen1 degradation):

Without clock locking, the kernel's ASPM code detects "inconsistent common clock configuration" during device enumeration and triggers a link retrain. The JHL9480 Thunderbolt 5 controller retrains at Gen1 instead of Gen4.

The message in dmesg is:

pcieport 0000:00:07.2: ASPM: current common clock configuration is inconsistent, reconfiguring

This happens in drivers/pci/pcie/aspm.c:pcie_aspm_configure_common_clock() which calls pcie_retrain_link(). No kernel parameter exists to disable this.

Workaround: Lock GPU clocks to maximum immediately after driver bind. This keeps the GPU in an active power state, preventing the ASPM reconfiguration from triggering link speed degradation.


Last tested: 2025-12-10

roger-pmta avatar Dec 11 '25 00:12 roger-pmta

I had a similar issue running an RTX 5060 Ti via Thunderbolt 3 (Titan Ridge DD 2018 enclosure). Constant Xid 154 crashes
under CUDA load

My workaround was lowering the GPU clocks and power limit:

  nvidia-smi -pm 1                                                                                                                                        
  nvidia-smi -lgc 1000,1000                                                                                                                               
  nvidia-smi -pl 150                                                                                                                                      

Before this change GPU was running for like 3 minutes and crashing,
not ideal for gaming, but for my use case (running RT-DETR object detection inference) it didn't noticeably affect performance.

jakubtrzcinski avatar Jan 31 '26 10:01 jakubtrzcinski

Same issue with gigabyte aorus 5060ti aibox with proxmox linux / macbook 2019 linux

LeeTeng2001 avatar Feb 04 '26 09:02 LeeTeng2001


RTX 5090 eGPU via Thunderbolt 4 — Hard Lock on Any GPU Write Operation

Hardware

Component Details
Host Intel NUC 15 Pro+ (Arrow Lake, Core Ultra 9 288V)
RAM 96GB DDR5
OS Proxmox VE 9.1.5 (Debian Bookworm), bare metal
Kernel 6.17.9-1-pve (PREEMPT)
eGPU Enclosure GIGABYTE AORUS GeForce RTX 5090 AI BOX
GPU NVIDIA GeForce RTX 5090 (GB202, 32GB GDDR7)
Thunderbolt TB4 (Intel Gen14 controller, JHL9480)
iGPU Intel Arc (Arrow Lake, i915)

Driver Versions Tested

  • 590.48.01 open kernel modules (patched with PR #984) — results below
  • 590.48.01 open kernel modules (without patch) — same crash behavior
  • 580.142 closed kernel modules — same crash behavior
  • 570.133.07 — failed to compile on kernel 6.17

Kernel Parameters

intel_iommu=on iommu=pt i915.enable_guc=3 pci=hpbussize=0x10,hpmmiosize=64M,hpmmioprefsize=384M,realloc pcie_port_pm=off pcie_aspm.policy=performance thunderbolt.clx=0

Modprobe Configuration

blacklist nvidia_drm blacklist nvidia_modeset softdep nvidia post: nvidia-uvm

options nvidia NVreg_EnableResizableBar=0 options nvidia NVreg_DynamicPowerManagement=0 options nvidia NVreg_RegistryDwords="RmForceExternalGpu=1"

What Works

  • Thunderbolt authorization: ✅
  • PCI enumeration (lspci): ✅ 04:00.0 VGA compatible controller: NVIDIA Corporation GB202 [GeForce RTX 5090] (rev a1)
  • Driver load (open kernel modules): ✅
  • nvidia-smi read-only query: ✅

+-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 590.48.01 Driver Version: 590.48.01 CUDA Version: 13.1 | +-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 5090 Off | 00000000:04:00.0 Off | N/A | | 30% 56C P0 77W / 575W | 0MiB / 32607MiB | 0% Default | +-----------------------------------------+------------------------+----------------------+

What Crashes (Instant Hard Lock)

Every command that writes to the GPU causes an immediate system hard lock. No kernel panic, no Xid error, no SysRq response. Requires physical power cycle.

Command Result
nvidia-smi -pm 1 💀 Instant hard lock
nvidia-smi -pl 460 💀 Instant hard lock
nvidia-smi -lgc 2407,2407 💀 Instant hard lock
CUDA workload 💀 Instant hard lock

The crash is 100% reproducible. Read-only queries (nvidia-smi, nvidia-smi --query-gpu=...) work indefinitely. Any write operation kills the system instantly.

PR #984 Results

I compiled 590.48.01 open kernel modules from source with the RmForceExternalGpu patch applied. The patch successfully fixes eGPU detection — the driver loads cleanly and recognizes the GPU without manual PCI remove/rescan workarounds.

However, the hard lock on write operations persists identically with and without the patch. This confirms:

  1. PR #984 solves the detection problem — it should be merged
  2. The write/crash problem is separate — likely in the power management or PCIe link renegotiation layer, not in eGPU detection

dmesg (Successful Load)

nvidia: module verification failed: signature and/or required key missing - tainting kernel nvidia-nvlink: Nvlink Core is being initialized, major device number 508 nvidia 0000:04:00.0: enabling device (0000 -> 0003) NVRM: loading NVIDIA UNIX Open Kernel Module for x86_64 590.48.01 Release Build

No errors in dmesg before the hard lock. The lock leaves no trace in logs (no Xid, no kernel oops).

Key Observations

  1. TB4 vs TB5: @roger-pmta reports a working RTX 5080 setup on TB5 with clock locking. My RTX 5090 on TB4 crashes on any write, including the same clock locking commands. This may indicate TB4 has stricter power state transitions that trigger the bug.

  2. Read vs Write: The clear boundary between working reads and crashing writes suggests the issue is triggered by GPU state transitions (P-state changes, power rail adjustments) that require PCIe link renegotiation through the Thunderbolt bridge.

  3. Not driver-version specific: Tested across 580.142 (closed), 590.48.01 (open, unpatched), and 590.48.01 (open, PR #984 patched) — identical crash behavior on all three.

Environment Notes

  • Proxmox VE (bare metal hypervisor, no desktop environment)
  • No display connected to eGPU
  • Intel Arc iGPU active simultaneously (i915)
  • ZFS root filesystem

mihau81 avatar Mar 12 '26 21:03 mihau81

Same behavior with a Lenovo E14 Gen 5 (intel) and a Aorus RTX 5090 AI BOX connected via TB4 on Debian Trixie and sid

Best result with 590.48.01 (plus https://github.com/NVIDIA/open-gpu-kernel-modules/pull/984) and a few tweaks from https://egpu.io/forums/postid/1118819/

Depending on Kernel boot parameters, driver versions and moonphase i have varying degrees of functionality:

  • Direct freeze of the system when connecting the gpu
  • one-time access via nvidia-smi and subsequent freeze when trying to access the card again
  • full repeated use of nvidia-smi including powermizer, clocks and readouut
  • one-time execution of a cuda workload for 3 hours (non-repeatable and only acquired once and never again within four system re-installs tweaking and four driver versions and two driver patches)

The card itself seems to be working from the hardware side (had it running for 24h hours in furmark when booting windows 11)

rvn2p avatar Mar 17 '26 13:03 rvn2p

Additional data point: RTX 5060 Ti eGPU via Thunderbolt 4 — same hard-lock on CUDA

Hardware

  • Host: ASUS ROG Strix G18 G814JIR (Intel Core i9-14900HX)
  • Internal GPU: NVIDIA RTX 4070 Laptop GPU (8 GB, Ada, compute 8.9) — works perfectly
  • eGPU: Gigabyte AORUS RTX 5060 Ti AI BOX (16 GB, Blackwell GB206, compute 12.0)
  • Connection: Thunderbolt 4 / USB4 (40 Gb/s, PCIe Gen4 x4 tunneled)
  • RAM: 32 GB DDR5-5600

Software

  • OS: Fedora 43 Workstation
  • Kernels tested: 6.18.13-200.fc43, 6.19.7-200.fc43, 6.19.10-200.fc43
  • Drivers tested: 580.126.18 and 595.58.03 (open kernel modules, .run installer with --dkms)

Symptom — identical to #979

nvidia-smi works perfectly at idle. Both GPUs visible. cuInit(), cuDeviceGet(), cuDeviceGetName(), cuDeviceTotalMem() all return correct results on the eGPU.

cuCtxCreate_v2() triggers a full system hard-lock within 2-5 seconds. No kernel panic, no SysRq response, hard power cycle required. Sometimes cuCtxCreate returns 0 (success) and cuMemAlloc also returns 0, but the system freezes on process exit (context destroy / cleanup).

Minimal reproducer

bash
CUDA_VISIBLE_DEVICES=1 timeout 15 python3 -c "
import ctypes, time
libcuda = ctypes.CDLL('libcuda.so.1')
libcuda.cuInit(0)
dev = ctypes.c_int()
libcuda.cuDeviceGet(ctypes.byref(dev), 0)
ctx = ctypes.c_void_p()
rc = libcuda.cuCtxCreate_v2(ctypes.byref(ctx), 0, dev)
print(f'cuCtxCreate: {rc}', flush=True)
if rc == 0:
    devptr = ctypes.c_uint64()
    rc = libcuda.cuMemAlloc_v2(ctypes.byref(devptr), 1024*1024)
    print(f'cuMemAlloc: {rc}', flush=True)
time.sleep(30)
" ; echo "exit: $?"

BAR status (without pci=realloc)

Region 0: Memory at 6c000000 (32-bit, non-prefetchable) [size=64M]
Region 1: Memory at 6240000000 (64-bit, prefetchable) [size=256M]
BAR 1: current size: 256MB, supported: 16GB
VF BAR 2: can't assign; no space
VF BAR 4: can't assign; no space

Exhaustive list of workarounds tested — NONE resolve the hard-lock

Configuration | Result -- | -- iommu=off | cuCtxCreate: 999 (no freeze, but no compute) iommu=pt | Hard-lock IOMMU default (kernel default) | Hard-lock pci=realloc,hpmmioprefsize=16G,hpmmiosize=128M | Hard-lock No pci= args at all | Hard-lock NVreg_EnableGpuFirmware=0 (GSP off) | Parameter ignored + hard-lock NVreg_EnableHMM=0 | Hard-lock NVreg_DynamicPowerManagement=0x00 | Hard-lock NVreg_RegistryDwordsPerDevice="pci=0000:07:00.0;RmForceExternalGpu=1" | Hard-lock pcie_ports=native pcie_aspm=off pcie_port_pm=off | Hard-lock thunderbolt.clx=0 | Hard-lock udev: d3cold_allowed=0 + power/control=on | Hard-lock All above combined | Hard-lock 3 different kernels (6.18.13, 6.19.7, 6.19.10) | Hard-lock on all Driver 580.126.18 | Hard-lock Driver 595.58.03 | Hard-lock Power cycle of eGPU enclosure | Hard-lock Proprietary kernel modules (akmod-nvidia) | NVRM: requires use of the NVIDIA open kernel modules — Blackwell refused

Key observations

  1. Read-only operations work: nvidia-smi, cuInit, cuDeviceGet, cuDeviceGetName, cuDeviceTotalMem — all stable indefinitely
  2. Write operations crash: cuCtxCreate_v2 (DMA mapping setup) triggers the lock
  3. Process exit crashes even on "success": On one occasion (driver 595, first install), cuCtxCreate: 0 + cuMemAlloc: 0 succeeded, but the system froze on process termination (context destroy)
  4. Internal GPU unaffected: RTX 4070 Laptop GPU on the same system works perfectly with CUDA
  5. Screen corruption on some freezes: Sometimes the freeze shows color artifacts (not just black screen), suggesting PCIe bus-level corruption

Conclusion

This is a blocking issue for all Blackwell eGPU users on Linux. The AORUS RTX 5060 Ti AI BOX is a product explicitly marketed for AI workloads, yet CUDA compute is impossible on Linux. The same hardware works under Windows 11 25H2.

nvidia-bug-report.log.gz

fanfanmgz avatar Apr 01 '26 19:04 fanfanmgz

Confirming a very similar pattern on Windows + USB4 (not TB5) + RTX 5080

I am experiencing a closely matching pattern to the one described here: the RTX 5080 is stable at idle and under light/moderate CUDA load, but crashes under heavier sustained CUDA load.

I am reporting this because my setup differs significantly from the original report (Windows instead of Linux, USB4 instead of TB5, different dock), yet the failure mode looks very similar. That suggests a possible common issue in the driver / firmware layer rather than something limited to one OS or enclosure.

Hardware

  • Host: Beelink SER9 Pro
  • CPU: AMD Ryzen AI 9 HX 370
  • eGPU dock: EXP GDC TH3P4G3 (85W) (Thunderbolt 4 / USB4)
  • GPU: ASUS Prime GeForce RTX 5080 OC Edition 16GB
  • PSU: Corsair SF1000
  • Connection: USB4 40 Gbps
  • OS: Windows 11
  • Driver: 595.79
  • CUDA: 13.2
  • BIOS: SER9T305 (latest available for this board revision, updated during this investigation)

What works

  • nvidia-smi reports the GPU correctly at idle (Status OK, 16303 MiB VRAM visible)
  • GPU remains stable at idle for extended periods
  • deviceQuery from CUDA samples: PASS
  • Small PyTorch tensor operations on GPU: stable
  • ~4 GB VRAM allocation + write: stable
  • 4096x4096 float16 matrix multiplication sustained for 60 seconds: stable

What crashes

  • Heavier sustained CUDA stress with high VRAM pressure: hard crash
  • LLM inference in both LM Studio and Ollama with models loaded to GPU (~12+ GB VRAM): hard crash
  • The crash is not application-specific; I reproduced it with PyTorch, LM Studio, and Ollama independently

Crash signature on Windows

  • Bugcheck 0x00000119 (VIDEO_SCHEDULER_INTERNAL_ERROR)
  • Bugcheck 0x00000116 (VIDEO_TDR_FAILURE)
  • LiveKernelEvent 141 and 193
  • In earlier tests before BIOS update: nvlddmkm Event ID 14/153
  • In earlier tests before BIOS update: WHEA-Logger Event ID 16/17 pointing to PCI Express Root Port / Upstream Switch Port
  • GPU may enter PnP error states such as CM_PROB_HELD_FOR_EJECT (47), CM_PROB_PHANTOM, or Present = False
  • Recovery is not graceful; usually requires power-cycling the eGPU dock, and sometimes a forced host shutdown

Approximate stability boundary

Load level Test Result
Idle nvidia-smi, deviceQuery Stable
Low ~4 GB VRAM allocation + write Stable
Medium 4096x4096 matmul for 60s Stable
High heavier sustained mixed CUDA + VRAM pressure Crash

This suggests the issue appears once sustained PCIe traffic and VRAM pressure cross a certain threshold.

BIOS update impact

Updating the host BIOS from SER9T301 to SER9T305 improved low-level link stability. The GPU now enumerates more reliably as Status OK on boot and survives idle + moderate load more consistently. However, the hard crash under high sustained CUDA load still persists, which suggests the root cause is above basic ACPI / PCIe enumeration.

Why this seems relevant

My setup differs from the original report in several important ways:

  • Windows vs Linux
  • USB4 vs TB5
  • TH3P4G3 vs another enclosure

Despite that, the overall behavior is very similar: RTX 5080 works at idle, survives lighter CUDA work, then hard-locks under sustained heavier CUDA load in an external tunneled-PCIe setup.

That cross-platform similarity makes me suspect a broader driver or GSP firmware issue affecting Blackwell GPUs in tunneled-PCIe configurations.

gerpervaz avatar Apr 07 '26 09:04 gerpervaz

Managed to get similar box running without issues.

Data point for narrowing this down: similar setup (RTX 5080 + Razer Core X V2 over TB5, Dell Latitude 5540, Ubuntu 24.04, kernel 6.17, 590.48.01-open) working stably under sustained CUDA load — 4275 iterations of 8000×8000 matmul over 120s (~36 TFLOPs, no hard-lock, no throttling).

Two config differences from this issue that I suspect are load-bearing:

  • pci=realloc=off instead of pci=assign-busses,realloc. Counterintuitive — HPE advisory a00151736en_us documents that on Ubuntu + NVIDIA, pci=realloc can remove BIOS-assigned BARs without reassigning them. Switching to =off was what got probe to succeed here.
  • NVreg_DynamicPowerManagement=0x00 via modprobe — prevents D3cold entry, which over TB presents as "fallen off the bus."

Also: BIOS pre-boot TB modules enabled so BARs are allocated at POST, and cold-boot-only (no hot-plug).

Full recipe: https://forums.developer.nvidia.com/t/working-configuration-rtx-5080-razer-core-x-v2-thunderbolt-5-on-ubuntu-24-04-kernel-6-17-driver-590-48-01-open/366919

Haven't done ablation testing, and the enclosure/laptop differs from the original report (Razer Core X V2 vs Sonnet 850T5), so hardware might be the real variable. But the pci=realloc and power-management deltas seem worth testing given they target exactly the class of failure described.

bilikaz avatar Apr 17 '26 19:04 bilikaz

@bilikaz Thanks for this data point. I tested your full configuration on my setup (ASUS ROG Strix G18 G814JIR, i9-14900HX, TB4, Gigabyte AORUS RTX 5060 Ti AI BOX, driver 595.58.03 open):

  • pci=realloc=off: confirmed improvement — BAR0 is correctly allocated by BIOS (no more "BAR0 is 0M @ 0x0"), driver initializes on eGPU, nvidia-smi sees both GPUs, no GSP heartbeat timeout
  • NVreg_DynamicPowerManagement=0x00: applied
  • All other params from your recipe applied (pcie_aspm=off, pcie_ports=native, pcie_port_pm=off, thunderbolt.clx=0, thunderbolt.host_reset=0, iommu=pt)

However: cuCtxCreate still returns 999, and system freezes shortly after.

The critical difference is the BIOS. My ASUS ROG BIOS (v322, latest) does NOT expose "Thunderbolt PCIe pre-boot modules" — this option doesn't exist on ASUS gaming laptops. Cold boot with eGPU connected freezes before login. Only hot-plug works for detection, but then CUDA fails with 999.

This confirms your suspicion that "hardware might be the real variable" — specifically, the BIOS pre-boot TB enumeration appears to be the key differentiator. Without it, the GPU BARs are allocated but seemingly not in a state the driver can use for DMA/compute.

Affected BIOS: ASUS ROG (no TB pre-boot option) Working BIOS: Dell Latitude (TB pre-boot modules enabled)

fanfanmgz avatar Apr 20 '26 16:04 fanfanmgz

Do you disable video rendering by os on card? I have disable with few scripts using card just for AI. If i connect HDMI it always crashes hard in 5-10s. Due to signal instability. Buy for AI i was sniping containers with load of 12-13gb and load 97% no issues even running for several hours.

bilikaz avatar Apr 22 '26 04:04 bilikaz

Windows baseline rules out hardware — reinforces BIOS pre-boot TB hypothesis

Quick follow-up on my earlier report. Reimaged the same hardware (ASUS ROG Strix G18 G814JIR + AORUS RTX 5060 Ti AI BOX TB4) with Windows 11 25H2 to rule out hardware defect before investing more time on Linux.

Windows result: fully stable under sustained CUDA load (driver 595.79 Studio, CUDA 13.2, AORUS TB firmware F1.1 latest). Multi-hour LLM inference workloads complete cleanly — no Xid, no TDR, no link degradation. Baseline established at ~87 tok/s on a 13 GB MoE model (GPT-OSS 20B MXFP4) on the 5060 Ti alone, stable.

Point being: the exact hardware that hard-locks on cuCtxCreate_v2 under Linux runs arbitrary sustained compute on Windows indefinitely. Hardware defect and firmware are excluded.

Implication for the Linux hard-lock

Combined with @bilikaz's working Ubuntu/Dell Latitude config (which explicitly relies on "BIOS pre-boot TB modules enabled so BARs are allocated at POST"), and my failed attempt to replicate his config on ASUS (which lacks the pre-boot TB option), the evidence converges on:

The Linux hard-lock on Blackwell eGPUs via TB4/TB5 appears correlated with hosts that cannot enumerate TB devices at POST — specifically consumer/ gaming BIOSes (ASUS ROG, MSI gaming, Lenovo Legion) vs business BIOSes (Dell Latitude, HPE) which expose "Thunderbolt PCIe pre-boot modules" as a UEFI toggle.

When BARs are allocated at POST:

  • BIOS completes full PCIe enumeration including TB-tunneled devices
  • BAR1 sizing happens under firmware control with stable power state
  • Driver inherits a working memory map

When BARs are allocated at hot-plug (ASUS ROG case):

  • Kernel handles enumeration via pci=realloc or equivalent
  • Memory map passes read-only checks (nvidia-smi works)
  • But cuCtxCreate_v2 (which triggers DMA mapping through the TB bridge) fails catastrophically

Consistent with this: on my Linux attempts, lspci -vv always showed the 5060 Ti with BAR1 capped at 256 MB (vs 16 GB supported), and "VF BAR 2: can't assign; no space". Even with pci=realloc,hpbussize=0x10, hpmmiosize=64M,hpmmioprefsize=384M, the runtime allocation never achieved what BIOS pre-boot enumeration achieves in @bilikaz's working config.

Request for data points

If anyone has additional working/failing configs, could you confirm:

  1. Working config: does your host BIOS expose a "Thunderbolt PCIe pre-boot modules" or "TB Pre-Boot ACPI" option? Is it enabled?
  2. Failing config: is your BIOS from a consumer/gaming OEM line (ASUS ROG/TUF, MSI gaming, Lenovo Legion, Acer Predator, HP Omen), and does it lack any TB pre-boot toggle?

Correlating this across more data points would help confirm whether this is primarily a BIOS-level enumeration limitation on consumer laptop lines rather than purely a driver/GSP issue.

Happy to test any candidate kernel patches or driver parameters on this setup if someone wants a reproducible test subject.

fanfanmgz avatar Apr 24 '26 19:04 fanfanmgz

I followed @bilikaz recipe (https://forums.developer.nvidia.com/t/working-configuration-rtx-5080-razer-core-x-v2-thunderbolt-5-on-ubuntu-24-04-kernel-6-17-driver-590-48-01-open/366919) with my setup:

Lenovo E14 Gen 5 intel (updated to system firmware 0.1.39) AORUS RTX 5090 AI BOX Debian sid 6.19.14+deb14-amd64 Nvidia open Driver 595.71.05

i can access nvidia-smi read only and can set clock values and persistence mode but one i start a proper cuda workload the system freezes instantly.

It seems like without having the right thunderbolt config settings in uefi this workaround will not work for me =(

rvn2p avatar Apr 29 '26 09:04 rvn2p

Additional data point: AORUS RTX 5090 AI BOX via Thunderbolt/USB4 — one success, otherwise Xid 79 under CUDA/Blender/ollama load

I am adding another data point for the Blackwell eGPU instability described in this issue. My setup is a GIGABYTE AORUS RTX 5090 AI BOX connected over Thunderbolt/USB4 to a Dell XPS 17 9720 Linux laptop. The GPU enumerates, nvidia-smi works, and read-only queries are stable. CUDA/Blender/ollama load reproducibly causes the external GPU to fall off the PCIe bus with Xid 79.

The interesting part is that I had one successful boot where this same setup worked for several hours: I rendered multiple Blender scenes and loaded several Ollama models on the RTX 5090. The next comparable boot, with materially the same kernel/cmdline/driver/eGPU path, failed almost immediately under Blender. So this is not always a deterministic "never works" failure; there appears to be a rare lucky initialization state.

Hardware

Component Details
Host Dell XPS 17 9720
dGPU NVIDIA GeForce RTX 3060 Laptop GPU
iGPU Intel Iris Xe / Alder Lake-P
eGPU enclosure GIGABYTE AORUS RTX 5090 AI BOX
External GPU NVIDIA GeForce RTX 5090 / GB202, 32 GB
Connection USB4 / Thunderbolt, reported by boltctl as 40 Gb/s RX + 40 Gb/s TX, 2 lanes × 20 Gb/s
Thunderbolt bridge in enclosure Intel JHL9480 / Barlow Ridge, device IDs observed as 8086:5786
Laptop TB controller path Intel Thunderbolt 4 / Maple Ridge bridges, device IDs observed as 8086:1136, 8086:1137, 8086:1138
Dell firmware Latest available Dell firmware at time of testing
AORUS firmware No newer firmware found
Cable Tried more than one Thunderbolt cable; issue persists

I am intentionally omitting GPU UUIDs, host name, user name, home paths, and Thunderbolt UUIDs.

Software

Component Details
OS Manjaro Linux, KDE/Wayland
Primary kernel used for controlled tests 6.18.18-1-MANJARO
Other kernels tried 6.19.x series, including a later 6.19 build
NVIDIA driver / open kernel module 590.48.01
CUDA workload used for reproduction Blender Cycles CUDA render, BMW demo scene
Other workload that worked during the one good session Ollama model loading/inference on the RTX 5090

Current successful enumeration example:

GPU 0: NVIDIA GeForce RTX 3060 Laptop GPU, PCI 00000000:01:00.0
GPU 1: NVIDIA GeForce RTX 5090, PCI 00000000:73:00.0
Driver Version: 590.48.01
RTX 5090 idle state: P8, ~575 W default power limit, PCIe Gen1 x4 as reported by nvidia-smi

Kernel also reports the 5090 link as limited:

pci 0000:73:00.0: 8.000 Gb/s available PCIe bandwidth,
limited by 2.5 GT/s PCIe x4 link at 0000:6f:01.0
(capable of 504.112 Gb/s with 32.0 GT/s PCIe x16 link)

Kernel parameters tested

The one known-good boot and at least one failed boot both used the minimal cmdline:

security=apparmor udev.log_priority=3 ibt=off iommu=pt

I also tested variants involving:

pci=realloc
pci=assign-busses
pcie_port_pm=off
pcie_aspm=off
thunderbolt.clx=0
hpmmioprefsize=64G
hpmmioprefsize=4G
hpmmioprefsize=2G

The hpmmioprefsize changes affected resource-window noise, but did not provide a stable fix. 64G was clearly too large. 2G and 4G still allowed failures. The currently most useful comparison remains the minimal cmdline above, because I had both success and failure with materially the same visible pre-load state.

What works

  • The AORUS box is authorized by Thunderbolt/USB4.
  • The RTX 5090 enumerates on PCIe.
  • nvidia binds to both the internal RTX 3060 and external RTX 5090.
  • nvidia-smi read-only queries work.
  • Persistence mode and clock/power commands can be applied without immediately crashing the machine in at least some boots.
  • One boot worked for several hours with Blender renders and Ollama models on the RTX 5090.

What crashes

Blender Cycles CUDA rendering on the RTX 5090 causes the external GPU to disappear from the PCIe bus.

Recent controlled reproduction:

Blender started
BMW demo scene loaded
Rendering started:
NVRM: Xid (PCI:0000:73:00): 79, GPU has fallen off the bus.
NVRM: GPU 0000:73:00.0: GPU has fallen off the bus.
NVRM: nvGpuOpsReportFatalError: uvm encountered global fatal error 0x60, requiring os reboot to recover.
NVRM: Xid (PCI:0000:01:00): 154, GPU recovery action changed from 0x0 (None) to 0x2 (Node Reboot Required)
NVRM: Xid (PCI:0000:73:00): 154, GPU recovery action changed from 0x0 (None) to 0x2 (Node Reboot Required)

Blender then reports secondary CUDA errors:

cycles | ERROR Failed to retain CUDA context (Unknown error)
cycles | ERROR Invalid context in cuStreamCreate(...)
cycles | ERROR Launch failed ...

Those Blender CUDA errors appear to be consequences of the GPU already being lost, not the primary failure.

After the NVIDIA failure, USB/TB-side fallout can appear, for example:

r8152 ... NETDEV WATCHDOG: transmit queue 0 timed out

This happens after the Xid 79 / bus loss and looks like collateral damage from the Thunderbolt/USB4 path getting wedged.

Reproducer

  1. Cold boot laptop with the AORUS box attached and powered.

  2. Confirm the 5090 is visible:

    nvidia-smi
    
  3. Start Blender and render the BMW demo scene using CUDA on the RTX 5090.

  4. Within seconds the external RTX 5090 usually hits Xid 79 and disappears from the bus.

In some attempts the whole machine hard-locked before logs were flushed. In others, the machine is usable for a minute or so, before it hard-locks. When the machine hard-locks, it does not respond to magic sysrq.

Workarounds / mitigations tried

Power and clock limiting

I tried persistence mode, minimum power limit, and graphics clock locks:

nvidia-smi -i 1 -pm 1
nvidia-smi -i 1 -pl 400
nvidia-smi -i 1 -lgc 1000,1000
nvidia-smi -i 1 -lgc 1500,1500
nvidia-smi -i 1 -lgc 2000,2000

Notes:

  • The RTX 5090 reports a minimum power limit of 400 W, so lower limits such as 300 W are not accepted/effective.
  • 1000 MHz initially allowed multiple Blender passes after a cold boot.
  • 1500 MHz also allowed some passes initially.
  • On subsequent boots, Blender renders still caused a crashe/falling off the bus even at the conservative 1000 MHz lock.
  • Therefore clock limiting is not a reliable workaround on this setup.

Kernel parameters

I tested PCI resource allocation and power-management related parameters, including pci=realloc, assign-busses, pcie_port_pm=off, pcie_aspm=off, thunderbolt.clx=0, and several hpmmioprefsize values. None provided a reliable fix.

Cable / firmware

  • Tried another Thunderbolt cable and port, various combinations.
  • Tried with and without laptop charger connected (the enclosure doubles as a power supply, but is reported by my laptop as not providing enough power).
  • Dell firmware is current.
  • No newer AORUS firmware found.

Successful "unicorn" boot

The most notable observation is one long successful boot:

  • Same general hardware.

  • Same 6.18.18-1-MANJARO kernel.

  • Same minimal cmdline:

    security=apparmor udev.log_priority=3 ibt=off iommu=pt
    
  • Same external GPU PCI path in the logs.

  • Same recurring UCSI/typec errors.

  • Same general PCI resource warning pattern.

  • Same Gen1 x4 reported eGPU link limitation.

  • Blender rendered successfully.

  • Ollama loaded and used models on the 5090.

  • No Xid 79 occurred during that session.

The following failed workload boot looked materially the same before load, but Blender triggered Xid 79 almost immediately.

This suggests there is hidden state not captured by ordinary logs: possibly NVIDIA/GSP initialization state, Thunderbolt/USB4 tunnel state, retimer/link training state, runtime PM/LTR state, or enclosure warm/cold state.

Recurring boot-time warnings seen in both good and bad boots

These are present often enough that they are suspicious, but they are not sufficient to distinguish good from bad boots:

sysfs: cannot create duplicate filename '/devices/platform/USBC000:00/typec/port0/port0.0/partner'
typec-thunderbolt port0-partner.1: failed to create symlinks
typec-thunderbolt port0-partner.1: probe with driver typec-thunderbolt failed with error -17
ucsi_acpi USBC000:00: UCSI_GET_PDOS failed (-5)

NVIDIA also reports external-GPU / PCI hierarchy related messages such as:

NVRM: GPU1 objClInitPcieChipset: *** Unable to get PCI port handles
NVRM: GPU1 kbifInitLtr_GB202: LTR is disabled in the hierarchy

Again, these appear in boots where the card can enumerate and sometimes run, so they are not by themselves a complete explanation.

Assessment

This looks like the same class of issue reported by others here:

  • Blackwell eGPU over Thunderbolt/USB4.
  • nvidia-smi works at idle.
  • Read-only access is stable.
  • CUDA/Blender load causes the GPU to disappear from PCIe.
  • NVIDIA reports Xid 79, then UVM fatal 0x60, then Xid 154 requiring reboot.

My best guess is a cross-layer issue in the NVIDIA Blackwell/GSP external-GPU path interacting with Thunderbolt/USB4 PCIe tunneling. Thunderbolt/USB4 is clearly part of the failure mechanism because the GPU falls off the bus, but the trigger is NVIDIA CUDA/render load and the failure signature is in NVRM/GSP/UVM.

The one successful boot makes this especially interesting: the visible Linux PCI/TB/NVIDIA state before workload was effectively the same as in failed boots, which points to hidden initialization/link/firmware state rather than a simple missing kernel parameter.

Additional notes

  • The internal RTX 3060 is not the primary failing device. It receives Xid 154 after the external 5090 is lost, apparently as part of NVIDIA's global recovery state.
  • The eGPU has no display attached.
  • I am not attaching nvidia-bug-report.sh output here because previous attempts to run heavy NVIDIA diagnostics after GPU loss caused a hard lockup every time.

jciolek avatar May 01 '26 09:05 jciolek

I can reproduce a very similar hard lock / reboot with an RTX PRO 6000 Blackwell Workstation Edition connected as a USB4 eGPU through a MINISFORUM DEG2.

Summary

  • nvidia-smi works.
  • NVML queries and other basic GPU queries work and report the correct GPU.
  • CUDA device enumeration works far enough for PyTorch to report the GPU name.
  • The host hard-locks or reboots on the first actual CUDA device memory allocation.
  • This is not specific to vLLM or llama.cpp; a minimal PyTorch CUDA allocation is enough.
  • Setting the GPU power limit to 150W did not avoid the crash/reboot.
  • The collected logs show PCIe AER recovery failures on the external NVIDIA device path.

Hardware

  • Host: GMKTEC NucBox M6
  • eGPU adapter: MINISFORUM DEG2
  • Connection: USB4
  • GPU: NVIDIA RTX PRO 6000 Blackwell Workstation Edition
  • GPU PCI ID: 10de:2bb1
  • GPU bus: 0000:07:00.0
  • GPU audio function: 0000:07:00.1, PCI ID 10de:22e8
  • Bridge path includes Intel Thunderbolt 80/120G Bridge / Barlow Ridge Hub 80G 2023 devices
  • Barlow Ridge PCI ID: 8086:5786
  • Host USB4/TB tunnel: AMD Family 19h USB4/Thunderbolt PCIe tunnel, 1022:14cd
  • USB4/TB authorization/speed: authorized, 40 Gb/s RX + 40 Gb/s TX reported

Relevant lspci topology excerpt:

00:03.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 19h USB4/Thunderbolt PCIe tunnel [1022:14cd]
05:00.0 PCI bridge [0604]: Intel Corporation Thunderbolt 80/120G Bridge [Barlow Ridge Hub 80G 2023] [8086:5786] (rev 85)
06:00.0 PCI bridge [0604]: Intel Corporation Thunderbolt 80/120G Bridge [Barlow Ridge Hub 80G 2023] [8086:5786] (rev 85)
06:01.0 PCI bridge [0604]: Intel Corporation Thunderbolt 80/120G Bridge [Barlow Ridge Hub 80G 2023] [8086:5786] (rev 85)
06:02.0 PCI bridge [0604]: Intel Corporation Thunderbolt 80/120G Bridge [Barlow Ridge Hub 80G 2023] [8086:5786] (rev 85)
06:03.0 PCI bridge [0604]: Intel Corporation Thunderbolt 80/120G Bridge [Barlow Ridge Hub 80G 2023] [8086:5786] (rev 85)
07:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:2bb1] (rev a1)
07:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:22e8] (rev a1)

Software

  • OS: Ubuntu 24.04.1 LTS
  • Kernel: 6.17.0-22-generic
  • NVIDIA driver: 595.58.03
  • NVIDIA kernel module type: open kernel module
  • Installed NVIDIA packages include:
    • nvidia-driver-595-open
    • nvidia-dkms-595-open
    • nvidia-kernel-source-595-open
  • Module license reported by modinfo nvidia: Dual MIT/GPL
  • CUDA reported by nvidia-smi: 13.2
  • GSP firmware version reported by nvidia-smi -q: 595.58.03
  • Docker Engine: 27.3.1
  • NVIDIA Container Toolkit / runtime: 1.19.0

Kernel cmdline:

BOOT_IMAGE=/boot/vmlinuz-6.17.0-22-generic root=UUID=<masked> ro quiet splash vt.handoff=7

Secure Boot:

SecureBoot disabled

What Works

nvidia-smi succeeds at idle and reports the GPU correctly:

NVIDIA-SMI 595.58.03
Driver Version: 595.58.03
CUDA Version: 13.2

GPU 0: NVIDIA RTX PRO 6000 Blackwell Workstation Edition
Bus Id: 00000000:07:00.0
Product Architecture: Blackwell
Device Id: 0x2BB110DE
GSP Firmware Version: 595.58.03

At idle, the card is visible and basic GPU queries are stable:

P8, about 9W idle
Memory: 20 MiB used / 97887 MiB total
Display Attached: No
Persistence Mode: Disabled

Reproducer

The minimal reproducer I used is:

python - <<'PY'
import torch
print(torch.cuda.is_available(), flush=True)
print(torch.cuda.get_device_name(0), flush=True)
x = torch.empty((1024, 1024), device="cuda")
torch.cuda.synchronize()
print("small ok", flush=True)
PY

Observed output before the host locks/reboots:

True
NVIDIA RTX PRO 6000 Blackwell Workstation Edition

The system does not reach:

small ok

This suggests that the failure is triggered by the first real CUDA allocation/access, rather than by PCI enumeration or basic NVML queries.

PCIe / USB4 Link Status

The GPU advertises a much wider/faster PCIe capability, but the actual link is downgraded through the USB4/eGPU path:

NVIDIA 0000:07:00.0:
  LnkCap: Speed 32GT/s, Width x16
  LnkSta: Speed 2.5GT/s (downgraded), Width x4 (downgraded)

Barlow Ridge 0000:06:00.0:
  LnkCap: Speed 16GT/s, Width x4
  LnkSta: Speed 2.5GT/s, Width x4

This is looks like thunderbolt dynamic pcie behaiver

nvidia-smi -q similarly reports the current PCIe generation as Gen1 and width x4:

PCIe Generation:
  Max: 4
  Current: 1
  Device Current: 1
  Device Max: 5
  Host Max: 1

Link Width:
  Max: 16x
  Current: 4x

Kernel Logs

The collected logs show repeated PCIe AER failures involving the external NVIDIA GPU path:

pcieport 0000:00:03.1: AER: Uncorrectable (Non-Fatal) error message received from 0000:07:00.0
pci 0000:07:00.0: PCIe Bus Error: severity=Uncorrectable (Non-Fatal), type=Transaction Layer, (Requester ID)
pci 0000:07:00.0: AER: TLP Header: 0x40001001 0x0000000c 0xc808000c 0x00000000
pci 0000:07:00.0: AER: can't recover (no error_detected callback)
snd_hda_intel 0000:07:00.1: AER: can't recover (no error_detected callback)
pcieport 0000:06:00.0: AER: device recovery failed

The NVIDIA open kernel module is loaded:

NVRM: loading NVIDIA UNIX Open Kernel Module for x86_64  595.58.03

I did not find an Xid in the filtered logs from this run. The strongest persisted signal is PCIe AER recovery failure on the external GPU path.

Additional Observations

  • nvidia-smi works at idle.
  • PyTorch can query CUDA availability and the GPU name.
  • The crash/reboot occurs only when CUDA performs actual device allocation / access.
  • The issue reproduces outside vLLM and llama.cpp.
  • A 150W power limit did not prevent the failure.
  • The failure appears to involve the Blackwell GPU + USB4 eGPU path + Barlow Ridge / MINISFORUM DEG2 + NVIDIA open kernel module stack.

Attachments Available

I can attach:

  • nvidia-smi / nvidia-smi -q output
  • lspci -nn, lspci -tv, and lspci -vv output
  • PCIe link summary for the GPU and Barlow Ridge bridges
  • filtered kernel logs showing AER recovery failure
  • Docker / NVIDIA Container Toolkit information

TOSUKUi avatar May 02 '26 07:05 TOSUKUi

Update to my previous post

Quick rant about Windows

I have gone through hell and installed windows 11 on my machine - I just carved out a partition for dual boot, don't worry. This was not an experience I would wish on my worst enemy, it takes absolute ages, requires countless restarts and then installing all the drivers just to get the system to a reasonably good place. It took me most of the day. Anyway.

Aorus works on Windows - not a hardware issue

The Aorus RTX 5090 AI Box worked just fine on Windows 11, so it's definitely a software issue, not a hardware one. I loaded up qwen3.6:35b through ollama in WSL, there were no issues, the card handled it perfectly well.

Kernel 7.0 and Nvidia nvidia-open-dkms 595.71.05 still no joy

Since I posted last time, there has been and update to the kernel and nvidia modules on Manjaro. Full of hope, I launched kernel 7.0 with nvidia 595.71.05, but to my dismay I got a crash.

jciolek avatar May 03 '26 22:05 jciolek

I am currently experimenting with https://github.com/apnex/aorus-5090-egpu

Had to adapt some paths etc for debian sid to make it build (originally it was made for fedora) and it seems to run stable

It looks like a good temporary workaround and it is an impressive piece of work but no long-term replacement for a fixed driver

rvn2p avatar May 12 '26 11:05 rvn2p

I've been running a patched build of the open kernel module on hardware referenced in this thread GIGABYTE AORUS RTX 5090 AI Box over Thunderbolt 4 It's stable under the CUDA workloads that hard-lock the stock driver.

It's been my daily compute GPU for LLM inference (vLLM), and it survived a kernel 6.19→7.0 jump and a Fedora 43→44 upgrade without re-breaking.

Sharing it in case it helps others here.


Two public repos. I'm not affiliated with NVIDIA, and to be clear up front: this is a mitigation, not a fix — it improves the open driver's behaviour, it doesn't cure the root cause.

1. The investigation — apnex/aorus-5090-egpu

https://github.com/apnex/aorus-5090-egpu

This is where the troubleshooting happened:

A few weeks of many many (many) reboots and one-variable-at-a-time work isolating the failure modes behind #979 — WPR2 left stuck after a failed GSP init, GSP-lockdown cascades, DMA-path "Mode B" silent freezes (the ones that wedge mid model-upload with nothing in dmesg), recovery storms.

If you want to understand your own freeze rather than just patch over it, the docs/ here are the forensic trail — a failure-mode index, a hypothesis ledger, and a per-fix catalog with the empirical evidence behind each one.

The repo is frozen now, but the analysis stands and it's still a working (non-containerised) install.

2. The driver — apnex/nvidia-driver-injector

https://github.com/apnex/nvidia-driver-injector

My current path. Same patches, simpler, packaged as a container that builds and loads the module against whatever kernel you're running — so a kernel update doesn't mean a hand rebuild.

What the 7 patches do (against open driver 595.71.05):

  1. GPU-lost crash-safety — the core #979 fix. The stock open driver, on a single MMIO read returning 0xFFFFFFFF, calls osHandleGpuLost and marks the GPU permanently lost. On Thunderbolt that's routine link noise — one transient read becomes a reboot. This adds a short-circuit + brief retry at the 8 sites that do it.

  2. PCIe error handlers + recovery — the open driver leaves pci_error_handlers empty. This registers them, and adds a bounded in-driver recovery (parent-bridge bus reset + re-init retry) for when GSP init fails and leaves WPR2 stuck. Rate-limited and attempt-capped so it can't storm.

  3. AER mask clear — clears the GPU's AER Uncorrectable Mask at probe, so real PCIe errors actually reach the kernel's error handlers instead of being silently demoted to "advisory / correctable" and ignored.

  4. Q-watchdog — a small kernel thread polling the GPU at 5 Hz to catch the DMA-path silent freezes that the MMIO-path checks never see (no Xid, no AER, dmesg silent).

  5. Close-path instrumentation — passive state capture across the open→close→reopen lifecycle, to keep a known close-path bug-class mitigated.

  6. Diagnostic telemetry — rich state capture (PMC_BOOT_0, WPR2, link status, AER) at the driver lifecycle points. This is the surface that found the bugs above; off by default in production builds.

  7. Build metadata — version stamping + a build-time toggle for the diagnostics.Per-patch detail — exact bug signature, registers, sysfs surface — is in docs/patches.md.

The kernel cmdline matters too

The patched driver is only half of it — a Thunderbolt-tunnelled GPU also needs a few kernel boot parameters or it still destabilises. apply.sh sets these for you; shown here for transparency and for hand installs:

thunderbolt.host_reset=false           # don't reset the TB host controller (host_reset=true mis-sizes BAR1)
pci=resource_alignment=35@<bridge>     # force a 32 GB-aligned window so BAR1 sizes correctly
iommu=off intel_iommu=off              # eliminates the DMAR faults that were feeding the GSP-init failures
pcie_aspm.policy=performance           # no ASPM power-down on the GPU link
thunderbolt.clx=0                      # disable TB CL low-power link states
pcie_port_pm=off                       # disable PCIe port power management

<bridge> is the PCIe bridge directly above your GPU — apply.sh auto-detects it. Most of these are the same "stop the link/port power-managing itself" theme several people here landed on independently; the less-obvious one is pci=resource_alignment for BAR1 sizing — I found it more reliable than the hpmmioprefsize route.

The "Gen1 x4" link reading is a red herring

Several reports here flag nvidia-smi / lspci showing the GPU at 2.5 GT/s x4 ("downgraded"). On a Thunderbolt-tunnelled device the LnkSta / LnkCap speed and width fields are virtualized by the TB controller — they don't reflect real tunnel bandwidth.

Measure actual throughput instead (e.g. nvbandwidth): on TB4 you'll see ~2.8 GB/s host-to-device, which is the tunnel saturated, not a broken link.

It's not the cause of the freezes, and not worth tuning.

How to try it (minimal):

git clone https://github.com/apnex/nvidia-driver-injector /root/nvidia-driver-injector
cd /root/nvidia-driver-injector
sudo ./scripts/apply.sh        # host setup (kernel cmdline, modprobe.d, udev) — idempotent
sudo reboot                    # only if apply.sh changed the kernel cmdline
docker compose build
docker compose up -d

Verify: cat /sys/module/nvidia/version should print 595.71.05-aorus.13. Full step-by-step (Thunderbolt authorization, the verification suite) is in the repo README and docs/install-workflow.md.

Caveats

  • Tested hardware: AORUS RTX 5090 AI Box + Intel NUC 15 Pro+, Fedora. Your PCI addresses and kernel cmdline will differ — apply.sh auto-detects the bridge; the README shows how to find the values for a hand install.
  • Pinned to NVIDIA open driver 595.71.05.
  • Again — a mitigation, not a root-cause fix. Behaviour can still vary by host; this very thread shows the same hardware passing and failing across boots.

Ideally, one or more of these patches could be contributed to upstream - I'll try and clean up further, submit and see what happens.

apnex avatar May 22 '26 01:05 apnex

Kudos

Great work @apnex !

I can confirm that this set of driver and system patches worked for me and I was able to use my Aorus in CUDA capacity reliably.

Manjaro version

Since I run Manjaro, I have adapted your workflow to fit my system, here's the repo jciolek/aorus-5090-egpu.

I didn't need the docker workaround, instead just build the patched package based on the upstream and then install it.

Fun fact - the system is stable even with dynamic power management and nvidia-persistenced. Without nvidia-persistenced the gpus were drawing a lot more power when idle.

nvidia 610.43.02 takes us half way there

The new nvidia drivers 610.43.02 do not need patching anymore.

Also, nvida_modeset and nvidia_drm can be safely loaded. However, they still need to be loaded after the bridge link speed was set. I believe the bridge link issue needs to be fixed in the kernel.

Another thing - I have removed iommu=off and intel_iommu=off from kernel boot parameters and the CUDA workflow remained stable.

jciolek avatar Jun 04 '26 12:06 jciolek

Same idle-stable / hard-lock-on-CUDA-DMA reproduces on the Windows WDDM driver 610.47 (RTX A2000 + Razer Core X V2 / TB5). Will the #981 tunnel-settle/GSP-timeout fix be ported to the Windows branch?

evann-opsnexus avatar Jun 10 '26 14:06 evann-opsnexus