nixos/nvidia: add nvidia_dc_565 drivers

Also remove dc_520
This commit is contained in:
Edward Tjörnhammar 2024-12-19 17:44:52 +01:00
parent 51fabd133e
commit 438969f9ee
5 changed files with 38 additions and 21 deletions

View file

@ -96,6 +96,8 @@
- `nodePackages.copy-webpack-plugin` has been removed, as it should be installed in projects that use it instead.
- `linuxPackages.nvidiaPackages.dc_520` has been removed since it is marked broken and there are better newer alternatives.
- `racket_7_9` has been removed, as it is insecure. It is recommended to use Racket 8 instead.
- `ente-auth` now uses the name `enteauth` for its binary. The previous name was `ente_auth`.

View file

@ -304,7 +304,7 @@ in
message = "You cannot configure both X11 and Data Center drivers at the same time.";
}
{
assertion = cfg.open != null;
assertion = cfg.open != null || cfg.datacenter.enable;
message = ''
You must configure `hardware.nvidia.open` on NVIDIA driver versions >= 560.
It is suggested to use the open source kernel modules on Turing or later GPUs (RTX series, GTX 16xx), and the closed source modules otherwise.

View file

@ -100,20 +100,7 @@ rec {
};
# 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;
patches = [ rcu_patch ];
broken = kernel.kernelAtLeast "6.5";
};
dc = dc_565;
dc_535 = generic rec {
version = "535.154.05";
@ -128,6 +115,17 @@ rec {
patches = [ rcu_patch ];
};
dc_565 = generic rec {
version = "565.57.01";
url = "https://us.download.nvidia.com/tesla/${version}/NVIDIA-Linux-x86_64-${version}.run";
sha256_64bit = "sha256-buvpTlheOF6IBPWnQVLfQUiHv4GcwhvZW3Ks0PsYLHo=";
persistencedSha256 = "sha256-hdszsACWNqkCh8G4VBNitDT85gk9gJe1BlQ8LdrYIkg=";
fabricmanagerSha256 = "sha256-umhyehddbQ9+xhhoiKC7SOSVxscA5pcnqvkQOOLIdsM=";
useSettings = false;
usePersistenced = true;
useFabricmanager = true;
};
# Update note:
# If you add a legacy driver here, also update `top-level/linux-kernels.nix`,
# adding to the `nvidia_x11_legacy*` entries.

View file

@ -5,12 +5,15 @@ nvidia_x11: sha256:
lib,
fetchurl,
patchelf,
zlib,
glibc,
}:
let
sys = lib.concatStringsSep "-" (lib.reverseList (lib.splitString "-" stdenv.system));
bsys = builtins.replaceStrings [ "_" ] [ "-" ] sys;
fmver = nvidia_x11.version;
ldd = (lib.getBin glibc) + "/bin/ldd";
in
stdenv.mkDerivation rec {
@ -23,13 +26,22 @@ stdenv.mkDerivation rec {
inherit sha256;
};
phases = [
"unpackPhase"
"installPhase"
];
installPhase = ''
mkdir -p $out/{bin,share/nvidia-fabricmanager}
for bin in nv{-fabricmanager,switch-audit};do
${patchelf}/bin/patchelf \
--set-interpreter ${stdenv.cc.libc}/lib/ld-${bsys}.so.2 \
--set-rpath ${lib.makeLibraryPath [ stdenv.cc.libc ]} \
--shrink-rpath \
--set-rpath ${
lib.makeLibraryPath [
stdenv.cc.libc
zlib
]
} \
bin/$bin
done
mv bin/nv{-fabricmanager,switch-audit} $out/bin/.
@ -39,6 +51,11 @@ stdenv.mkDerivation rec {
for d in include lib;do
mv $d $out/.
done
patchShebangs $out/bin
for b in $out/bin/*;do
${ldd} $b | grep -vqz "not found"
done
'';
meta = {

View file

@ -430,8 +430,8 @@ in {
nvidia_x11_production = nvidiaPackages.production;
nvidia_x11_vulkan_beta = nvidiaPackages.vulkan_beta;
nvidia_dc = nvidiaPackages.dc;
nvidia_dc_520 = nvidiaPackages.dc_520;
nvidia_dc_535 = nvidiaPackages.dc_535;
nvidia_dc_565 = nvidiaPackages.dc_565;
# this is not a replacement for nvidia_x11*
# only the opensource kernel driver exposed for hydra to build