2023-03-27 19:17:25 +00:00
|
|
|
{ lib, callPackage, fetchFromGitHub, fetchurl, fetchpatch, stdenv, pkgsi686Linux }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
generic = args: let
|
|
|
|
imported = import ./generic.nix args;
|
2022-06-26 10:26:21 +00:00
|
|
|
in callPackage imported {
|
2021-02-05 17:12:51 +00:00
|
|
|
lib32 = (pkgsi686Linux.callPackage imported {
|
|
|
|
libsOnly = true;
|
|
|
|
kernel = null;
|
|
|
|
}).out;
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
kernel = callPackage # a hacky way of extracting parameters from callPackage
|
|
|
|
({ kernel, libsOnly ? false }: if libsOnly then { } else kernel) { };
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
selectHighestVersion = a: b: if lib.versionOlder a.version b.version
|
|
|
|
then b
|
|
|
|
else a;
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
rec {
|
2023-08-04 22:07:22 +00:00
|
|
|
mkDriver = generic;
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# Official Unix Drivers - https://www.nvidia.com/en-us/drivers/unix/
|
|
|
|
# Branch/Maturity data - http://people.freedesktop.org/~aplattner/nvidia-versions.txt
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Policy: use the highest stable version as the default (on our master).
|
2022-08-21 13:32:41 +00:00
|
|
|
stable = if stdenv.hostPlatform.system == "i686-linux" then legacy_390 else latest;
|
|
|
|
|
|
|
|
production = generic {
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "535.154.05";
|
|
|
|
sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg=";
|
|
|
|
sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k=";
|
|
|
|
openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo=";
|
|
|
|
settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10=";
|
|
|
|
persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
latest = selectHighestVersion production (generic {
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "545.29.06";
|
|
|
|
sha256_64bit = "sha256-grxVZ2rdQ0FsFG5wxiTI3GrxbMBMcjhoDFajDgBFsXs=";
|
|
|
|
sha256_aarch64 = "sha256-o6ZSjM4gHcotFe+nhFTePPlXm0+RFf64dSIDt+RmeeQ=";
|
|
|
|
openSha256 = "sha256-h4CxaU7EYvBYVbbdjiixBhKf096LyatU6/V6CeY9NKE=";
|
|
|
|
settingsSha256 = "sha256-YBaKpRQWSdXG8Usev8s3GYHCPqL8PpJeF6gpa2droWY=";
|
|
|
|
persistencedSha256 = "sha256-AiYrrOgMagIixu3Ss2rePdoL24CKORFvzgZY3jlNbwM=";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
patchFlags = [ "-p1" "-d" "kernel" ];
|
2023-11-16 04:20:00 +00:00
|
|
|
patches = [];
|
2022-08-21 13:32:41 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
beta = selectHighestVersion latest (generic {
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "550.40.07";
|
|
|
|
sha256_64bit = "sha256-KYk2xye37v7ZW7h+uNJM/u8fNf7KyGTZjiaU03dJpK0=";
|
|
|
|
sha256_aarch64 = "sha256-AV7KgRXYaQGBFl7zuRcfnTGr8rS5n13nGUIe3mJTXb4=";
|
|
|
|
openSha256 = "sha256-mRUTEWVsbjq+psVe+kAT6MjyZuLkG2yRDxCMvDJRL1I=";
|
|
|
|
settingsSha256 = "sha256-c30AQa4g4a1EHmaEu1yc05oqY01y+IusbBuq+P6rMCs=";
|
|
|
|
persistencedSha256 = "sha256-11tLSY8uUIl4X/roNnxf5yS2PQvHvoNjnd2CB67e870=";
|
2022-08-21 13:32:41 +00:00
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Vulkan developer beta driver
|
2020-12-25 13:55:36 +00:00
|
|
|
# See here for more information: https://developer.nvidia.com/vulkan-driver
|
|
|
|
vulkan_beta = generic rec {
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "535.43.22";
|
2023-08-22 20:05:09 +00:00
|
|
|
persistencedVersion = "535.98";
|
|
|
|
settingsVersion = "535.98";
|
2024-01-02 11:29:13 +00:00
|
|
|
sha256_64bit = "sha256-emam5bfYJeFi1+Z0Z1//luaY1JTKcQNYUP8GmG9480Q=";
|
|
|
|
openSha256 = "sha256-8Nz6LfEdAsm7d6Leqs+ikN0BpOPkLCcd7bckK0MOIFU=";
|
2023-08-22 20:05:09 +00:00
|
|
|
settingsSha256 = "sha256-jCRfeB1w6/dA27gaz6t5/Qo7On0zbAPIi74LYLel34s=";
|
|
|
|
persistencedSha256 = "sha256-WviDU6B50YG8dO64CGvU3xK8WFUX8nvvVYm/fuGyroM=";
|
2024-01-02 11:29:13 +00:00
|
|
|
url = "https://developer.nvidia.com/downloads/vulkan-beta-${lib.concatStrings (lib.splitVersion version)}-linux";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# data center driver compatible with current default cudaPackages
|
|
|
|
dc = dc_520;
|
|
|
|
dc_520 = generic rec {
|
|
|
|
version = "520.61.05";
|
|
|
|
url = "https://us.download.nvidia.com/tesla/${version}/NVIDIA-Linux-x86_64-${version}.run";
|
|
|
|
sha256_64bit = "sha256-EPYWZwOur/6iN/otDMrNDpNXr1mzu8cIqQl8lXhQlzU==";
|
|
|
|
fabricmanagerSha256 = "sha256-o8Kbmkg7qczKQclaGvEyXNzEOWq9ZpQZn9syeffnEiE==";
|
|
|
|
useSettings = false;
|
|
|
|
usePersistenced = false;
|
|
|
|
useFabricmanager = true;
|
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
dc_535 = generic rec {
|
|
|
|
version = "535.129.03";
|
|
|
|
url = "https://us.download.nvidia.com/tesla/${version}/NVIDIA-Linux-x86_64-${version}.run";
|
|
|
|
sha256_64bit = "sha256-5tylYmomCMa7KgRs/LfBrzOLnpYafdkKwJu4oSb/AC4=";
|
|
|
|
persistencedSha256 = "sha256-FRMqY5uAJzq3o+YdM2Mdjj8Df6/cuUUAnh52Ne4koME=";
|
|
|
|
fabricmanagerSha256 = "sha256-5KRYS+JLVAhDkBn8Z7e0uJvULQy6dSpwnYsbBxw7Mxg=";
|
|
|
|
useSettings = false;
|
|
|
|
usePersistenced = true;
|
|
|
|
useFabricmanager = true;
|
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# Update note:
|
|
|
|
# If you add a legacy driver here, also update `top-level/linux-kernels.nix`,
|
|
|
|
# adding to the `nvidia_x11_legacy*` entries.
|
|
|
|
|
|
|
|
# Last one supporting Kepler architecture
|
|
|
|
legacy_470 = generic {
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "470.223.02";
|
|
|
|
sha256_64bit = "sha256-s2hi1TNsw+br6Ow6tPiFsYPaJY8d+x4FrkBrP2xNRPg=";
|
|
|
|
sha256_aarch64 = "sha256-CFkg2ARlGWqlFQKm8SlbwMH6eLidHKA/q5QGVOpPGuU=";
|
|
|
|
settingsSha256 = "sha256-r6DuIH/rnsCm/y51iRgPNi5/kz+EFMVABREdTjBneZ0=";
|
|
|
|
persistencedSha256 = "sha256-e71fpPBBv8S/aoeXxBXkzKy5bsMMbv8y024cSLc8DYc=";
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
patchFlags = [ "-p1" "-d" "kernel" ];
|
2023-11-16 04:20:00 +00:00
|
|
|
patches = [];
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Last one supporting x86
|
|
|
|
legacy_390 = generic {
|
2022-11-27 09:42:12 +00:00
|
|
|
version = "390.157";
|
|
|
|
sha256_32bit = "sha256-VdZeCkU5qct5YgDF8Qgv4mP7CVHeqvlqnP/rioD3B5k=";
|
|
|
|
sha256_64bit = "sha256-W+u8puj+1da52BBw+541HxjtxTSVJVPL3HHo/QubMoo=";
|
|
|
|
settingsSha256 = "sha256-uJZO4ak/w/yeTQ9QdXJSiaURDLkevlI81de0q4PpFpw=";
|
|
|
|
persistencedSha256 = "sha256-NuqUQbVt80gYTXgIcu0crAORfsj9BCRooyH3Gp1y1ns=";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
broken = kernel.kernelAtLeast "6.2";
|
2024-01-25 14:12:00 +00:00
|
|
|
|
|
|
|
# fixes the bug described in https://bbs.archlinux.org/viewtopic.php?pid=2083439#p2083439
|
|
|
|
# see https://bbs.archlinux.org/viewtopic.php?pid=2083651#p2083651
|
|
|
|
# and https://bbs.archlinux.org/viewtopic.php?pid=2083699#p2083699
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/lib/tls/* $out/lib
|
|
|
|
rmdir $out/lib/tls
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
legacy_340 = let
|
2024-01-25 14:12:00 +00:00
|
|
|
# Source corresponding to https://aur.archlinux.org/packages/nvidia-340xx-dkms
|
2023-03-27 19:17:25 +00:00
|
|
|
aurPatches = fetchFromGitHub {
|
|
|
|
owner = "archlinux-jerry";
|
|
|
|
repo = "nvidia-340xx";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "7616dfed253aa93ca7d2e05caf6f7f332c439c90";
|
|
|
|
hash = "sha256-1qlYc17aEbLD4W8XXn1qKryBk2ltT6cVIv5zAs0jXZo=";
|
2023-03-27 19:17:25 +00:00
|
|
|
};
|
|
|
|
patchset = [
|
|
|
|
"0001-kernel-5.7.patch"
|
|
|
|
"0002-kernel-5.8.patch"
|
|
|
|
"0003-kernel-5.9.patch"
|
|
|
|
"0004-kernel-5.10.patch"
|
|
|
|
"0005-kernel-5.11.patch"
|
|
|
|
"0006-kernel-5.14.patch"
|
|
|
|
"0007-kernel-5.15.patch"
|
|
|
|
"0008-kernel-5.16.patch"
|
|
|
|
"0009-kernel-5.17.patch"
|
|
|
|
"0010-kernel-5.18.patch"
|
|
|
|
"0011-kernel-6.0.patch"
|
2023-05-24 13:37:59 +00:00
|
|
|
"0012-kernel-6.2.patch"
|
|
|
|
"0013-kernel-6.3.patch"
|
2023-10-09 19:29:22 +00:00
|
|
|
"0014-kernel-6.5.patch"
|
2024-01-13 08:15:51 +00:00
|
|
|
"0015-kernel-6.6.patch"
|
2023-03-27 19:17:25 +00:00
|
|
|
];
|
|
|
|
in generic {
|
2020-07-18 16:06:22 +00:00
|
|
|
version = "340.108";
|
|
|
|
sha256_32bit = "1jkwa1phf0x4sgw8pvr9d6krmmr3wkgwyygrxhdazwyr2bbalci0";
|
|
|
|
sha256_64bit = "06xp6c0sa7v1b82gf0pq0i5p0vdhmm3v964v0ypw36y0nzqx8wf6";
|
|
|
|
settingsSha256 = "0zm29jcf0mp1nykcravnzb5isypm8l8mg2gpsvwxipb7nk1ivy34";
|
|
|
|
persistencedSha256 = "1ax4xn3nmxg1y6immq933cqzw6cj04x93saiasdc0kjlv0pvvnkn";
|
2020-04-24 23:36:52 +00:00
|
|
|
useGLVND = false;
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
broken = kernel.kernelAtLeast "6.7";
|
2023-03-27 19:17:25 +00:00
|
|
|
patches = map (patch: "${aurPatches}/${patch}") patchset;
|
2024-01-25 14:12:00 +00:00
|
|
|
|
|
|
|
# fixes the bug described in https://bbs.archlinux.org/viewtopic.php?pid=2083439#p2083439
|
|
|
|
# see https://bbs.archlinux.org/viewtopic.php?pid=2083651#p2083651
|
|
|
|
# and https://bbs.archlinux.org/viewtopic.php?pid=2083699#p2083699
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/lib/tls/* $out/lib
|
|
|
|
rmdir $out/lib/tls
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|