NVIDIA / nvidia-container-toolkit

Build and run containers leveraging NVIDIA GPUs
Apache License 2.0
2.37k stars 255 forks source link

error when trying: sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi #260

Open valentindbdg opened 2 years ago

valentindbdg commented 2 years ago

sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi gives me: docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: nvml error: driver not loaded: unknown.

2. Steps to reproduce the issue

3. Information to attach (optional if deemed irrelevant)

Server: Docker Engine - Community Engine: Version: 20.10.14 API version: 1.41 (minimum version 1.12) Go version: go1.16.15 Git commit: 87a90dc Built: Thu Mar 24 01:45:53 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.5.11 GitCommit: 3df54a852345ae127d1fa3092b95168e4a88e2f8 runc: Version: 1.0.3 GitCommit: v1.0.3-0-gf46b6ba docker-init: Version: 0.19.0 GitCommit: de40ad0

elezar commented 2 years ago

@valentindbdg if nvidia-smi doesn't work on the host this indicates that the driver isn't installed correctly. Could you try reinstalling the driver and confirming that nvidia-smi works on the host system before launching a container?

zpeng1898 commented 2 years ago

@elezar Hello, I have a question: can I install nvidia driver successfully without a GPU on my laptop? Some libs need the driver, but I just want to run python codes with these libs in CPU mode. So I wonder if nvidia-smi will successfully shows if I don't have a physical GPU on my laptop. Thanks~