这个错误是什么原因:docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #1:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: container error: cgroup subsystem devices not found: unknown.
时间: 2023-12-21 09:05:20 浏览: 513
这个错误可能是由于缺少 nvidia-container-runtime 导致的。请确保已正确安装 nvidia-container-runtime 并将其配置为默认的运行时程序。您可以按照以下步骤安装和配置 nvidia-container-runtime:
1. 安装 nvidia-container-runtime
```
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \
sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
$ curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install nvidia-container-runtime
```
2. 配置 Docker 的默认运行时
```
$ sudo vi /etc/docker/daemon.json
{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}
}
```
3. 重启 Docker
```
$ sudo systemctl restart docker
```
以上步骤可能需要使用管理员权限执行。如果您已经安装了 nvidia-container-runtime,请确保它与 Docker 版本兼容,并且已正确配置为默认的运行时程序。
阅读全文