diff options
author | Yang, Bo <bo@preemo.io> | 2023-11-23 10:31:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-23 19:31:34 +0100 |
commit | 1f885ef065c540bbd59f7fd2877a021a759641b7 (patch) | |
tree | 5d6c23c382aaefeaf070a5bfc7c12dbf5e5344b5 /nixos | |
parent | ca3b90ebaf16cebdb25e1ce72212898d3aa5c2c9 (diff) |
[Backport release-23.11] nixos/nvidia: load `nvidia-uvm` kernel module via `softdep` (#269473)
(cherry picked from commit 932441c86d7918f1033f651db3637021d87fa3f5)
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/hardware/video/nvidia.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix index c36775dd24bba..c76883b656d40 100644 --- a/nixos/modules/hardware/video/nvidia.nix +++ b/nixos/modules/hardware/video/nvidia.nix @@ -261,7 +261,16 @@ in { ]; boot = { blacklistedKernelModules = ["nouveau" "nvidiafb"]; - kernelModules = [ "nvidia-uvm" ]; + + # Don't add `nvidia-uvm` to `kernelModules`, because we want + # `nvidia-uvm` be loaded only after `udev` rules for `nvidia` kernel + # module are applied. + # + # Instead, we use `softdep` to lazily load `nvidia-uvm` kernel module + # after `nvidia` kernel module is loaded and `udev` rules are applied. + extraModprobeConfig = '' + softdep nvidia post: nvidia-uvm + ''; }; systemd.tmpfiles.rules = lib.optional config.virtualisation.docker.enableNvidia |