Merge pull request #225741 from mikatammi/nvidia_x11_aarch64

aarch64-support for NVIDIA closed and open source drivers

authored by Nick Cao and committed by GitHub 985d5e6b 9ff69ce0

+34 -7
+4
pkgs/os-specific/linux/nvidia-x11/default.nix
··· 27 27 production = generic { 28 28 version = "525.105.17"; 29 29 sha256_64bit = "sha256-xjWiGigsm1NIXxnrtkoPS1NqlouU1Nl2KeC8VHpYFCo="; 30 + sha256_aarch64 = "sha256-FUbmupHNVab3sM/ShDXPM7pK+5GC2/ri1YW20Hx3vbE="; 30 31 openSha256 = "sha256-O3XB8tNLmNkzrYoVyJVEE0IcE772lOdr8qn4rQHIupE="; 31 32 settingsSha256 = "sha256-KUw31Am9Zfwk5QTs6th8+J3C4oUBacNgb7ZUNeV68W4="; 32 33 persistencedSha256 = "sha256-jhBtsf9MXrkU/SsBndR1ESGUHhgUWiSH7R75swk3m40="; ··· 37 38 latest = selectHighestVersion production (generic { 38 39 version = "530.41.03"; 39 40 sha256_64bit = "sha256-riehapaMhVA/XRYd2jQ8FgJhKwJfSu4V+S4uoKy3hLE="; 41 + sha256_aarch64 = "sha256-uM5zMEO/AO32VmqUOzmc05FFm/lz76jPSSaQmeZUlFo="; 40 42 openSha256 = "sha256-etbtw6LMRUcFoZC9EDDRrTDekV8JFRYmkp3idLaMk5g="; 41 43 settingsSha256 = "sha256-8KB6T9f+gWl8Ni+uOyrJKiiH5mNx9eyfCcW/RjPTQQA="; 42 44 persistencedSha256 = "sha256-zrstlt/0YVGnsPGUuBbR9ULutywi2wNDVxh7OhJM7tM="; ··· 45 47 beta = selectHighestVersion latest (generic { 46 48 version = "530.30.02"; 47 49 sha256_64bit = "sha256-R/3bvXoiumYZI9vObn9R7sVN9oBQxAbMBJDDv77eeWM="; 50 + sha256_aarch64 = "sha256-/b5Jdow+O7ExXjtXTzDX38qgmBDUYDUl+5zxXvbi1ts="; 48 51 openSha256 = "sha256-LCtTyuJ8s8isTBt9HetItLqSjL1GOn0tPUarjuxHpMk="; 49 52 settingsSha256 = "sha256-6mynLNSaWeiB52HdwZ0EQNyPg+tuat0oEqpZGSb2yQo="; 50 53 persistencedSha256 = "sha256-h6iq0iD9F41a7s6jWKPTI+oVzgDRIr1Kk97LNH9rg7E="; ··· 71 74 legacy_470 = generic { 72 75 version = "470.161.03"; 73 76 sha256_64bit = "sha256-Xagqf4x254Hn1/C+e3mNtNNE8mvU+s+avPPHHHH+dkA="; 77 + sha256_aarch64 = "sha256-Ak+j3CkQNCsclv0X23gP1fx3XPOSEyRkjyK5+GDxhn4="; 74 78 settingsSha256 = "sha256-ryUSiI8PsY3knkJLg0k1EmyYW5OWkhuZma/hmXNuojw="; 75 79 persistencedSha256 = "sha256-/2h90Gq9NQd9Q+9eLVE6vrxXmINXxlLcSNOHxKToOEE="; 76 80
+21 -4
pkgs/os-specific/linux/nvidia-x11/generic.nix
··· 2 2 , url ? null 3 3 , sha256_32bit ? null 4 4 , sha256_64bit 5 + , sha256_aarch64 ? null 5 6 , openSha256 ? null 6 7 , settingsSha256 7 8 , settingsVersion ? version ··· 28 29 libsOnly ? false 29 30 , # don't include the bundled 32-bit libraries on 64-bit platforms, 30 31 # even if it’s in downloaded binary 31 - disable32Bit ? false 32 + disable32Bit ? stdenv.hostPlatform.system == "aarch64-linux" 32 33 # 32 bit libs only version of this package 33 34 , lib32 ? null 34 35 # Whether to extract the GSP firmware ··· 59 60 src = 60 61 if stdenv.hostPlatform.system == "x86_64-linux" then 61 62 fetchurl { 62 - url = args.url or "https://us.download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run"; 63 + urls = if args ? url then [ args.url ] else [ 64 + "https://us.download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run" 65 + "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run" 66 + ]; 63 67 sha256 = sha256_64bit; 64 68 } 65 69 else if stdenv.hostPlatform.system == "i686-linux" then 66 70 fetchurl { 67 - url = args.url or "https://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run"; 71 + urls = if args ? url then [ args.url ] else [ 72 + "https://us.download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run" 73 + "https://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run" 74 + ]; 68 75 sha256 = sha256_32bit; 69 76 } 77 + else if stdenv.hostPlatform.system == "aarch64-linux" && sha256_aarch64 != null then 78 + fetchurl { 79 + urls = if args ? url then [ args.url ] else [ 80 + "https://us.download.nvidia.com/XFree86/aarch64/${version}/NVIDIA-Linux-aarch64-${version}${pkgSuffix}.run" 81 + "https://download.nvidia.com/XFree86/Linux-aarch64/${version}/NVIDIA-Linux-aarch64-${version}${pkgSuffix}.run" 82 + ]; 83 + sha256 = sha256_aarch64; 84 + } 70 85 else throw "nvidia-x11 does not support platform ${stdenv.hostPlatform.system}"; 71 86 72 87 patches = if libsOnly then null else patches; ··· 126 141 homepage = "https://www.nvidia.com/object/unix.html"; 127 142 description = "X.org driver and kernel module for NVIDIA graphics cards"; 128 143 license = licenses.unfreeRedistributable; 129 - platforms = [ "x86_64-linux" ] ++ optionals (!i686bundled) [ "i686-linux" ]; 144 + platforms = [ "x86_64-linux" ] 145 + ++ optionals (sha256_32bit != null) [ "i686-linux" ] 146 + ++ optionals (sha256_aarch64 != null) [ "aarch64-linux" ]; 130 147 maintainers = with maintainers; [ jonringer kiskae ]; 131 148 priority = 4; # resolves collision with xorg-server's "lib/xorg/modules/extensions/libglx.so" 132 149 inherit broken;
+9 -3
pkgs/os-specific/linux/nvidia-x11/open.nix
··· 7 7 , broken ? false 8 8 }: 9 9 10 - stdenv.mkDerivation { 10 + stdenv.mkDerivation ({ 11 11 pname = "nvidia-open"; 12 12 version = "${kernel.version}-${nvidia_x11.version}"; 13 13 ··· 24 24 "SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" 25 25 "SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" 26 26 "MODLIB=$(out)/lib/modules/${kernel.modDirVersion}" 27 + { 28 + aarch64-linux = "TARGET_ARCH=aarch64"; 29 + x86_64-linux = "TARGET_ARCH=x86_64"; 30 + }.${stdenv.hostPlatform.system} 27 31 ]; 28 32 29 33 installTargets = [ "modules_install" ]; ··· 33 37 description = "NVIDIA Linux Open GPU Kernel Module"; 34 38 homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules"; 35 39 license = with licenses; [ gpl2Plus mit ]; 36 - platforms = [ "x86_64-linux" ]; 40 + platforms = [ "x86_64-linux" "aarch64-linux" ]; 37 41 maintainers = with maintainers; [ nickcao ]; 38 42 inherit broken; 39 43 }; 40 - } 44 + } // lib.optionalAttrs stdenv.hostPlatform.isAarch64 { 45 + env.NIX_CFLAGS_COMPILE = "-fno-stack-protector"; 46 + })