NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.37k stars 14.32k forks source link

Nvidia UVM not being loaded #286028

Open keirlawson opened 10 months ago

keirlawson commented 10 months ago

Describe the bug

Even though it is specified as a softdep in /etc/modprobe.d/nixos.conf nvidia-uvm is not loaded

Steps To Reproduce

Steps to reproduce the behavior:

  1. boot system with nvidia driver enabled

Expected behavior

nvidia-uvm is loaded

Additional context

❯ cat /etc/modprobe.d/nixos.conf
blacklist usblp
blacklist nouveau
blacklist nvidiafb

softdep nvidia post: nvidia-uvm

This is the same bug as https://github.com/NixOS/nixpkgs/issues/272413 which was closed

Metadata

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.74, NixOS, 23.11 (Tapir), 23.11.3496.a77ab169a83a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

dbeecham commented 9 months ago
> cat /etc/modprobe.d/nixos.conf 
blacklist ip_tables
blacklist nouveau
blacklist nvidiafb

softdep nvidia post: nvidia-uvm
> nix run .#inputs.nixpkgs.legacyPackages.x86_64-linux.nix-info -- -m
warning: Git tree '/home/dbe/dotfiles' is dirty
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.75, NixOS, 24.05 (Uakari), 24.05.20240127.c002c6a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
> lsmod | rg nvidia
nvidia_drm            102400  10
drm_kms_helper        192512  1 nvidia_drm
nvidia_modeset       1335296  19 nvidia_drm
video                  65536  2 asus_wmi,nvidia_modeset
nvidia_uvm           1540096  0
nvidia              56221696  301 nvidia_uvm,nvidia_modeset
drm                   581632  14 drm_kms_helper,nvidia,nvidia_drm
backlight              24576  4 video,asus_wmi,drm,nvidia_modeset
firmware_class         49152  12 btrtl,snd_hda_intel,xhci_pci_renesas,btmtk,snd_sof,nvidia,btintel,btbcm,iwlwifi,btusb,cfg80211,drm

Seems to work for me?

keirlawson commented 9 months ago
❯ nixos-version
23.11.3496.a77ab169a83a (Tapir)
❯ lsmod | rg nvidia                                                  
nvidia_drm            102400  25
drm_kms_helper        192512  4 drm_display_helper,amdgpu,nvidia_drm
nvidia_modeset       1474560  7 nvidia_drm
video                  65536  3 asus_wmi,amdgpu,nvidia_modeset
nvidia               7708672  204 nvidia_modeset
ecc                    40960  1 nvidia
drm                   581632  25 gpu_sched,drm_kms_helper,drm_display_helper,nvidia,drm_buddy,amdgpu,drm_ttm_helper,nvidia_drm,ttm
backlight              24576  6 video,drm_display_helper,asus_wmi,amdgpu,drm,nvidia_modeset
firmware_class         49152  12 r8169,ccp,snd_hda_intel,xhci_pci_renesas,drm_display_helper,nvidia,amdgpu,mt7921_common,mt76x2u,mt76_connac_lib,cfg80211,drm

I note we are on different NixOS versions, so wonder if its just with stable that its broken?

ac130kz commented 9 months ago

The UVM driver often loads only after a long delay for me. I also have HW video acceleration dropping back to EGL backend from the direct vaapi nvdec driver, could it be related? On Arch I have all of the Nvidia's drivers loaded at once, that seems to work fine. I'll try to do the same on NixOS.

[  738.031825] nvidia-uvm: Loaded the UVM driver, major device number 238.
nvidia_uvm           1757184  0
nvidia_drm            118784  21
nvidia_modeset       1847296  5 nvidia_drm
nvidia               8949760  522 nvidia_uvm,nvidia_modeset
drm_kms_helper        253952  1 nvidia_drm
video                  73728  1 nvidia_modeset
ecc                    40960  1 nvidia
drm                   770048  16 drm_kms_helper,nvidia,nvidia_drm
backlight              28672  3 video,drm,nvidia_modeset
firmware_class         53248  8 r8169,ccp,snd_hda_intel,xhci_pci_renesas,nvidia,iwlwifi,cfg80211,drm
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.16, NixOS, 24.05 (Uakari), 24.05pre582649.d934204a0f8d`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
TanawatJukmongkol commented 3 months ago

Same here.

I just added it to the kernel params

jaredmontoya commented 1 month ago

I have the same issue on the latest unstable. I have to manually execute sudo modprobe nvidia_uvm for OBS to use NVENC and for Ollama to execute LLMs with CUDA

I am using open source nvidia kernel modules so I guess the issue is already tracked here I also don't use xserver.enable because I use wayland for everything so the symptomatic fix doesn't work. Adding nvidia_uvm to kernelModules in my config fixes the problem for me.

Abaan404 commented 1 month ago

+1 had the same issue, running sudo modprobe nvidia_uvm fixed it