bad bandwidthtest2 failed to inject CDI devices: failed to stat CDI host device "/dev/dri/card1": no such file or directory
Issue
While running the following Docker GPU bandwidth test:
docker run --rm --runtime=nvidia --env NVIDIA_VISIBLE_DEVICES=0 vastai/test:bandwidth-test-nvidia --csv --device=0 --memory=pinned --mode=range --start=1073741824 --end=1073741824 --increment=1The following error appeared:
failed to inject CDI devices: failed to stat CDI host device "/dev/dri/card1": no such file or directoryRoot Cause
The issue was caused by stale or conflicting CDI (Container Device Interface) configuration files.
Some CDI files still contained references to a non-existent DRI device:
/dev/dri/card1On the affected machine, leftover CDI files included:
/var/run/cdi/nvidia.yaml
/run/cdi/nvidia.yaml
/etc/cdi/D.<UUID>.yaml
/etc/cdi/nvidia.yaml.bak
These outdated files caused Docker to fail when injecting GPU devices into the container.
Solution
Clean up the stale CDI files and keep only the valid CDI configuration.
Steps
- Remove temporary CDI files:
sudo rm -f /var/run/cdi/nvidia.yaml /run/cdi/nvidia.yaml- Remove or move the residual UUID CDI file:
sudo mv /etc/cdi/D.<UUID>.yaml ~/D.<UUID>_backup.yaml- Keep only the valid CDI file:
/etc/cdi/nvidia.yaml- Restart Docker:
sudo systemctl restart dockerUpdated on: 11/06/2026
