1. An error is reported when running the docker command
root@test:~# docker run --runtime=nvidia -ti -v $(pwd):/workspace -w /workspace -v /nfs:/nfs $@ --privileged -v /var/run/docker.sock:/var/run/docker.sock registry.test.cn/mla/cxx_toolchains:latest
docker: Error response from daemon: Unknown runtime specified nvidia.
See 'docker run --help'.
According to the error prompt, check whether NVIDIA-docker
is installed
root@test:~# nvidia-docker
nvidia-docker: command not found
root@test:~#
Obviously, it is not installed
2 execute the script and install NVIDIA-docker
root@test:~# cat install-nvidia-docker.sh
sudo curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
sudo curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
root@test:~#
Check that NVIDIA-docker
and NVIDIA-container-Runtim
are installed successfully
root@test:~# which nvidia-docker
/usr/bin/nvidia-docker
root@test:~# which nvidia-container-runtime
/usr/bin/nvidia-container-runtime
root@test:~#
3 edit /etc/docker/daemon.JSON
is as follows
root@test:~# cat /etc/docker/daemon.json
{
"insecure-registries": ["registry.test.cn"],
"max-concurrent-downloads": 10,
"log-driver": "json-file",
"log-level": "warn",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"live-restore": true,
"metrics-addr": "0.0.0.0:9323",
"default-runtime": "nvidia",
"experimental": true,
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}
}
root@test:~#
4 restart docker
root@test:~# systemctl daemon-reload
root@test:~# systemctl restart docker
5 verification
root@test:~# docker run --runtime=nvidia -ti -v $(pwd):/workspace -w /workspace -v /nfs:/nfs $@ --privileged -v /var/run/docker.sock:/var/run/docker.sock registry.test.cn/mla/cxx_toolchains:latest
root@c3a43f4564a8:/workspace#
root@c3a43f4564a8:/workspace# ls
root@c3a43f4564a8:/workspace# pwd
/workspace
root@c3a43f4564a8:/workspace#
Read More:
- [Solved] Docker Startup Error: OCI runtime create failed container_linux.go380 starting container process
- [Solved] Docker Start Error: Error response from daemon: oci runtime error: container with id exists: 7f4336393ab
- How to Solve Java Runtime (class file version 53.0)ERROR
- How to Solve classnotfoundexception error in spark without Hadoop runtime
- [Solved] MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.Runtime
- [Solved] Centos7 Install docker Error: iptables v1.4.21: Couldn‘t load target `DOCKER-ISOLATION‘
- How to Upload Docker Image to docker hub
- [Solved] Docker Start Error: System.InvalidOperationException Failed to set version to docker-desktop exit code
- How to Solve Docker Portainer Connect Error
- [Solved] docker Error response from daemon driver failed programming external connectivity on endpoint lamp
- [Solved] Docker Run Tomcat Error: Cannot find /usr/local/tomcat/bin/setclasspath.sh
- [Solved] Docker-maven-plugin Build Mirror Error: failed: Connection refused: connect
- [Solved] docker skywalking error: no provider found for module storage
- [Solved] docker Start jar package and Set JVM parameter Error
- [Solved] Docker Elasticsearch8.4.0 Error: Exception in thread “main” java.nio.file.FileSystemException
- [Solved] JPA query data error: Page 1 of 0 containing UNKNOWN instances
- [Solved] java.sql.SQLException: Unknown system variable cache query size
- Ruoyi-cloud Integrated mybatis-plus Error: Unknown column ‘search_value‘ in ‘field list‘
- Appium Run Error: An unknown server-side error occurred while processing the command. Original error: Cann
- [Solved] IDEA Error: Unknown system variable ‘tx_isolation‘ at