安装 nvidia-container-toolkit 以支持 docker 使用显卡
引言
如果在 docker 使用 gpu 的时候,出现以下错误:
1 | docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. |
可以参考以下步骤安装 nvidia-container-toolkit 以支持 docker 使用显卡。
官网地址:
Installing the NVIDIA Container Toolkit — NVIDIA Container Toolkit 1.16.2 documentation
过程
Installing with Yum or Dnf
Configure the production repository:
1 | curl -s -L <https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo> | \ |
Optionally, configure the repository to use experimental packages:
1 | sudo yum-config-manager --enable nvidia-container-toolkit-experimental |
Install the NVIDIA Container Toolkit packages:
1 | # 更新仓库 |
Configure the container runtime by using the nvidia-ctk command:
1 | sudo nvidia-ctk runtime configure --runtime=docker |
Restart the Docker daemon:
1 | sudo systemctl restart docker |
结论
引用
- [docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]]. AFTER installing nvidia-docker2 - Stack Overflow](https://stackoverflow.com/questions/75118992/docker-error-response-from-daemon-could-not-select-device-driver-with-capab)
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment