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