Sharing one host Python virtualenv across concurrent or canceled CI jobs
Canceled GPU tests routinely orphan worker processes or leak CUDA IPC handles unless isolated in cgroup/container boundaries.
Operator task guide
Long-lived self-hosted GitHub Actions, Buildkite, or GitLab GPU runners fail intermittently when a prior timed-out CI job leaves zombie CUDA processes holding VRAM, stale container /dev/shm IPC files, full disk caches, or latent Xid hardware faults.
Run a fast deterministic preflight gate before every CI job checks out code: assert expected GPU count and healthy ECC state, terminate orphaned compute PIDs or recreate ephemeral containers, verify free /dev/shm and disk space, and auto-cordon unhealthy runners.
Reviewed . Reference guidance is not a diagnosis of your workload.
Avoid running bare-host pytest directly across sequential CI jobs. Launch each test run inside a fresh container (--ipc=host or explicit --shm-size=16g) so shared memory and CUDA contexts tear down cleanly when tests cancel or timeout.
docker run --rm --gpus all --shm-size=16g \
-v "$GITHUB_WORKSPACE:/work" -w /work \
your-ci-image:cuda12.8 pytest tests/Verify expected GPU count, zero stale compute processes occupying >100 MiB VRAM, zero newly retired/uncorrectable ECC pages, and adequate scratch NVMe headroom before starting expensive model tests.
nvidia-smi --query-gpu=index,uuid,memory.used,ecc.errors.uncorrected.aggregate.total --format=csv,noheader
nvidia-smi --query-compute-apps=pid,used_memory --format=csv,noheader
df -h /var/lib/docker /tmpIf a compute process fails to exit on SIGKILL (D-state kernel wedge after Xid 79, Xid 95, or Xid 143) or uncorrectable volatile ECC spikes, deregister the runner from CI automatically instead of retrying builds on a wedged host.
dmesg -T | grep -E 'NVRM: Xid .*: (31|43|48|74|79|95|119|143)' | tail -n 10| Signal | What it means | Next action |
|---|---|---|
| Leftover python PID holding VRAM after canceled workflow | Orphaned subprocess escaped job signal group | Run tests in isolated --init containers and reap leftover cgroup PIDs on preflight. |
| Bus error or unable to map shared memory mid DataLoader CI step | Container defaulted to 64 MiB /dev/shm | Configure --shm-size=16g or /dev/shm tmpfs mount in runner template. |
| Disk pressure inside /var/lib/docker or Hugging Face cache | Accumulated multi-GB model weights and layers | Prune stale HF cache & dangling Docker images on cron and verify free GiB in preflight. |
| Xid 79 / Xid 95 or process stuck in D-state during preflight | Node requires host reboot / cold reset or RMA inspection | Cordon runner immediately and capture host logs before rebooting. |
Canceled GPU tests routinely orphan worker processes or leak CUDA IPC handles unless isolated in cgroup/container boundaries.
Every subsequent PR will randomly fail CI on the broken node until engineers stop trusting green/red signals.
Check ECC counters, compute apps, and NVML errors from preflight logs.
Check kernel register and shared-memory limits across runner GPU architectures.
Resolve OOM, illegal memory access, and kernel image mismatches failing CI suites.
Docker allocates only 64 MiB to /dev/shm by default. Multi-worker PyTorch DataLoader tensors quickly fill 64 MiB and crash with SIGBUS unless --shm-size or --ipc=host is configured.
Set explicit cache size caps or run nightly cleanup when free disk drops below 20%, and inspect df -h in a pre-job health check before pulling large container layers or checkpoints.
Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.
Diagnose your incident