diff --git a/desktop.nix b/desktop.nix index 05732e0..2abb931 100644 --- a/desktop.nix +++ b/desktop.nix @@ -166,6 +166,8 @@ in { hardware.steam-hardware.enable = true; programs.steam.remotePlay.openFirewall = true; environment.variables = { + "__GL_SHADER_DISK_CACHE" = "true"; + "__GL_SHADER_DISK_CACHE_SIZE" = "${toString (50 * 1000)}"; "__GL_SHADER_DISK_CACHE_SKIP_CLEANUP" = "1"; # Avoid 128mb limit of shader cache "__GL_SHADER_DISK_CACHE_PATH" = cfg.graphics.shaderCache.path + "/nvidia" ; "MESA_SHADER_CACHE_MAX_SIZE" = "50G"; # Put large-enough value. Default is only 1G diff --git a/hardware/nvidia.nix b/hardware/nvidia.nix index 62daacf..d1f1e63 100644 --- a/hardware/nvidia.nix +++ b/hardware/nvidia.nix @@ -34,9 +34,17 @@ in libvdpau-va-gl vaapiVdpau ]; + hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libvdpau-va-gl vaapiVdpau ]; + + # See documentation here: https://download.nvidia.com/XFree86/Linux-x86_64/510.60.02/README/openglenvvariables.html + environment.variables = ifEnable cfg.useProprietary { + "__GL_YIELD" = "USLEEP"; # use usleep(0) instead of sched_yield() -> better performance in most cases + "__GL_ALLOW_UNOFFICIAL_PROTOCOL" = "1"; # allow unofficial GLX protocol if also set in Xorg conf + "__GL_VRR_ALLOWED" = "1"; # Try to enable G-SYNC VRR if screen AND app is compatible + }; }; }