当我想在没有 gpu 的环境调试一个支持 cuda 的容器时
nvidia-container-cli: initialization error: nvml error: driver not loaded: unknown
解决办法是增加 NVIDIA_VISIBLE_DEVICES=void 环境变量,让容器继续执行不报无 gpu 错误
docker run -e NVIDIA_VISIBLE_DEVICES=void cuda_env_image
参考:NVIDIA_VISIBLE_DEVICES
https://github.com/NVIDIA/nvidia-container-runtime/blob/d2bb9d0afee2fc2be545a97b0fcda9bf553a1b29/README.md