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=1


The following error appeared:


failed to inject CDI devices: failed to stat CDI host device "/dev/dri/card1": no such file or directory


Root 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/card1


On 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

  1. Remove temporary CDI files:
sudo rm -f /var/run/cdi/nvidia.yaml /run/cdi/nvidia.yaml


  1. Remove or move the residual UUID CDI file:
sudo mv /etc/cdi/D.<UUID>.yaml ~/D.<UUID>_backup.yaml


  1. Keep only the valid CDI file:
/etc/cdi/nvidia.yaml


  1. Restart Docker:
sudo systemctl restart docker

Updated on: 11/06/2026