Nvidia docker seems not working

the option enableNvidia in configuration of docker seems not working there is error with libcuda.so not found in cointainer.
my config

virtualisation = {
    docker = {
      enable = true;
      enableNvidia = true;
    };
  };

the error:
WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.

Use the NVIDIA Container Toolkit to start this container with GPU support; see

Welcome — NVIDIA Cloud Native Technologies documentation .

1 Like

Please always paste error logs otherwise we can only do guess work. Also please replace private information with placeholders.

2 Likes

WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.

Use the NVIDIA Container Toolkit to start this container with GPU support; see

Welcome — NVIDIA Cloud Native Technologies documentation .

Do you have the nvidia driver enabled in your config?

Yes i enabled it and it works.

في الجمعة، ٢٤ مارس ٢٠٢٣ ٢١:٣٧ Adam Stephens via NixOS Discourse <discourse@discourse.nixos.org> كتب:

What is the full docker command you are running?

  • See if the host is configured properly: check if /run/opengl-driver/lib/libcuda.so really exists. If it doesn’t, check hardware.opengl.enable. You’ve already discussed the driver earlier in the thread
  • When you run a container, you still need to explicitly expose the gpus. E.g. if you use docker run, you 'll need to pass something like --gpus all

As was mentioned, do describe what you run. E.g. you could upload the logs that feature the commands you’re running and the output (the exact errors) they produce

Cheers!

1 Like