nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 343 lines 9.0 kB view raw
1{ 2 lib, 3 config, 4 callPackage, 5 newScope, 6 symlinkJoin, 7 fetchFromGitHub, 8 boost179, 9 opencv, 10 python3Packages, 11 openmpi, 12 stdenv, 13 pkgs, 14}: 15 16let 17 outer = lib.makeScope newScope ( 18 self: 19 let 20 inherit (self) llvm; 21 origStdenv = stdenv; 22 pyPackages = python3Packages; 23 openmpi-orig = openmpi; 24 rocmClangStdenv = llvm.rocmClangStdenv; 25 in 26 { 27 inherit rocmClangStdenv; 28 stdenv = rocmClangStdenv; 29 30 rocmUpdateScript = self.callPackage ./update.nix { }; 31 32 ## ROCm ## 33 llvm = lib.recurseIntoAttrs ( 34 callPackage ./llvm/default.nix { 35 # rocm-device-libs is used for .src only 36 # otherwise would cause infinite recursion 37 inherit (self) rocm-device-libs; 38 } 39 ); 40 inherit (self.llvm) rocm-toolchain clang openmp; 41 42 rocm-core = self.callPackage ./rocm-core { stdenv = origStdenv; }; 43 44 rocm-cmake = self.callPackage ./rocm-cmake { stdenv = origStdenv; }; 45 46 rocm-device-libs = self.callPackage ./rocm-device-libs { }; 47 48 rocm-runtime = self.callPackage ./rocm-runtime { 49 stdenv = origStdenv; 50 }; 51 52 rocm-comgr = self.callPackage ./rocm-comgr { }; 53 54 rocminfo = self.callPackage ./rocminfo { stdenv = origStdenv; }; 55 56 amdsmi = pyPackages.callPackage ./amdsmi { 57 inherit (self) rocmUpdateScript; 58 }; 59 60 rocm-smi = pyPackages.callPackage ./rocm-smi { 61 inherit (self) rocmUpdateScript; 62 }; 63 64 aqlprofile = self.callPackage ./aqlprofile { }; 65 66 rdc = self.callPackage ./rdc { }; 67 68 rocm-docs-core = python3Packages.callPackage ./rocm-docs-core { }; 69 70 hip-common = self.callPackage ./hip-common { }; 71 72 hipcc = self.callPackage ./hipcc { stdenv = origStdenv; }; 73 74 # Replaces hip, opencl-runtime, and rocclr 75 clr = self.callPackage ./clr { }; 76 77 aotriton = self.callPackage ./aotriton { stdenv = origStdenv; }; 78 79 hipify = self.callPackage ./hipify { 80 stdenv = origStdenv; 81 }; 82 83 # hsakmt was merged into rocm-runtime 84 hsakmt = self.rocm-runtime; 85 86 rocprofiler = self.callPackage ./rocprofiler { 87 inherit (llvm) clang; 88 }; 89 rocprofiler-register = self.callPackage ./rocprofiler-register { 90 inherit (llvm) clang; 91 }; 92 93 roctracer = self.callPackage ./roctracer { }; 94 95 rocgdb = self.callPackage ./rocgdb { }; 96 97 rocdbgapi = self.callPackage ./rocdbgapi { }; 98 99 rocr-debug-agent = self.callPackage ./rocr-debug-agent { }; 100 101 rocprim = self.callPackage ./rocprim { }; 102 103 rocsparse = self.callPackage ./rocsparse { }; 104 105 rocthrust = self.callPackage ./rocthrust { }; 106 107 rocrand = self.callPackage ./rocrand { }; 108 109 hiprand = self.callPackage ./hiprand { }; 110 111 rocfft = self.callPackage ./rocfft { }; 112 113 mscclpp = self.callPackage ./mscclpp { }; 114 115 rccl = self.callPackage ./rccl { }; 116 117 hipcub = self.callPackage ./hipcub { }; 118 119 hipsparse = self.callPackage ./hipsparse { }; 120 121 hipfort = self.callPackage ./hipfort { }; 122 123 hipfft = self.callPackage ./hipfft { }; 124 125 hiprt = self.callPackage ./hiprt { }; 126 127 tensile = pyPackages.callPackage ./tensile { 128 inherit (self) 129 rocmUpdateScript 130 clr 131 ; 132 }; 133 134 rocblas = self.callPackage ./rocblas { }; 135 136 rocsolver = self.callPackage ./rocsolver { }; 137 138 rocwmma = self.callPackage ./rocwmma { }; 139 140 rocalution = self.callPackage ./rocalution { }; 141 142 rocmlir-rock = self.callPackage ./rocmlir { 143 buildRockCompiler = true; 144 }; 145 rocmlir = self.rocmlir-rock; 146 147 hipsolver = self.callPackage ./hipsolver { }; 148 149 hipblas-common = self.callPackage ./hipblas-common { }; 150 151 hipblas = self.callPackage ./hipblas { }; 152 153 hipblaslt = self.callPackage ./hipblaslt { }; 154 155 # hipTensor - Only supports GFX9 156 157 composable_kernel_base = self.callPackage ./composable_kernel/base.nix { }; 158 composable_kernel = self.callPackage ./composable_kernel { }; 159 160 ck4inductor = pyPackages.callPackage ./composable_kernel/ck4inductor.nix { 161 inherit (self) composable_kernel rocm-toolchain; 162 }; 163 164 half = self.callPackage ./half { }; 165 166 miopen = self.callPackage ./miopen { 167 boost = boost179.override { enableStatic = true; }; 168 }; 169 170 miopen-hip = self.miopen; 171 172 migraphx = self.callPackage ./migraphx { stdenv = origStdenv; }; 173 174 rpp = self.callPackage ./rpp { }; 175 176 rpp-hip = self.rpp.override { 177 useOpenCL = false; 178 useCPU = false; 179 }; 180 181 rpp-opencl = self.rpp.override { 182 useOpenCL = true; 183 useCPU = false; 184 }; 185 186 rpp-cpu = self.rpp.override { 187 useOpenCL = false; 188 useCPU = true; 189 }; 190 191 mivisionx = self.callPackage ./mivisionx { 192 stdenv = origStdenv; 193 opencv = opencv.override { enablePython = true; }; 194 }; 195 196 mivisionx-hip = self.mivisionx.override { 197 rpp = self.rpp-hip; 198 useOpenCL = false; 199 useCPU = false; 200 }; 201 202 mivisionx-cpu = self.mivisionx.override { 203 rpp = self.rpp-cpu; 204 useOpenCL = false; 205 useCPU = true; 206 }; 207 208 # Even if config.rocmSupport is false we need rocmSupport true 209 # version of ucc/ucx in openmpi in this package set 210 openmpi = openmpi-orig.override ( 211 prev: 212 let 213 ucx = prev.ucx.override { 214 enableCuda = false; 215 enableRocm = true; 216 rocmPackages = self; 217 }; 218 in 219 { 220 inherit ucx; 221 ucc = prev.ucc.override { 222 enableCuda = false; 223 inherit ucx; 224 }; 225 } 226 ); 227 mpi = self.openmpi; 228 229 meta = { 230 # eval all pkgsRocm release attrs with 231 # nix-eval-jobs --force-recurse pkgs/top-level/release.nix -I . --select "p: p.pkgsRocm" --no-instantiate 232 release-packagePlatforms = 233 let 234 platforms = [ 235 "x86_64-linux" 236 ]; 237 attrPaths = (builtins.fromJSON (builtins.readFile ./release-attrPaths.json)).attrPaths; 238 in 239 lib.foldl' ( 240 acc: path: 241 if lib.hasAttrByPath (lib.splitString "." path) pkgs then 242 lib.recursiveUpdate acc (lib.setAttrByPath (lib.splitString "." path) platforms) 243 else 244 acc 245 ) { } attrPaths; 246 }; 247 248 rocm-bandwidth-test = self.callPackage ./rocm-bandwidth-test { 249 rocmPackages = self; 250 }; 251 252 rocm-tests = self.callPackage ./rocm-tests { 253 rocmPackages = self; 254 }; 255 } 256 // lib.optionalAttrs config.allowAliases { 257 rocmPath = throw '' 258 'rocm-path' has been removed. If a ROCM_PATH value is required in nixpkgs please 259 construct one with the minimal set of required deps. 260 For convenience use outside of nixpkgs consider one of the entries in 261 'rocmPackages.meta'. 262 ''; # Added 2025-09-30 263 264 rocm-merged-llvm = throw '' 265 'rocm-merged-llvm' has been removed. 266 For 'libllvm' or 'libclang' use 'rocmPackages.llvm.libllvm/clang'. 267 For a ROCm compiler toolchain use 'rocmPackages.rocm-toolchain'. 268 If a package uses '$<TARGET_FILE:clang>' in CMake from 'libclang' 269 it may be necessary to convince it to use 'rocm-toolchain' instead. 270 'rocm-merged-llvm' avoided this at the cost of significantly bloating closure 271 size. 272 ''; # Added 2025-09-30 273 274 hsa-amd-aqlprofile-bin = lib.warn '' 275 'hsa-amd-aqlprofile-bin' has been replaced by 'aqlprofile'. 276 '' self.aqlprofile; # Added 2025-08-27 277 278 triton = throw '' 279 'rocmPackages.triton' has been removed. Please use python3Packages.triton 280 ''; # Added 2025-08-24 281 282 rocm-thunk = throw '' 283 'rocm-thunk' has been removed. It's now part of the ROCm runtime. 284 ''; # Added 2025-3-16 285 286 clang-ocl = throw '' 287 'clang-ocl' has been deprecated upstream. Use ROCm's clang directly. 288 ''; # Added 2025-3-16 289 290 miopengemm = throw '' 291 'miopengemm' has been deprecated. 292 ''; # Added 2024-3-3 293 294 miopen-opencl = throw '' 295 'miopen-opencl' has been deprecated. 296 ''; # Added 2024-3-3 297 298 mivisionx-opencl = throw '' 299 'mivisionx-opencl' has been deprecated. 300 Other versions of mivisionx are still available. 301 ''; # Added 2024-3-24 302 } 303 ); 304 scopeForArches = 305 arches: 306 outer.overrideScope ( 307 _final: prev: { 308 clr = prev.clr.override { 309 localGpuTargets = arches; 310 }; 311 } 312 ); 313in 314outer 315// builtins.listToAttrs ( 316 map (arch: { 317 name = arch; 318 value = scopeForArches [ arch ]; 319 }) outer.clr.gpuTargets 320) 321// { 322 gfx9 = scopeForArches [ 323 "gfx906" 324 "gfx908" 325 "gfx90a" 326 "gfx942" 327 ]; 328 gfx10 = scopeForArches [ 329 "gfx1010" 330 "gfx1030" 331 ]; 332 gfx11 = scopeForArches [ 333 "gfx1100" 334 "gfx1101" 335 "gfx1102" 336 "gfx1150" 337 "gfx1151" 338 ]; 339 gfx12 = scopeForArches [ 340 "gfx1200" 341 "gfx1201" 342 ]; 343}