Skip to content

nixos/nvidia: softdep on nvidia-uvm fails with the open driver (breaks CUDA) #334180

Description

@eljamm

Describe the bug

Currently, the nvidia-uvm module is lazily loaded (EDIT: introduced in #267335) after the nvidia module:

boot.extraModprobeConfig = ''
  softdep nvidia post: nvidia-uvm
'';

This works fine with the closed-source module, but not with the open-source one. I'm currently using the stable 555.58.02, but I remember encountering this issue with the beta 560 drivers as well.

Aside from manually loading the module with modprobe, running nvidia-settings or nvidia-bug-report.sh (possibly other commands as well) makes the module load as reported in NVIDIA/open-gpu-kernel-modules#689

EDIT(SomeoneSerge): There are more reports reproducing the issue in #286028

Steps To Reproduce

  1. Enable the open nvidia kernel module with hardware.nvidia.open = true;
  2. Reboot your machine
  3. Try to use an application that uses CUDA (fails)
  4. See that nvidia-uvm is not loaded:
$ lsmod | grep nvidia_uvm
$ lsmod | grep nvidia
nvidia_drm            122880  1
nvidia_modeset       1916928  1 nvidia_drm
nvidia_wmi_ec_backlight    12288  0
nvidia              10297344  1 nvidia_modeset
video                  77824  4 nvidia_wmi_ec_backlight,amdgpu,ideapad_laptop,nvidia_modeset
backlight              28672  5 video,nvidia_wmi_ec_backlight,amdgpu,ideapad_laptop,nvidia_modeset
wmi                    32768  5 video,nvidia_wmi_ec_backlight,wmi_bmof,legion_laptop,ideapad_laptop
ecc                    40960  2 ecdh_generic,nvidia
  1. Run an nvidia- command with sudo:
$ sudo nvidia-settings
ERROR: libEGL setup error : libEGL.so.1: cannot open shared object file: No such file or directory

error: XDG_RUNTIME_DIR is invalid or not set in the environment.

(nvidia-settings:4006): GLib-GObject-CRITICAL **: 10:12:56.602: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
  1. See that nvidia-uvm is loaded:
$ lsmod | grep nvidia_uvm
nvidia_uvm           6815744  0
nvidia              10297344  2 nvidia_uvm,nvidia_modeset
$ lsmod | grep nvidia
nvidia_uvm           6815744  0
nvidia_drm            122880  1
nvidia_modeset       1916928  1 nvidia_drm
nvidia_wmi_ec_backlight    12288  0
nvidia              10297344  2 nvidia_uvm,nvidia_modeset
video                  77824  4 nvidia_wmi_ec_backlight,amdgpu,ideapad_laptop,nvidia_modeset
backlight              28672  5 video,nvidia_wmi_ec_backlight,amdgpu,ideapad_laptop,nvidia_modeset
wmi                    32768  5 video,nvidia_wmi_ec_backlight,wmi_bmof,legion_laptop,ideapad_laptop
ecc                    40960  2 ecdh_generic,nvidia
  1. Try to use an application that uses CUDA (succeeds)

Expected behavior

The nvidia-uvm module loads automatically after the nvidia module.

Additional context

It's worth noting that nvidia-uvm is the only module not in boot.kernelModules. Adding it there, the module is automatically loaded on startup, as intended.

Notify maintainers

Pinging those who I think would be most interested in this. Apologies if I'm wrong.

@Kiskae @NickCao @NixOS/cuda-maintainers

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.3-xanmod1, NixOS, 24.11 (Vicuna), 24.11.20240809.5e0ca22`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.90.0`
 - nixpkgs: `/nix/store/0jr2kk95c34c0b6yxi75q4fqgb43kqkm-source`

Add a 👍 reaction to issues you find important.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: cudaParallel computing platform and API6.topic: hardwareDrivers, Firmware and Kernels6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions