GPU hot-unplug and surprise-removal safety for a Thunderbolt eGPU on Linux

Parent: Thunderbolt eGPU on Linux for local LLM inference · Published reference · snapshot 2026-09-08 · skill devops-linux-internals/references/egpu-hot-unplug-pciehp-safety-linux.md

Also known as: dpc surprise down, egpu hot unplug, non-zero usage count, nvidia-smi drain, nvidia_remove hang, pciehp link down, safe eject egpu linux, surprise removal

↓ Facts as markdown↓ Download this reference fileall context files

Why unplugging a Thunderbolt eGPU is unsafe on Linux with NVIDIA and what the kernel does about it — pciehp surprise link-down handling, the PCI core's disconnected flag and all-ones MMIO, DPC versus

These notes link each claim to its source. A source may be a research report hosted on this site rather than the primary document. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.

GPU hot-unplug and surprise-removal safety for a Thunderbolt eGPU on Linux

eGPU Hot-Unplug and Surprise-Removal Safety on Linux

Core Concepts

DPC vs surprise removal

Kernel 6.19 regression signal

What happens to userspace at removal

Removal State Machine

Planned Detach Runbook

Userspace Tooling

Anti-patterns

Open questions / unverified

See also (sibling references in this hub)

  • Related references added later: egpu-unattended-remote-recovery-and-out-of-band-linux.md (host-first escalation ladder, remote power control and out-of-band access). [source]
  • Sources

    Children

    Frontier under this node: DPC containment vs surprise removal, DRM hot-unplug contract in amdgpu and xe, PCI core disconnected flag and all-ones MMIO, amdgpu removable-GPU runtime-PM policy, nvidia-persistenced and open file descriptors blocking removal, nvidia-smi drain for planned detach, nvidia_remove usage-count hang, pciehp surprise link-down handling

    ← the whole tree · 3D view· how to read this page