Skip to content

Commit 7034504

Browse files
vulkan: Add vulkan support for nvidia
Update nvidia to add support for vulkan and fix the vaapi support which currently seems to be only available in the closed drivers. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
1 parent 0636251 commit 7034504

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

modules/desktop/nvidia-gpu/default.nix

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ in
4040
pkgs.egl-wayland
4141
pkgs.mesa
4242
pkgs.libGL
43+
# some vulkan stuff
44+
#pkgs.libvdpau-va-gl
45+
pkgs.vulkan-loader
4346
];
4447

4548
nvidia = {
@@ -51,11 +54,12 @@ in
5154
powerManagement.enable = false;
5255
# TODO: this may fix screen tearing but if not needed it can cause more issues
5356
# than it actually fixes. so leave it to off by default
54-
#forceFullCompositionPipeline = true;
55-
# TODO: testing the open drivers recommended by nvidia
56-
open = true; # false;
57+
forceFullCompositionPipeline = false;
58+
# TODO: testing the open drivers recommended by nvidia, fails to load the cuda modules
59+
# and hence fails vaapi support
60+
open = false; # true;
5761
nvidiaSettings = true;
58-
package = config.boot.kernelPackages.nvidiaPackages.beta; # was beta
62+
package = config.boot.kernelPackages.nvidiaPackages.beta; # was stable
5963

6064
dynamicBoost.enable = cfg.enable && cfg.withIntegratedGPU;
6165
};
@@ -64,6 +68,8 @@ in
6468
# Load nvidia driver for Xorg and Wayland
6569
services.xserver.videoDrivers = [ "nvidia" ];
6670

71+
environment.systemPackages = [ pkgs.vulkan-tools ];
72+
6773
boot = {
6874
# TODO: what exactly does xanmod package bring?
6975
# https://xanmod.org/
@@ -84,6 +90,10 @@ in
8490
# Current monitor does not support it, but this is useful for
8591
# the future
8692
"NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100"
93+
94+
# The nvidia cuda initialization fails if this is not set in
95+
# the newer drivers.
96+
"NVreg_PreserveVideoMemoryAllocations=1"
8797
];
8898
};
8999

modules/desktop/nvidia-gpu/vaapi.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ in
9797
"media.ffmpeg.vaapi.enabled" = true;
9898
"media.rdd-ffmpeg.enabled" = true;
9999
"media.av1.enabled" = cfg.firefox.av1Support;
100+
#TODO: enable when the 137 release notes show which flags to show
101+
#"media.hevc.enabled" = true;
102+
#"dom.media.webcodecs.h265.enabled" = true;
100103
"gfx.x11-egl.force-enabled" = true;
101104
"widget.dmabuf.force-enabled" = true;
102105
};

targets/laptop/flake-module.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ let
111111
ghaf = {
112112
reference.profiles.mvp-user-trial.enable = true;
113113
partitioning.disko.enable = true;
114+
profiles.graphics.idleManagement.enable = lib.mkForce false;
114115
};
115116
}
116117
]))
@@ -120,6 +121,7 @@ let
120121
ghaf = {
121122
reference.profiles.mvp-user-trial.enable = true;
122123
partitioning.disko.enable = true;
124+
profiles.graphics.idleManagement.enable = lib.mkForce false;
123125
};
124126
}
125127
]))

0 commit comments

Comments
 (0)