NVIDIA / nvidia-docker

Build and run Docker containers leveraging NVIDIA GPUs
Apache License 2.0
17.17k stars 2.03k forks source link

Can't run an nvidia cuda image without local drivers #1712

Closed oo92 closed 8 months ago

oo92 commented 1 year ago

Hi.

I pull this image: https://hub.docker.com/layers/nvidia/cuda/11.8.0-devel-ubuntu22.04/images/sha256-0c4830108130fe92fa3e9ba8a9a813bf1264e2cddd1902b2c30750aada5ede38?context=explore

like this: docker pull nvidia/cuda:11.8.0-devel-ubuntu22.04

After the successful download, I am trying to run the image like this: docker run nvidia/cuda:11.8.0-devel-ubuntu22.04

But it is giving me the following error:

docker: Error response from daemon: failed to create shim task: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/305e31cc5a8870eba58fd1433edd6dffca4b66c86f2d00997a1e847abbad76f2/log.json: no such file or directory): fork/exec /usr/bin/nvidia-container-runtime: no such file or directory: unknown.
ERRO[0001] error waiting for container: context canceled 

Now, I don't have nvidia drivers or nvidia container toolkit installed on this VM and I see that to be the reason why. However, when I do install the drivers with sudo ubuntu-drivers autoinstall and sudo apt-get install nvidia-container-toolki, I get version mismatch.

Where am I going wrong?

matifali commented 1 year ago

The drivers should be installed for the do docker images to work. Its a pre_requisite

elezar commented 8 months ago

As @matifali the drivers are a prerequisite for containers to have access to GPUs.