Failed to connect to bus when trying to install Nvidia drivers in container


I am following this guide to have nvidia up and running in my container: Installation Guide — NVIDIA Cloud Native Technologies documentation

All steps were fine until I got to this line: sudo systemctl restart docker

This is the output I got:

root@76c5a7719093:/workspace# sudo systemctl restart docker
Failed to connect to bus: No such file or directory

I assume something isn’t installed but couldn’t find anything relevant for this problem.


Are you running the command IN a docker container?

Yes, that’s how I understood it…

Hi again

No, it must all be done on the host, then you can test it afterwards with:

docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

Thanks for the clarification.

I followed through all of the steps in the host and the last line:
sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

Gave me this error:

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.