suvash/nixos-nvidia-cuda-python-docker-compose

libnvidia-ml.so.1 missing

Stinosko opened this issue · 2 comments

Hey,

This is a reference for future me and those that also got the same issues. I got the following errors when installing 02-nixos-docker-nvidia-setup.

First was a complaint during building about the configuration:

error:
       … while calling the 'head' builtin

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:922:11:

          921|         || pred here (elemAt values 1) (head values) then
          922|           head values
             |           ^
          923|         else

       … while evaluating the attribute 'value'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:807:9:

          806|     in warnDeprecation opt //
          807|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          808|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error:
       Failed assertions:
       - Option enableNvidia on x86_64 requires 32bit support libraries

Second was:

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory: unknown.

Both were fixed by adding this to the configuration:

  hardware.opengl = {                                                                                       
    enable = true;  # Fixes the second issue
    driSupport32Bit = true;  # Fixes the first issue
  };

Source: https://discourse.nixos.org/t/running-docker-with-nvidia-complains-it-cant-find-libnvidia-ml-so-1/26696/8

Edit: Spelling mistake

suvash commented

Thanks for posting this. I'll make a note of it when I next update the documentation.

suvash commented

I have now added this information in the initial driver setup. (I was already using these settings personally, so makes sense that I'd share it as well.)
https://github.com/suvash/nixos-nvidia-cuda-python-docker-compose/blob/5d54f6f8e67c8fe68a490e113f21b950c3e14126/01-nixos-nvidia-setup.org#nvidia_gpunix