diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index 00bb005f636a..bc66e3c8b7eb 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -12,30 +12,40 @@ let kernel = callPackage # a hacky way of extracting parameters from callPackage ({ kernel, libsOnly ? false }: if libsOnly then { } else kernel) { }; + + selectHighestVersion = a: b: if lib.versionOlder a.version b.version + then b + else a; in rec { + # Official Unix Drivers - https://www.nvidia.com/en-us/drivers/unix/ + # Branch/Maturity data - http://people.freedesktop.org/~aplattner/nvidia-versions.txt + # Policy: use the highest stable version as the default (on our master). - stable = if stdenv.hostPlatform.system == "x86_64-linux" - then generic { - version = "515.65.01"; - sha256_64bit = "sha256-BJLdxbXmWqAMvHYujWaAIFyNCOEDtxMQh6FRJq7klek="; - openSha256 = "sha256-GCCDnaDsbXTmbCYZBCM3fpHmOSWti/DkBJwYrRGAMPI="; - settingsSha256 = "sha256-kBELMJCIWD9peZba14wfCoxsi3UXO3ehFYcVh4nvzVg="; - persistencedSha256 = "sha256-P8oT7g944HvNk2Ot/0T0sJM7dZs+e0d+KwbwRrmsuDY="; - } - else legacy_390; + stable = if stdenv.hostPlatform.system == "i686-linux" then legacy_390 else latest; - # see https://www.nvidia.com/en-us/drivers/unix/ "Production branch" - production = stable; + production = generic { + version = "515.65.01"; + sha256_64bit = "sha256-BJLdxbXmWqAMvHYujWaAIFyNCOEDtxMQh6FRJq7klek="; + openSha256 = "sha256-GCCDnaDsbXTmbCYZBCM3fpHmOSWti/DkBJwYrRGAMPI="; + settingsSha256 = "sha256-kBELMJCIWD9peZba14wfCoxsi3UXO3ehFYcVh4nvzVg="; + persistencedSha256 = "sha256-P8oT7g944HvNk2Ot/0T0sJM7dZs+e0d+KwbwRrmsuDY="; + }; - beta = generic { + latest = selectHighestVersion production (generic { + version = "495.46"; + sha256_64bit = "2Dt30X2gxUZnqlsT1uqVpcUTBCV7Hs8vjUo7WuMcYvU="; + settingsSha256 = "vbcZYn+UBBGwjfrJ6SyXt3+JLBeNcXK4h8mjj7qxZPk="; + persistencedSha256 = "ieYqkVxe26cLw1LUgBsFSSowAyfZkTcItIzQCestCXI="; + }); + + beta = selectHighestVersion latest (generic { version = "515.43.04"; sha256_64bit = "sha256-PodaTTUOSyMW8rtdtabIkSLskgzAymQyfToNlwxPPcc="; openSha256 = "sha256-1bAr5dWZ4jnY3Uo2JaEz/rhw2HuW9LZ5bACmA1VG068="; settingsSha256 = "sha256-j47LtP6FNTPfiXFh9KwXX8vZOQzlytA30ZfW9N5F2PY="; persistencedSha256 = "sha256-hULBy0wnVpLH8I0L6O9/HfgvJURtE2whpXOgN/vb3Wo="; - broken = kernel.kernelAtLeast "5.19"; # Added at 2022-08-12 - }; + }); # Vulkan developer beta driver # See here for more information: https://developer.nvidia.com/vulkan-driver diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix index 768d4179111f..d6dcc7ad6cd0 100644 --- a/pkgs/os-specific/linux/nvidia-x11/generic.nix +++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix @@ -103,7 +103,10 @@ let disallowedReferences = optional (!libsOnly) [ kernel.dev ]; passthru = { - open = mapNullable (hash: callPackage (import ./open.nix self hash) { }) openSha256; + open = mapNullable (hash: callPackage ./open.nix { + inherit hash broken; + nvidia_x11 = self; + }) openSha256; settings = (if settings32Bit then pkgsi686Linux.callPackage else callPackage) (import ./settings.nix self settingsSha256) { withGtk2 = preferGtk2; withGtk3 = !preferGtk2; diff --git a/pkgs/os-specific/linux/nvidia-x11/open.nix b/pkgs/os-specific/linux/nvidia-x11/open.nix index 5f8715aa7360..3e21dade83ae 100644 --- a/pkgs/os-specific/linux/nvidia-x11/open.nix +++ b/pkgs/os-specific/linux/nvidia-x11/open.nix @@ -1,8 +1,10 @@ -nvidia_x11: hash: { stdenv , lib , fetchFromGitHub , kernel +, nvidia_x11 +, hash +, broken ? false }: stdenv.mkDerivation { @@ -32,7 +34,7 @@ stdenv.mkDerivation { homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules"; license = with licenses; [ gpl2Plus mit ]; platforms = platforms.linux; - broken = kernel.kernelAtLeast "5.19"; maintainers = with maintainers; [ nickcao ]; + inherit broken; }; } diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index bb19710ffd87..e2e20726525b 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -356,12 +356,13 @@ in { nvidiaPackages = dontRecurseIntoAttrs (lib.makeExtensible (_: callPackage ../os-specific/linux/nvidia-x11 { })); + nvidia_x11 = nvidiaPackages.stable; + nvidia_x11_beta = nvidiaPackages.beta; nvidia_x11_legacy340 = nvidiaPackages.legacy_340; nvidia_x11_legacy390 = nvidiaPackages.legacy_390; nvidia_x11_legacy470 = nvidiaPackages.legacy_470; - nvidia_x11_beta = nvidiaPackages.beta; + nvidia_x11_production = nvidiaPackages.production; nvidia_x11_vulkan_beta = nvidiaPackages.vulkan_beta; - nvidia_x11 = nvidiaPackages.stable; # this is not a replacement for nvidia_x11 # only the opensource kernel driver exposed for hydra to build