1. An error is reported when running the docker command
[email protected]:~# docker run --runtime=nvidia -ti -v $(pwd):/workspace -w /workspace -v /nfs:/nfs [email protected] --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
[email protected]:~# nvidia-docker
nvidia-docker: command not found
[email protected]:~#
Obviously, it is not installed
2 execute the script and install NVIDIA-docker
[email protected]:~# 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
[email protected]:~#
Check that NVIDIA-docker
and NVIDIA-container-Runtim
are installed successfully
[email protected]:~# which nvidia-docker
/usr/bin/nvidia-docker
[email protected]:~# which nvidia-container-runtime
/usr/bin/nvidia-container-runtime
[email protected]:~#
3 edit /etc/docker/daemon.JSON
is as follows
[email protected]:~# 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": []
}
}
}
[email protected]:~#
4 restart docker
[email protected]:~# systemctl daemon-reload
[email protected]:~# systemctl restart docker
5 verification
[email protected]:~# docker run --runtime=nvidia -ti -v $(pwd):/workspace -w /workspace -v /nfs:/nfs [email protected] --privileged -v /var/run/docker.sock:/var/run/docker.sock registry.test.cn/mla/cxx_toolchains:latest
[email protected]:/workspace#
[email protected]:/workspace# ls
[email protected]:/workspace# pwd
/workspace
[email protected]:/workspace#
Read More:
- How to Solve Docker Portainer Connect Error
- [Solved] Docker Start Error: Error response from daemon: oci runtime error: container with id exists: 7f4336393ab
- [Solved] Docker Startup Error: OCI runtime create failed container_linux.go380 starting container process
- How to Upload Docker Image to docker hub
- [Solved] Error response from daemon: driver failed programming external connectivity on endpoint mymysql
- [Solved] Centos7 Install docker Error: iptables v1.4.21: Couldn‘t load target `DOCKER-ISOLATION‘
- [Solved] Docker-maven-plugin Build Mirror Error: failed: Connection refused: connect
- [Solved] Redis Client On Error Error connect ECONNREFUSED 11.20.200.6379 Config right
- [Solved] Docker Start Error: System.InvalidOperationException Failed to set version to docker-desktop exit code
- [Solved] docker skywalking error: no provider found for module storage
- JSON parse error: invalid UTF-8 solution series [How to Solve]
- JAVA: How to Read JSON Format Data (Web Game Development)
- [Fixed] Disgusting bug Error:Failed to Load project configuration: cannot parse filemessage: content is not allowed in the preface.
- List: How to de-duplication according to an attribute of an object
- [Solved] docker Start jar package and Set JVM parameter Error
- How to Solve Java Runtime (class file version 53.0)ERROR
- [Solved] Mybatis insert Error: Cause: java.sql.SQLException: SQL String cannot be empty
- Java will convert Excel to list set or JSON, export excel file to local, excel import and export, easyexcel tool class
- [Solved] IDEA: Internal error (java.lang.UnsupportedClassVersionError)
- [Solved] Command line is too long. Shorten command line for XXXXXXXTest.rmLogRecordOver Error running