Containers fix glibc, not the driver: the NGC PyTorch ceiling on CentOS 7
Two A30 training boxes both run CentOS 7. Trying to get a newer torch onto them, pip install simply refuses; so we pulled nvcr.io/nvidia/pytorch:26.11-py3, the container started, import torch succeeded — and torch.cuda.is_available() came back False.
It is tempting to assume a wrong package got installed. There are two failures here with completely different causes, and a container only addresses one of them.
First entry in the environment baseline line. The whole point of that line is one question: given this machine, how far can you get?
Three errors, two causes
First: pip install torch==2.7.1 does not fail loudly, it just reports that no distribution is available. The reason is the wheel platform tag — the Linux build of torch 2.7.1 ships only as manylinux_2_28, which requires glibc 2.28 or newer, and this host has glibc 2.17.
Second: import torch fails with an undefined libnvJitLink symbol. That is a different problem: /usr/local/cuda/lib64 on the host holds an older CUDA library that gets loaded before the pip-installed nvidia/*/lib copies. Putting the pip paths first fixes it, and none of it is about version compatibility.
One manual export is a rescue, not a routine. The environment was created by conda, so let conda own it: drop a script into the environment's activate.d that puts the pip libraries first on activation.
# $CONDA_PREFIX/etc/conda/activate.d/00-nvidia-libs.sh
for d in "$CONDA_PREFIX"/lib/python*/site-packages/nvidia/*/lib; do
[ -d "$d" ] && NV="$NV:$d"
done
export LD_LIBRARY_PATH="${NV#:}:$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"A matching deactivate.d restores the original value so no other environment is polluted. After that, conda activate vllm073 gives the correct order by itself: pip's nvidia/*/lib first, the conda env lib next, the host /usr/local/cuda/lib64 last. import torch works and torch.cuda.is_available() is True without anyone remembering that path string.
Third: inside the container torch imports fine, but no CUDA context can be created:
CUDA initialization: The NVIDIA driver on your system is too old
(found version 12040)12040 is the CUDA version the driver reports, i.e. 12.4. This one has nothing to do with glibc.
Where user space ends and the driver begins
A container packages user space only: glibc, CUDA runtime, cuDNN, NCCL, Python packages. The driver is not in there — the kernel driver always comes from the host, and nvidia-container-runtime merely maps /dev/nvidia* and the driver libraries into the container.
So the rule is blunt:
- Depends on a glibc version, a missing system library, or several conflicting CUDA versions → a container fixes it
- The driver is too old → a container cannot help; the driver has to be upgraded
One container can hit both classes at once. With 26.11 the user-space side was solved and the kernel side blocked.
Version arithmetic: how far 550 reaches, what 13.5 needs
The CUDA Toolkit release notes give an explicit table: CUDA 13.5 corresponds to the R620 driver branch; the floor for the whole 13.x family is driver ≥ 580; the 12.x range is ≥ 525 and < 580.
This host runs 550.163.01, inside the 12.x range, so any CUDA 12.x program works. The 26.11 container, however, is CUDA 13.5.0.25 with torch 2.15.0a0, and its startup banner is unusually direct:
This container was built for NVIDIA Driver Release 620.70 or later, but
version 550.163.01 was detected and compatibility mode is UNAVAILABLE.A common misconception worth clearing up: CUDA forward compatibility (the cuda-compat package) is not a blank cheque. It lets newer CUDA run on older drivers, but across major versions the driver still has to clear that major version's floor. For 13.x the floor is 580, so 550 does not even get in the door — which is exactly why the banner reports compatibility mode as unavailable.
Half of the image's built-in tutorial is out of date
One hint printed at container start is genuinely useful:
docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 ...because /dev/shm inside a container defaults to 64MB, and PyTorch DataLoader with several workers dies on that immediately. --ipc=host is the actual fix.
/workspace/README.md, on the other hand, has expired. It states that pytorch lives in a Python 3.5 conda environment at /opt/conda/envs/pytorch-py35, while the real image is Ubuntu 24.04.5, Python 3.12.3, packages under /usr/local/lib/python3.12/dist-packages/torch. Following the old README costs you half an hour of hunting for a conda environment that does not exist. Trust the release-notes version table plus what you measure inside the container.
A command you can actually use
Combining the two hints, the invocation should look like this (NFS data mounted, shared memory raised):
docker run --rm -it --gpus all \
--ipc=host --ulimit memlock=-1 --ulimit stack=67108864 \
-v /home/exp:/workspace/exp \
nvcr.io/nvidia/pytorch:26.11-py3 bash--ipc=host decides whether DataLoader can use multiple workers; -v decides where your code and weights live. Get these wrong and you see "memory blows up mid-training" and "the model re-downloads every time you rebuild the container" — neither of which looks like a configuration mistake.
Three routes that actually exist on this machine
| Route | Cost | Criterion |
|---|---|---|
| pip install torch 2.5.1 on the host | Verified working; version stuck at 2.5.x | Driver 550 unchanged, CUDA 12.4 matches |
| Use an NGC image tag from the CUDA 12.x era | 18.8GB image, framework frozen at 2.4 | Verified: 24.05-py3 runs on this host |
| Upgrade the driver past R580, then use 26.11 | Must confirm driver packages still exist for this CentOS 7 | Not verified on this host |
The tag that worked: 24.05-py3
We verified the second route on gpu01. The choice was nvcr.io/nvidia/pytorch:24.05-py3; its release notes state it is built on CUDA 12.4.1 and requires driver 545 or later (525.85 or later is acceptable on data center GPUs), and 550.163.01 falls inside that range with no compat flags at all.
The image is 18.8GB. Measured inside the container:
py 3.10.12 | torch 2.4.0a0+07cecf4168.nv24.05 | cuda 12.4 | cudnn 90100
avail True | dev NVIDIA A30 | sm (8, 0)
matmul 4096^3 x50: 5.4 ms/iterVersions match the release notes exactly, and torch.cuda.is_available() returns True. The machine now has two working paths side by side: torch 2.5.1 from pip on the host, and 2.4 inside the container. The first is more convenient; the second ships cuDNN 9.1, NCCL 2.21 and TensorRT 10.0.
We also used it as a cross-check: running the same decode benchmark inside the container gives CUDA Graph speedups of 4.11×, 2.51× and 1.14× at batch 1/16/64, versus 4.34×, 2.61× and 1.18× on the host. One minor torch version apart and containerised versus not, the curve keeps its shape — so that conclusion does not depend on the environment.
We have the first route working: torch 2.5.1+cu124 trains and serves on both A30 boxes. The cost is an API frozen at 2.5, so newer operators and features are out of reach. The third route is not a simple upgrade — availability of driver packages on an old distribution has to be checked first, so do not treat it as the default.
One reusable check
Given a machine, read CUDA Version in the top-right corner of nvidia-smi, then look it up in the driver table in the CUDA Toolkit release notes. Whichever major version range that driver falls into sets the ceiling for the images you may use. No image, however new, upgrades the host driver for you.
A container is a user-space patch, not a driver upgrader. Treat it as the latter and you will stall exactly at the moment torch.cuda.is_available() returns False.