nvidia-container-runtime works well exactly as instructed by the guide.
But it deprecated and advised to switch to [https://github.com/NVIDIA/nvidia-container-toolkit?tab=readme-ov-file]
sudo tee /etc/docker/daemon.json <<EOF
{
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-toolkit",
"runtimeArgs": []
}
}
}
EOF
but got an error when using "docker compose ... up":
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/e5a45f0f12e0c02ec1708dc89576a0972ab477a5c45a5db8cd6a312605b11084/log.json: no such file or directory): /usr/bin/nvidia-container-toolkit did not terminate successfully: exit status 2: flag provided but not defined: -root
Usage of /usr/bin/nvidia-container-toolkit:
-config string
configuration file
-debug
enable debug output
-version
enable version output
Commands:
prestart
run the prestart hook
poststart
no-op
poststop
no-op
: unknown