Merge pull request #287846 from mschwaig/rocm-6.0.2

rocmPackages.* 5.7.1→ 6.0.2

authored by Ulrik Strid and committed by GitHub b10ff243 58165761

+6816 -3
+1
maintainers/team-list.nix
··· 880 members = [ 881 Madouura 882 Flakebi 883 ]; 884 githubTeams = [ 885 "rocm-maintainers"
··· 880 members = [ 881 Madouura 882 Flakebi 883 + mschwaig 884 ]; 885 githubTeams = [ 886 "rocm-maintainers"
+3 -1
pkgs/development/compilers/opensycl/default.nix
··· 9 , libffi 10 , makeWrapper 11 , config 12 - , rocmPackages 13 , rocmSupport ? config.rocmSupport 14 }: 15 let 16 inherit (llvmPackages_15) stdenv; 17 in 18 stdenv.mkDerivation rec { 19 pname = "OpenSYCL";
··· 9 , libffi 10 , makeWrapper 11 , config 12 + , rocmPackages_5 13 , rocmSupport ? config.rocmSupport 14 }: 15 let 16 inherit (llvmPackages_15) stdenv; 17 + # move to newer ROCm version once supported 18 + rocmPackages = rocmPackages_5; 19 in 20 stdenv.mkDerivation rec { 21 pname = "OpenSYCL";
+4 -1
pkgs/development/libraries/science/math/magma/generic.nix
··· 14 , fetchurl 15 , gfortran 16 , gpuTargets ? [ ] # Non-CUDA targets, that is HIP 17 - , rocmPackages 18 , lapack 19 , lib 20 , libpthreadstubs ··· 43 44 inherit (effectiveCudaPackages) cudaAtLeast cudaFlags cudaOlder; 45 inherit (cudaFlags) cudaCapabilities; 46 47 # NOTE: The lists.subtractLists function is perhaps a bit unintuitive. It subtracts the elements 48 # of the first list *from* the second list. That means:
··· 14 , fetchurl 15 , gfortran 16 , gpuTargets ? [ ] # Non-CUDA targets, that is HIP 17 + , rocmPackages_5 18 , lapack 19 , lib 20 , libpthreadstubs ··· 43 44 inherit (effectiveCudaPackages) cudaAtLeast cudaFlags cudaOlder; 45 inherit (cudaFlags) cudaCapabilities; 46 + 47 + # move to newer ROCm version once supported 48 + rocmPackages = rocmPackages_5; 49 50 # NOTE: The lists.subtractLists function is perhaps a bit unintuitive. It subtracts the elements 51 # of the first list *from* the second list. That means:
+42
pkgs/development/rocm-modules/6/clang-ocl/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocm-device-libs 8 + }: 9 + 10 + stdenv.mkDerivation (finalAttrs: { 11 + pname = "clang-ocl"; 12 + version = "6.0.2"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "ROCm"; 16 + repo = "clang-ocl"; 17 + rev = "rocm-${finalAttrs.version}"; 18 + hash = "sha256-uMSvcVJj+me2E+7FsXZ4l4hTcK6uKEegXpkHGcuist0="; 19 + }; 20 + 21 + nativeBuildInputs = [ 22 + cmake 23 + rocm-cmake 24 + ]; 25 + 26 + buildInputs = [ rocm-device-libs ]; 27 + 28 + passthru.updateScript = rocmUpdateScript { 29 + name = finalAttrs.pname; 30 + owner = finalAttrs.src.owner; 31 + repo = finalAttrs.src.repo; 32 + }; 33 + 34 + meta = with lib; { 35 + description = "OpenCL compilation with clang compiler"; 36 + homepage = "https://github.com/ROCm/clang-ocl"; 37 + license = with licenses; [ mit ]; 38 + maintainers = teams.rocm.members; 39 + platforms = platforms.linux; 40 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 41 + }; 42 + })
+189
pkgs/development/rocm-modules/6/clr/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , callPackage 4 + , fetchFromGitHub 5 + , fetchpatch 6 + , rocmUpdateScript 7 + , makeWrapper 8 + , cmake 9 + , perl 10 + , clang 11 + , hip-common 12 + , hipcc 13 + , rocm-device-libs 14 + , rocm-comgr 15 + , rocm-runtime 16 + , roctracer 17 + , rocminfo 18 + , rocm-smi 19 + , numactl 20 + , libGL 21 + , libxml2 22 + , libX11 23 + , python3Packages 24 + }: 25 + 26 + let 27 + wrapperArgs = [ 28 + "--prefix PATH : $out/bin" 29 + "--prefix LD_LIBRARY_PATH : ${rocm-runtime}" 30 + "--set HIP_PLATFORM amd" 31 + "--set HIP_PATH $out" 32 + "--set HIP_CLANG_PATH ${clang}/bin" 33 + "--set DEVICE_LIB_PATH ${rocm-device-libs}/amdgcn/bitcode" 34 + "--set HSA_PATH ${rocm-runtime}" 35 + "--set ROCM_PATH $out" 36 + ]; 37 + in stdenv.mkDerivation (finalAttrs: { 38 + pname = "clr"; 39 + version = "6.0.2"; 40 + 41 + outputs = [ 42 + "out" 43 + "icd" 44 + ]; 45 + 46 + src = fetchFromGitHub { 47 + owner = "ROCm"; 48 + repo = "clr"; 49 + rev = "rocm-${finalAttrs.version}"; 50 + hash = "sha256-ZMpA7vCW2CcpGdBLZfPimMHcgjhN1PHuewJiYwZMgGY="; 51 + }; 52 + 53 + nativeBuildInputs = [ 54 + makeWrapper 55 + cmake 56 + perl 57 + python3Packages.python 58 + python3Packages.cppheaderparser 59 + ]; 60 + 61 + buildInputs = [ 62 + numactl 63 + libGL 64 + libxml2 65 + libX11 66 + ]; 67 + 68 + propagatedBuildInputs = [ 69 + rocm-device-libs 70 + rocm-comgr 71 + rocm-runtime 72 + rocminfo 73 + ]; 74 + 75 + cmakeFlags = [ 76 + "-DCMAKE_POLICY_DEFAULT_CMP0072=NEW" # Prefer newer OpenGL libraries 77 + "-DCLR_BUILD_HIP=ON" 78 + "-DCLR_BUILD_OCL=ON" 79 + "-DHIP_COMMON_DIR=${hip-common}" 80 + "-DHIPCC_BIN_DIR=${hipcc}/bin" 81 + "-DHIP_PLATFORM=amd" 82 + "-DPROF_API_HEADER_PATH=${roctracer.src}/inc/ext" 83 + "-DROCM_PATH=${rocminfo}" 84 + 85 + # Temporarily set variables to work around upstream CMakeLists issue 86 + # Can be removed once https://github.com/ROCm/rocm-cmake/issues/121 is fixed 87 + "-DCMAKE_INSTALL_BINDIR=bin" 88 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 89 + "-DCMAKE_INSTALL_LIBDIR=lib" 90 + ]; 91 + 92 + patches = [ 93 + (fetchpatch { 94 + name = "add-missing-operators.patch"; 95 + url = "https://github.com/ROCm/clr/commit/86bd518981b364c138f9901b28a529899d8654f3.patch"; 96 + hash = "sha256-lbswri+zKLxif0hPp4aeJDeVfadhWZz4z+m+G2XcCPI="; 97 + }) 98 + (fetchpatch { 99 + name = "static-functions.patch"; 100 + url = "https://github.com/ROCm/clr/commit/77c581a3ebd47b5e2908973b70adea66891159ee.patch"; 101 + hash = "sha256-auBedbd7rghlKav7A9V6l64J7VmtE9GizIdi5gWj+fs="; 102 + }) 103 + ]; 104 + 105 + postPatch = '' 106 + patchShebangs hipamd/*.sh 107 + patchShebangs hipamd/src 108 + 109 + # We're not on Windows so these are never installed to hipcc... 110 + substituteInPlace hipamd/CMakeLists.txt \ 111 + --replace "install(PROGRAMS \''${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)" "" \ 112 + --replace "install(PROGRAMS \''${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)" "" 113 + 114 + substituteInPlace hipamd/src/hip_embed_pch.sh \ 115 + --replace "\''$LLVM_DIR/bin/clang" "${clang}/bin/clang" 116 + ''; 117 + 118 + postInstall = '' 119 + patchShebangs $out/bin 120 + 121 + # hipcc.bin and hipconfig.bin is mysteriously never installed 122 + cp -a ${hipcc}/bin/{hipcc.bin,hipconfig.bin} $out/bin 123 + 124 + wrapProgram $out/bin/hipcc.bin ${lib.concatStringsSep " " wrapperArgs} 125 + wrapProgram $out/bin/hipconfig.bin ${lib.concatStringsSep " " wrapperArgs} 126 + wrapProgram $out/bin/hipcc.pl ${lib.concatStringsSep " " wrapperArgs} 127 + wrapProgram $out/bin/hipconfig.pl ${lib.concatStringsSep " " wrapperArgs} 128 + 129 + # Just link rocminfo, it's easier 130 + ln -s ${rocminfo}/bin/* $out/bin 131 + 132 + # Replace rocm-opencl-icd functionality 133 + mkdir -p $icd/etc/OpenCL/vendors 134 + echo "$out/lib/libamdocl64.so" > $icd/etc/OpenCL/vendors/amdocl64.icd 135 + 136 + # add version info to output (downstream rocmPackages look for this) 137 + mkdir $out/.info 138 + echo "${finalAttrs.version}" > $out/.info/version 139 + ''; 140 + 141 + passthru = { 142 + # All known and valid general GPU targets 143 + # We cannot use this for each ROCm library, as each defines their own supported targets 144 + # See: https://github.com/ROCm/ROCm/blob/77cbac4abab13046ee93d8b5bf410684caf91145/README.md#library-target-matrix 145 + gpuTargets = lib.forEach [ 146 + "803" 147 + "900" 148 + "906" 149 + "908" 150 + "90a" 151 + "940" 152 + "941" 153 + "942" 154 + "1010" 155 + "1012" 156 + "1030" 157 + "1100" 158 + "1101" 159 + "1102" 160 + ] (target: "gfx${target}"); 161 + 162 + updateScript = rocmUpdateScript { 163 + name = finalAttrs.pname; 164 + owner = finalAttrs.src.owner; 165 + repo = finalAttrs.src.repo; 166 + page = "tags?per_page=1"; 167 + filter = ".[0].name | split(\"-\") | .[1]"; 168 + }; 169 + 170 + impureTests = { 171 + rocm-smi = callPackage ./test-rocm-smi.nix { 172 + inherit rocm-smi; 173 + clr = finalAttrs.finalPackage; 174 + }; 175 + opencl-example = callPackage ./test-opencl-example.nix { 176 + clr = finalAttrs.finalPackage; 177 + }; 178 + }; 179 + }; 180 + 181 + meta = with lib; { 182 + description = "AMD Common Language Runtime for hipamd, opencl, and rocclr"; 183 + homepage = "https://github.com/ROCm/clr"; 184 + license = with licenses; [ mit ]; 185 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 186 + platforms = platforms.linux; 187 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 188 + }; 189 + })
+75
pkgs/development/rocm-modules/6/clr/test-opencl-example.nix
···
··· 1 + { lib 2 + , stdenv 3 + , makeImpureTest 4 + , fetchFromGitHub 5 + , clr 6 + , cmake 7 + , pkg-config 8 + , glew 9 + , freeglut 10 + , opencl-headers 11 + , ocl-icd 12 + }: 13 + 14 + let 15 + 16 + examples = stdenv.mkDerivation { 17 + pname = "amd-app-samples"; 18 + version = "2018-06-10"; 19 + 20 + src = fetchFromGitHub { 21 + owner = "OpenCL"; 22 + repo = "AMD_APP_samples"; 23 + rev = "54da6ca465634e78fc51fc25edf5840467ee2411"; 24 + hash = "sha256-qARQpUiYsamHbko/I1gPZE9pUGJ+3396Vk2n7ERSftA="; 25 + }; 26 + 27 + nativeBuildInputs = [ cmake pkg-config ]; 28 + 29 + buildInputs = [ glew freeglut opencl-headers ocl-icd ]; 30 + 31 + installPhase = '' 32 + runHook preInstall 33 + 34 + mkdir -p $out/bin 35 + # Example path is bin/x86_64/Release/cl/Reduction/Reduction 36 + cp -r bin/*/*/*/*/* $out/bin/ 37 + 38 + runHook postInstall 39 + ''; 40 + 41 + cmakeFlags = [ "-DBUILD_CPP_CL=OFF" ]; 42 + 43 + meta = with lib; { 44 + description = "Samples from the AMD APP SDK (with OpenCRun support) "; 45 + homepage = "https://github.com/OpenCL/AMD_APP_samples"; 46 + license = licenses.bsd2; 47 + platforms = platforms.linux; 48 + maintainers = lib.teams.rocm.members; 49 + }; 50 + }; 51 + 52 + in 53 + makeImpureTest { 54 + name = "opencl-example"; 55 + testedPackage = "rocmPackages_6.clr"; 56 + 57 + sandboxPaths = [ "/sys" "/dev/dri" "/dev/kfd" ]; 58 + 59 + nativeBuildInputs = [ examples ]; 60 + 61 + OCL_ICD_VENDORS = "${clr.icd}/etc/OpenCL/vendors"; 62 + 63 + testScript = '' 64 + # Examples load resources from current directory 65 + cd ${examples}/bin 66 + echo OCL_ICD_VENDORS=$OCL_ICD_VENDORS 67 + pwd 68 + 69 + HelloWorld | grep HelloWorld 70 + ''; 71 + 72 + meta = with lib; { 73 + maintainers = teams.rocm.members; 74 + }; 75 + }
+23
pkgs/development/rocm-modules/6/clr/test-rocm-smi.nix
···
··· 1 + { lib 2 + , makeImpureTest 3 + , clinfo 4 + , clr 5 + , rocm-smi 6 + }: 7 + 8 + makeImpureTest { 9 + name = "rocm-smi"; 10 + testedPackage = "rocmPackages_6.clr"; 11 + nativeBuildInputs = [ clinfo rocm-smi ]; 12 + OCL_ICD_VENDORS = "${clr.icd}/etc/OpenCL/vendors"; 13 + 14 + testScript = '' 15 + # Test fails if the number of platforms is 0 16 + clinfo | grep -E 'Number of platforms * [1-9]' 17 + rocm-smi | grep -A1 GPU 18 + ''; 19 + 20 + meta = with lib; { 21 + maintainers = teams.rocm.members; 22 + }; 23 + }
+94
pkgs/development/rocm-modules/6/composable_kernel/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , clr 8 + , openmp 9 + , clang-tools-extra 10 + , git 11 + , gtest 12 + , buildTests ? false 13 + , buildExamples ? false 14 + , gpuTargets ? [ ] # gpuTargets = [ "gfx803" "gfx900" "gfx1030" ... ] 15 + }: 16 + 17 + stdenv.mkDerivation (finalAttrs: { 18 + pname = "composable_kernel"; 19 + version = "6.0.2"; 20 + 21 + outputs = [ 22 + "out" 23 + ] ++ lib.optionals buildTests [ 24 + "test" 25 + ] ++ lib.optionals buildExamples [ 26 + "example" 27 + ]; 28 + 29 + src = fetchFromGitHub { 30 + owner = "ROCm"; 31 + repo = "composable_kernel"; 32 + rev = "rocm-${finalAttrs.version}"; 33 + hash = "sha256-NCqMganmNyQfz3X+KQOrfrimnrgd3HbAGK5DeC4+J+o="; 34 + }; 35 + 36 + nativeBuildInputs = [ 37 + git 38 + cmake 39 + rocm-cmake 40 + clr 41 + clang-tools-extra 42 + ]; 43 + 44 + buildInputs = [ openmp ]; 45 + 46 + cmakeFlags = [ 47 + "-DCMAKE_C_COMPILER=hipcc" 48 + "-DCMAKE_CXX_COMPILER=hipcc" 49 + ] ++ lib.optionals (gpuTargets != [ ]) [ 50 + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 51 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 52 + ] ++ lib.optionals buildTests [ 53 + "-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names 54 + ]; 55 + 56 + # No flags to build selectively it seems... 57 + postPatch = lib.optionalString (!buildTests) '' 58 + substituteInPlace CMakeLists.txt \ 59 + --replace "add_subdirectory(test)" "" 60 + '' + lib.optionalString (!buildExamples) '' 61 + substituteInPlace CMakeLists.txt \ 62 + --replace "add_subdirectory(example)" "" 63 + '' + '' 64 + substituteInPlace CMakeLists.txt \ 65 + --replace "add_subdirectory(profiler)" "" 66 + '' 67 + ; 68 + 69 + postInstall = lib.optionalString buildTests '' 70 + mkdir -p $test/bin 71 + mv $out/bin/test_* $test/bin 72 + '' + lib.optionalString buildExamples '' 73 + mkdir -p $example/bin 74 + mv $out/bin/example_* $example/bin 75 + ''; 76 + 77 + passthru.updateScript = rocmUpdateScript { 78 + name = finalAttrs.pname; 79 + owner = finalAttrs.src.owner; 80 + repo = finalAttrs.src.repo; 81 + }; 82 + 83 + # Times out otherwise 84 + requiredSystemFeatures = [ "big-parallel" ]; 85 + 86 + meta = with lib; { 87 + description = "Performance portable programming model for machine learning tensor operators"; 88 + homepage = "https://github.com/ROCm/composable_kernel"; 89 + license = with licenses; [ mit ]; 90 + maintainers = teams.rocm.members; 91 + platforms = platforms.linux; 92 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 93 + }; 94 + })
+524
pkgs/development/rocm-modules/6/default.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , recurseIntoAttrs 4 + , symlinkJoin 5 + , fetchFromGitHub 6 + , cudaPackages 7 + , python3Packages 8 + , elfutils 9 + , boost179 10 + , opencv 11 + , ffmpeg_4 12 + , libjpeg_turbo 13 + , rapidjson-unstable 14 + }: 15 + 16 + let 17 + rocmUpdateScript = callPackage ./update.nix { }; 18 + in rec { 19 + ## ROCm ## 20 + llvm = recurseIntoAttrs (callPackage ./llvm/default.nix { inherit rocmUpdateScript rocm-device-libs rocm-runtime rocm-thunk clr; }); 21 + 22 + rocm-core = callPackage ./rocm-core { 23 + inherit rocmUpdateScript; 24 + stdenv = llvm.rocmClangStdenv; 25 + }; 26 + 27 + rocm-cmake = callPackage ./rocm-cmake { 28 + inherit rocmUpdateScript; 29 + stdenv = llvm.rocmClangStdenv; 30 + }; 31 + 32 + rocm-thunk = callPackage ./rocm-thunk { 33 + inherit rocmUpdateScript; 34 + stdenv = llvm.rocmClangStdenv; 35 + }; 36 + 37 + rocm-smi = python3Packages.callPackage ./rocm-smi { 38 + inherit rocmUpdateScript; 39 + stdenv = llvm.rocmClangStdenv; 40 + }; 41 + 42 + # Eventually will be in the LLVM repo 43 + rocm-device-libs = callPackage ./rocm-device-libs { 44 + inherit rocmUpdateScript rocm-cmake; 45 + stdenv = llvm.rocmClangStdenv; 46 + }; 47 + 48 + rocm-runtime = callPackage ./rocm-runtime { 49 + inherit rocmUpdateScript rocm-device-libs rocm-thunk; 50 + stdenv = llvm.rocmClangStdenv; 51 + }; 52 + 53 + # Eventually will be in the LLVM repo 54 + rocm-comgr = callPackage ./rocm-comgr { 55 + inherit rocmUpdateScript rocm-cmake rocm-device-libs; 56 + stdenv = llvm.rocmClangStdenv; 57 + }; 58 + 59 + rocminfo = callPackage ./rocminfo { 60 + inherit rocmUpdateScript rocm-cmake rocm-runtime; 61 + stdenv = llvm.rocmClangStdenv; 62 + }; 63 + 64 + clang-ocl = callPackage ./clang-ocl { 65 + inherit rocmUpdateScript rocm-cmake rocm-device-libs; 66 + stdenv = llvm.rocmClangStdenv; 67 + }; 68 + 69 + # Unfree 70 + hsa-amd-aqlprofile-bin = callPackage ./hsa-amd-aqlprofile-bin { 71 + stdenv = llvm.rocmClangStdenv; 72 + }; 73 + 74 + # Broken, too many errors 75 + rdc = callPackage ./rdc { 76 + inherit rocmUpdateScript rocm-smi rocm-runtime stdenv; 77 + # stdenv = llvm.rocmClangStdenv; 78 + }; 79 + 80 + rocm-docs-core = python3Packages.callPackage ./rocm-docs-core { inherit stdenv; }; 81 + 82 + hip-common = callPackage ./hip-common { 83 + inherit rocmUpdateScript; 84 + stdenv = llvm.rocmClangStdenv; 85 + }; 86 + 87 + # Eventually will be in the LLVM repo 88 + hipcc = callPackage ./hipcc { 89 + inherit rocmUpdateScript; 90 + stdenv = llvm.rocmClangStdenv; 91 + }; 92 + 93 + # Replaces hip, opencl-runtime, and rocclr 94 + clr = callPackage ./clr { 95 + inherit rocmUpdateScript hip-common hipcc rocm-device-libs rocm-comgr rocm-runtime roctracer rocminfo rocm-smi; 96 + inherit (llvm) clang; 97 + stdenv = llvm.rocmClangStdenv; 98 + }; 99 + 100 + hipify = callPackage ./hipify { 101 + inherit rocmUpdateScript; 102 + inherit (llvm) clang; 103 + stdenv = llvm.rocmClangStdenv; 104 + }; 105 + 106 + # Needs GCC 107 + rocprofiler = callPackage ./rocprofiler { 108 + inherit rocmUpdateScript clr rocm-core rocm-thunk rocm-device-libs roctracer rocdbgapi rocm-smi hsa-amd-aqlprofile-bin stdenv; 109 + inherit (llvm) clang; 110 + }; 111 + 112 + # Needs GCC 113 + roctracer = callPackage ./roctracer { 114 + inherit rocmUpdateScript rocm-device-libs rocm-runtime clr stdenv; 115 + }; 116 + 117 + rocgdb = callPackage ./rocgdb { 118 + inherit rocmUpdateScript; 119 + elfutils = elfutils.override { enableDebuginfod = true; }; 120 + stdenv = llvm.rocmClangStdenv; 121 + }; 122 + 123 + rocdbgapi = callPackage ./rocdbgapi { 124 + inherit rocmUpdateScript rocm-cmake rocm-comgr rocm-runtime; 125 + stdenv = llvm.rocmClangStdenv; 126 + }; 127 + 128 + rocr-debug-agent = callPackage ./rocr-debug-agent { 129 + inherit rocmUpdateScript clr rocdbgapi; 130 + stdenv = llvm.rocmClangStdenv; 131 + }; 132 + 133 + rocprim = callPackage ./rocprim { 134 + inherit rocmUpdateScript rocm-cmake clr; 135 + stdenv = llvm.rocmClangStdenv; 136 + }; 137 + 138 + rocsparse = callPackage ./rocsparse { 139 + inherit rocmUpdateScript rocm-cmake rocprim clr; 140 + stdenv = llvm.rocmClangStdenv; 141 + }; 142 + 143 + rocthrust = callPackage ./rocthrust { 144 + inherit rocmUpdateScript rocm-cmake rocprim clr; 145 + stdenv = llvm.rocmClangStdenv; 146 + }; 147 + 148 + rocrand = callPackage ./rocrand { 149 + inherit rocmUpdateScript rocm-cmake clr; 150 + stdenv = llvm.rocmClangStdenv; 151 + }; 152 + 153 + hiprand = rocrand; # rocrand includes hiprand 154 + 155 + rocfft = callPackage ./rocfft { 156 + inherit rocmUpdateScript rocm-cmake rocrand rocfft clr; 157 + inherit (llvm) openmp; 158 + stdenv = llvm.rocmClangStdenv; 159 + }; 160 + 161 + rccl = callPackage ./rccl { 162 + inherit rocmUpdateScript rocm-cmake rocm-smi clr hipify; 163 + stdenv = llvm.rocmClangStdenv; 164 + }; 165 + 166 + hipcub = callPackage ./hipcub { 167 + inherit rocmUpdateScript rocm-cmake rocprim clr; 168 + stdenv = llvm.rocmClangStdenv; 169 + }; 170 + 171 + hipsparse = callPackage ./hipsparse { 172 + inherit rocmUpdateScript rocm-cmake rocsparse clr; 173 + inherit (llvm) openmp; 174 + stdenv = llvm.rocmClangStdenv; 175 + }; 176 + 177 + hipfort = callPackage ./hipfort { 178 + inherit rocmUpdateScript rocm-cmake; 179 + stdenv = llvm.rocmClangStdenv; 180 + }; 181 + 182 + hipfft = callPackage ./hipfft { 183 + inherit rocmUpdateScript rocm-cmake rocfft clr; 184 + inherit (llvm) openmp; 185 + stdenv = llvm.rocmClangStdenv; 186 + }; 187 + 188 + tensile = python3Packages.callPackage ./tensile { 189 + inherit rocmUpdateScript rocminfo; 190 + stdenv = llvm.rocmClangStdenv; 191 + }; 192 + 193 + rocblas = callPackage ./rocblas { 194 + inherit rocblas rocmUpdateScript rocm-cmake clr tensile; 195 + inherit (llvm) openmp; 196 + stdenv = llvm.rocmClangStdenv; 197 + }; 198 + 199 + rocsolver = callPackage ./rocsolver { 200 + inherit rocmUpdateScript rocm-cmake rocblas rocsparse clr; 201 + stdenv = llvm.rocmClangStdenv; 202 + }; 203 + 204 + rocwmma = callPackage ./rocwmma { 205 + inherit rocmUpdateScript rocm-cmake rocm-smi rocblas clr; 206 + inherit (llvm) openmp; 207 + stdenv = llvm.rocmClangStdenv; 208 + }; 209 + 210 + rocalution = callPackage ./rocalution { 211 + inherit rocmUpdateScript rocm-cmake rocprim rocsparse rocrand rocblas clr; 212 + inherit (llvm) openmp; 213 + stdenv = llvm.rocmClangStdenv; 214 + }; 215 + 216 + rocmlir = callPackage ./rocmlir { 217 + inherit rocmUpdateScript rocm-cmake rocminfo clr; 218 + stdenv = llvm.rocmClangStdenv; 219 + }; 220 + 221 + rocmlir-rock = rocmlir.override { 222 + buildRockCompiler = true; 223 + }; 224 + 225 + hipsolver = callPackage ./hipsolver { 226 + inherit rocmUpdateScript rocm-cmake rocblas rocsolver clr; 227 + stdenv = llvm.rocmClangStdenv; 228 + }; 229 + 230 + hipblas = callPackage ./hipblas { 231 + inherit rocmUpdateScript rocm-cmake rocblas rocsolver clr; 232 + stdenv = llvm.rocmClangStdenv; 233 + }; 234 + 235 + # hipBlasLt - Very broken with Tensile at the moment, only supports GFX9 236 + # hipTensor - Only supports GFX9 237 + 238 + miopengemm= throw '' 239 + 'miopen-opencl' has been deprecated. 240 + It is still available for some time as part of rocmPackages_5. 241 + ''; # Added 2024-3-3; 242 + 243 + composable_kernel = callPackage ./composable_kernel { 244 + inherit rocmUpdateScript rocm-cmake clr; 245 + inherit (llvm) openmp clang-tools-extra; 246 + stdenv = llvm.rocmClangStdenv; 247 + }; 248 + 249 + half = callPackage ./half { 250 + inherit rocmUpdateScript rocm-cmake; 251 + stdenv = llvm.rocmClangStdenv; 252 + }; 253 + 254 + miopen = callPackage ./miopen { 255 + inherit rocmUpdateScript rocm-cmake rocblas clang-ocl composable_kernel rocm-comgr clr rocm-docs-core half roctracer; 256 + inherit (llvm) clang-tools-extra; 257 + stdenv = llvm.rocmClangStdenv; 258 + rocmlir = rocmlir-rock; 259 + boost = boost179.override { enableStatic = true; }; 260 + }; 261 + 262 + miopen-hip = miopen; 263 + 264 + miopen-opencl= throw '' 265 + 'miopen-opencl' has been deprecated. 266 + It is still available for some time as part of rocmPackages_5. 267 + ''; # Added 2024-3-3; 268 + 269 + migraphx = callPackage ./migraphx { 270 + inherit rocmUpdateScript rocm-cmake rocblas composable_kernel miopen clr half rocm-device-libs; 271 + inherit (llvm) openmp clang-tools-extra; 272 + stdenv = llvm.rocmClangStdenv; 273 + rocmlir = rocmlir-rock; 274 + }; 275 + 276 + rpp = callPackage ./rpp { 277 + inherit rocmUpdateScript rocm-cmake rocm-docs-core clr half; 278 + inherit (llvm) openmp; 279 + stdenv = llvm.rocmClangStdenv; 280 + }; 281 + 282 + rpp-hip = rpp.override { 283 + useOpenCL = false; 284 + useCPU = false; 285 + }; 286 + 287 + rpp-opencl = rpp.override { 288 + useOpenCL = true; 289 + useCPU = false; 290 + }; 291 + 292 + rpp-cpu = rpp.override { 293 + useOpenCL = false; 294 + useCPU = true; 295 + }; 296 + 297 + mivisionx = callPackage ./mivisionx { 298 + inherit rocmUpdateScript rocm-cmake rocm-device-libs clr rpp rocblas miopen migraphx half rocm-docs-core; 299 + inherit (llvm) clang openmp; 300 + opencv = opencv.override { enablePython = true; }; 301 + ffmpeg = ffmpeg_4; 302 + rapidjson = rapidjson-unstable; 303 + stdenv = llvm.rocmClangStdenv; 304 + 305 + # Unfortunately, rocAL needs a custom libjpeg-turbo until further notice 306 + # See: https://github.com/ROCm/MIVisionX/issues/1051 307 + libjpeg_turbo = libjpeg_turbo.overrideAttrs { 308 + version = "2.0.6.1"; 309 + 310 + src = fetchFromGitHub { 311 + owner = "rrawther"; 312 + repo = "libjpeg-turbo"; 313 + rev = "640d7ee1917fcd3b6a5271aa6cf4576bccc7c5fb"; 314 + sha256 = "sha256-T52whJ7nZi8jerJaZtYInC2YDN0QM+9tUDqiNr6IsNY="; 315 + }; 316 + }; 317 + }; 318 + 319 + mivisionx-hip = mivisionx.override { 320 + rpp = rpp-hip; 321 + useOpenCL = false; 322 + useCPU = false; 323 + }; 324 + 325 + mivisionx-opencl = mivisionx.override { 326 + rpp = rpp-opencl; 327 + miopen = miopen-opencl; 328 + useOpenCL = true; 329 + useCPU = false; 330 + }; 331 + 332 + mivisionx-cpu = mivisionx.override { 333 + rpp = rpp-cpu; 334 + useOpenCL = false; 335 + useCPU = true; 336 + }; 337 + 338 + ## Meta ## 339 + # Emulate common ROCm meta layout 340 + # These are mainly for users. I strongly suggest NOT using these in nixpkgs derivations 341 + # Don't put these into `propagatedBuildInputs` unless you want PATH/PYTHONPATH issues! 342 + # See: https://rocm.docs.amd.com/en/docs-5.7.1/_images/image.004.png 343 + # See: https://rocm.docs.amd.com/en/docs-5.7.1/deploy/linux/os-native/package_manager_integration.html 344 + meta = rec { 345 + rocm-developer-tools = symlinkJoin { 346 + name = "rocm-developer-tools-meta"; 347 + 348 + paths = [ 349 + hsa-amd-aqlprofile-bin 350 + rocm-core 351 + rocr-debug-agent 352 + roctracer 353 + rocdbgapi 354 + rocprofiler 355 + rocgdb 356 + rocm-language-runtime 357 + ]; 358 + }; 359 + 360 + rocm-ml-sdk = symlinkJoin { 361 + name = "rocm-ml-sdk-meta"; 362 + 363 + paths = [ 364 + rocm-core 365 + miopen-hip 366 + rocm-hip-sdk 367 + rocm-ml-libraries 368 + ]; 369 + }; 370 + 371 + rocm-ml-libraries = symlinkJoin { 372 + name = "rocm-ml-libraries-meta"; 373 + 374 + paths = [ 375 + llvm.clang 376 + llvm.mlir 377 + llvm.openmp 378 + rocm-core 379 + miopen-hip 380 + rocm-hip-libraries 381 + ]; 382 + }; 383 + 384 + rocm-hip-sdk = symlinkJoin { 385 + name = "rocm-hip-sdk-meta"; 386 + 387 + paths = [ 388 + rocprim 389 + rocalution 390 + hipfft 391 + rocm-core 392 + hipcub 393 + hipblas 394 + rocrand 395 + rocfft 396 + rocsparse 397 + rccl 398 + rocthrust 399 + rocblas 400 + hipsparse 401 + hipfort 402 + rocwmma 403 + hipsolver 404 + rocsolver 405 + rocm-hip-libraries 406 + rocm-hip-runtime-devel 407 + ]; 408 + }; 409 + 410 + rocm-hip-libraries = symlinkJoin { 411 + name = "rocm-hip-libraries-meta"; 412 + 413 + paths = [ 414 + rocblas 415 + hipfort 416 + rocm-core 417 + rocsolver 418 + rocalution 419 + rocrand 420 + hipblas 421 + rocfft 422 + hipfft 423 + rccl 424 + rocsparse 425 + hipsparse 426 + hipsolver 427 + rocm-hip-runtime 428 + ]; 429 + }; 430 + 431 + rocm-openmp-sdk = symlinkJoin { 432 + name = "rocm-openmp-sdk-meta"; 433 + 434 + paths = [ 435 + rocm-core 436 + llvm.clang 437 + llvm.mlir 438 + llvm.openmp # openmp-extras-devel (https://github.com/ROCm/aomp) 439 + rocm-language-runtime 440 + ]; 441 + }; 442 + 443 + rocm-opencl-sdk = symlinkJoin { 444 + name = "rocm-opencl-sdk-meta"; 445 + 446 + paths = [ 447 + rocm-core 448 + rocm-runtime 449 + clr 450 + clr.icd 451 + rocm-thunk 452 + rocm-opencl-runtime 453 + ]; 454 + }; 455 + 456 + rocm-opencl-runtime = symlinkJoin { 457 + name = "rocm-opencl-runtime-meta"; 458 + 459 + paths = [ 460 + rocm-core 461 + clr 462 + clr.icd 463 + rocm-language-runtime 464 + ]; 465 + }; 466 + 467 + rocm-hip-runtime-devel = symlinkJoin { 468 + name = "rocm-hip-runtime-devel-meta"; 469 + 470 + paths = [ 471 + clr 472 + rocm-core 473 + hipify 474 + rocm-cmake 475 + llvm.clang 476 + llvm.mlir 477 + llvm.openmp 478 + rocm-thunk 479 + rocm-runtime 480 + rocm-hip-runtime 481 + ]; 482 + }; 483 + 484 + rocm-hip-runtime = symlinkJoin { 485 + name = "rocm-hip-runtime-meta"; 486 + 487 + paths = [ 488 + rocm-core 489 + rocminfo 490 + clr 491 + rocm-language-runtime 492 + ]; 493 + }; 494 + 495 + rocm-language-runtime = symlinkJoin { 496 + name = "rocm-language-runtime-meta"; 497 + 498 + paths = [ 499 + rocm-runtime 500 + rocm-core 501 + rocm-comgr 502 + llvm.openmp # openmp-extras-runtime (https://github.com/ROCm/aomp) 503 + ]; 504 + }; 505 + 506 + rocm-all = symlinkJoin { 507 + name = "rocm-all-meta"; 508 + 509 + paths = [ 510 + rocm-developer-tools 511 + rocm-ml-sdk 512 + rocm-ml-libraries 513 + rocm-hip-sdk 514 + rocm-hip-libraries 515 + rocm-openmp-sdk 516 + rocm-opencl-sdk 517 + rocm-opencl-runtime 518 + rocm-hip-runtime-devel 519 + rocm-hip-runtime 520 + rocm-language-runtime 521 + ]; 522 + }; 523 + }; 524 + }
+39
pkgs/development/rocm-modules/6/half/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + }: 8 + 9 + stdenv.mkDerivation (finalAttrs: { 10 + pname = "half"; 11 + version = "6.0.2"; 12 + 13 + src = fetchFromGitHub { 14 + owner = "ROCm"; 15 + repo = "half"; 16 + rev = "rocm-${finalAttrs.version}"; 17 + hash = "sha256-wvl8ny7pbY9hUGGtJ70R7/4YIsahgI7qcVzUnxmUfZM="; 18 + }; 19 + 20 + nativeBuildInputs = [ 21 + cmake 22 + rocm-cmake 23 + ]; 24 + 25 + passthru.updateScript = rocmUpdateScript { 26 + name = finalAttrs.pname; 27 + owner = finalAttrs.src.owner; 28 + repo = finalAttrs.src.repo; 29 + }; 30 + 31 + meta = with lib; { 32 + description = "C++ library for half precision floating point arithmetics"; 33 + homepage = "https://github.com/ROCm/half"; 34 + license = with licenses; [ mit ]; 35 + maintainers = teams.rocm.members; 36 + platforms = platforms.unix; 37 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 38 + }; 39 + })
+44
pkgs/development/rocm-modules/6/hip-common/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + }: 6 + 7 + stdenv.mkDerivation (finalAttrs: { 8 + pname = "hip-common"; 9 + version = "6.0.2"; 10 + 11 + src = fetchFromGitHub { 12 + owner = "ROCm"; 13 + repo = "HIP"; 14 + rev = "rocm-${finalAttrs.version}"; 15 + hash = "sha256-51u3By0R4LKoWiklNacFP6HILL845jxpN6FD7rQB+zQ="; 16 + }; 17 + 18 + dontConfigure = true; 19 + dontBuild = true; 20 + 21 + installPhase = '' 22 + runHook preInstall 23 + 24 + mkdir -p $out 25 + mv * $out 26 + 27 + runHook postInstall 28 + ''; 29 + 30 + passthru.updateScript = rocmUpdateScript { 31 + name = finalAttrs.pname; 32 + owner = finalAttrs.src.owner; 33 + repo = finalAttrs.src.repo; 34 + }; 35 + 36 + meta = with lib; { 37 + description = "C++ Heterogeneous-Compute Interface for Portability"; 38 + homepage = "https://github.com/ROCm/HIP"; 39 + license = with licenses; [ mit ]; 40 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 41 + platforms = platforms.linux; 42 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 43 + }; 44 + })
+99
pkgs/development/rocm-modules/6/hipblas/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , clr 8 + , gfortran 9 + , rocblas 10 + , rocsolver 11 + , gtest 12 + , lapack-reference 13 + , buildTests ? false 14 + , buildBenchmarks ? false 15 + , buildSamples ? false 16 + }: 17 + 18 + # Can also use cuBLAS 19 + stdenv.mkDerivation (finalAttrs: { 20 + pname = "hipblas"; 21 + version = "6.0.2"; 22 + 23 + outputs = [ 24 + "out" 25 + ] ++ lib.optionals buildTests [ 26 + "test" 27 + ] ++ lib.optionals buildBenchmarks [ 28 + "benchmark" 29 + ] ++ lib.optionals buildSamples [ 30 + "sample" 31 + ]; 32 + 33 + src = fetchFromGitHub { 34 + owner = "ROCm"; 35 + repo = "hipBLAS"; 36 + rev = "rocm-${finalAttrs.version}"; 37 + hash = "sha256-Fq7o2sMmHlHIv9UKJw+u/h9K/ZhKVJWwosYTdYIsscA="; 38 + }; 39 + 40 + nativeBuildInputs = [ 41 + cmake 42 + rocm-cmake 43 + clr 44 + gfortran 45 + ]; 46 + 47 + buildInputs = [ 48 + rocblas 49 + rocsolver 50 + ] ++ lib.optionals buildTests [ 51 + gtest 52 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 53 + lapack-reference 54 + ]; 55 + 56 + cmakeFlags = [ 57 + "-DCMAKE_C_COMPILER=hipcc" 58 + "-DCMAKE_CXX_COMPILER=hipcc" 59 + # Manually define CMAKE_INSTALL_<DIR> 60 + # See: https://github.com/NixOS/nixpkgs/pull/197838 61 + "-DCMAKE_INSTALL_BINDIR=bin" 62 + "-DCMAKE_INSTALL_LIBDIR=lib" 63 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 64 + ] ++ lib.optionals buildTests [ 65 + "-DBUILD_CLIENTS_TESTS=ON" 66 + ] ++ lib.optionals buildBenchmarks [ 67 + "-DBUILD_CLIENTS_BENCHMARKS=ON" 68 + ] ++ lib.optionals buildSamples [ 69 + "-DBUILD_CLIENTS_SAMPLES=ON" 70 + ]; 71 + 72 + postInstall = lib.optionalString buildTests '' 73 + mkdir -p $test/bin 74 + mv $out/bin/hipblas-test $test/bin 75 + '' + lib.optionalString buildBenchmarks '' 76 + mkdir -p $benchmark/bin 77 + mv $out/bin/hipblas-bench $benchmark/bin 78 + '' + lib.optionalString buildSamples '' 79 + mkdir -p $sample/bin 80 + mv $out/bin/example-* $sample/bin 81 + '' + lib.optionalString (buildTests || buildBenchmarks || buildSamples) '' 82 + rmdir $out/bin 83 + ''; 84 + 85 + passthru.updateScript = rocmUpdateScript { 86 + name = finalAttrs.pname; 87 + owner = finalAttrs.src.owner; 88 + repo = finalAttrs.src.repo; 89 + }; 90 + 91 + meta = with lib; { 92 + description = "ROCm BLAS marshalling library"; 93 + homepage = "https://github.com/ROCm/hipBLAS"; 94 + license = with licenses; [ mit ]; 95 + maintainers = teams.rocm.members; 96 + platforms = platforms.linux; 97 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 98 + }; 99 + })
+46
pkgs/development/rocm-modules/6/hipcc/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , lsb-release 7 + }: 8 + 9 + stdenv.mkDerivation (finalAttrs: { 10 + pname = "hipcc"; 11 + version = "6.0.2"; 12 + 13 + src = fetchFromGitHub { 14 + owner = "ROCm"; 15 + repo = "HIPCC"; 16 + rev = "rocm-${finalAttrs.version}"; 17 + hash = "sha256-/LRQN+RSMBPk2jS/tdp3psUL/B0RJZQhRri7e67KsG4="; 18 + }; 19 + 20 + nativeBuildInputs = [ cmake ]; 21 + 22 + postPatch = '' 23 + substituteInPlace src/hipBin_amd.h \ 24 + --replace "/usr/bin/lsb_release" "${lsb-release}/bin/lsb_release" 25 + ''; 26 + 27 + postInstall = '' 28 + rm -r $out/hip/bin 29 + ln -s $out/bin $out/hip/bin 30 + ''; 31 + 32 + passthru.updateScript = rocmUpdateScript { 33 + name = finalAttrs.pname; 34 + owner = finalAttrs.src.owner; 35 + repo = finalAttrs.src.repo; 36 + }; 37 + 38 + meta = with lib; { 39 + description = "Compiler driver utility that calls clang or nvcc"; 40 + homepage = "https://github.com/ROCm/HIPCC"; 41 + license = with licenses; [ mit ]; 42 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 43 + platforms = platforms.linux; 44 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 45 + }; 46 + })
+90
pkgs/development/rocm-modules/6/hipcub/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocprim 8 + , clr 9 + , gtest 10 + , gbenchmark 11 + , buildTests ? false 12 + , buildBenchmarks ? false 13 + , gpuTargets ? [ ] 14 + }: 15 + 16 + # CUB can also be used as a backend instead of rocPRIM. 17 + stdenv.mkDerivation (finalAttrs: { 18 + pname = "hipcub"; 19 + version = "6.0.2"; 20 + 21 + outputs = [ 22 + "out" 23 + ] ++ lib.optionals buildTests [ 24 + "test" 25 + ] ++ lib.optionals buildBenchmarks [ 26 + "benchmark" 27 + ]; 28 + 29 + src = fetchFromGitHub { 30 + owner = "ROCm"; 31 + repo = "hipCUB"; 32 + rev = "rocm-${finalAttrs.version}"; 33 + hash = "sha256-8QzVgj0JSb86zEG3sj5AAt9pG3frw+xrjEOTo7xCIrc="; 34 + }; 35 + 36 + nativeBuildInputs = [ 37 + cmake 38 + rocm-cmake 39 + clr 40 + ]; 41 + 42 + buildInputs = [ 43 + rocprim 44 + ] ++ lib.optionals buildTests [ 45 + gtest 46 + ] ++ lib.optionals buildBenchmarks [ 47 + gbenchmark 48 + ]; 49 + 50 + cmakeFlags = [ 51 + "-DCMAKE_CXX_COMPILER=hipcc" 52 + "-DHIP_ROOT_DIR=${clr}" 53 + # Manually define CMAKE_INSTALL_<DIR> 54 + # See: https://github.com/NixOS/nixpkgs/pull/197838 55 + "-DCMAKE_INSTALL_BINDIR=bin" 56 + "-DCMAKE_INSTALL_LIBDIR=lib" 57 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 58 + ] ++ lib.optionals (gpuTargets != [ ]) [ 59 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 60 + ] ++ lib.optionals buildTests [ 61 + "-DBUILD_TEST=ON" 62 + ] ++ lib.optionals buildBenchmarks [ 63 + "-DBUILD_BENCHMARK=ON" 64 + ]; 65 + 66 + postInstall = lib.optionalString buildTests '' 67 + mkdir -p $test/bin 68 + mv $out/bin/test_* $test/bin 69 + '' + lib.optionalString buildBenchmarks '' 70 + mkdir -p $benchmark/bin 71 + mv $out/bin/benchmark_* $benchmark/bin 72 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 73 + rmdir $out/bin 74 + ''; 75 + 76 + passthru.updateScript = rocmUpdateScript { 77 + name = finalAttrs.pname; 78 + owner = finalAttrs.src.owner; 79 + repo = finalAttrs.src.repo; 80 + }; 81 + 82 + meta = with lib; { 83 + description = "Thin wrapper library on top of rocPRIM or CUB"; 84 + homepage = "https://github.com/ROCm/hipCUB"; 85 + license = with licenses; [ bsd3 ]; 86 + maintainers = teams.rocm.members; 87 + platforms = platforms.linux; 88 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 89 + }; 90 + })
+110
pkgs/development/rocm-modules/6/hipfft/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , clr 8 + , git 9 + , rocfft 10 + , gtest 11 + , boost 12 + , fftw 13 + , fftwFloat 14 + , openmp 15 + , buildTests ? false 16 + , buildBenchmarks ? false 17 + , buildSamples ? false 18 + , gpuTargets ? [ ] 19 + }: 20 + 21 + # Can also use cuFFT 22 + stdenv.mkDerivation (finalAttrs: { 23 + pname = "hipfft"; 24 + version = "6.0.2"; 25 + 26 + outputs = [ 27 + "out" 28 + ] ++ lib.optionals buildTests [ 29 + "test" 30 + ] ++ lib.optionals buildBenchmarks [ 31 + "benchmark" 32 + ] ++ lib.optionals buildSamples [ 33 + "sample" 34 + ]; 35 + 36 + src = fetchFromGitHub { 37 + owner = "ROCm"; 38 + repo = "hipFFT"; 39 + rev = "rocm-${finalAttrs.version}"; 40 + hash = "sha256-DjjNQryJdl7RmaMQRQPWkleweEWMIwH/xXU84GGjoC0="; 41 + fetchSubmodules = true; 42 + }; 43 + 44 + nativeBuildInputs = [ 45 + clr 46 + git 47 + cmake 48 + rocm-cmake 49 + ]; 50 + 51 + buildInputs = [ 52 + rocfft 53 + ] ++ lib.optionals (buildTests || buildBenchmarks || buildSamples) [ 54 + gtest 55 + boost 56 + fftw 57 + fftwFloat 58 + openmp 59 + ]; 60 + 61 + cmakeFlags = [ 62 + "-DCMAKE_C_COMPILER=hipcc" 63 + "-DCMAKE_CXX_COMPILER=hipcc" 64 + "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip" 65 + "-DHIP_ROOT_DIR=${clr}" 66 + "-DHIP_PATH=${clr}" 67 + # Manually define CMAKE_INSTALL_<DIR> 68 + # See: https://github.com/NixOS/nixpkgs/pull/197838 69 + "-DCMAKE_INSTALL_BINDIR=bin" 70 + "-DCMAKE_INSTALL_LIBDIR=lib" 71 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 72 + ] ++ lib.optionals (gpuTargets != [ ]) [ 73 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 74 + ] ++ lib.optionals buildTests [ 75 + "-DBUILD_CLIENTS_TESTS=ON" 76 + ] ++ lib.optionals buildBenchmarks [ 77 + "-DBUILD_CLIENTS_RIDER=ON" 78 + ] ++ lib.optionals buildSamples [ 79 + "-DBUILD_CLIENTS_SAMPLES=ON" 80 + ]; 81 + 82 + postInstall = lib.optionalString buildTests '' 83 + mkdir -p $test/bin 84 + mv $out/bin/hipfft-test $test/bin 85 + '' + lib.optionalString buildBenchmarks '' 86 + mkdir -p $benchmark/bin 87 + mv $out/bin/hipfft-rider $benchmark/bin 88 + '' + lib.optionalString buildSamples '' 89 + mkdir -p $sample/bin 90 + mv clients/staging/hipfft_* $sample/bin 91 + patchelf $sample/bin/hipfft_* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" 92 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 93 + rmdir $out/bin 94 + ''; 95 + 96 + passthru.updateScript = rocmUpdateScript { 97 + name = finalAttrs.pname; 98 + owner = finalAttrs.src.owner; 99 + repo = finalAttrs.src.repo; 100 + }; 101 + 102 + meta = with lib; { 103 + description = "FFT marshalling library"; 104 + homepage = "https://github.com/ROCm/hipFFT"; 105 + license = with licenses; [ mit ]; 106 + maintainers = teams.rocm.members; 107 + platforms = platforms.linux; 108 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 109 + }; 110 + })
+66
pkgs/development/rocm-modules/6/hipfort/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , gfortran 8 + }: 9 + 10 + stdenv.mkDerivation (finalAttrs: { 11 + pname = "hipfort"; 12 + version = "6.0.2"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "ROCm"; 16 + repo = "hipfort"; 17 + rev = "rocm-${finalAttrs.version}"; 18 + hash = "sha256-3PIqSDyDlY0oVSEx20EPlKGYNkc9xPZtIG3Sbw69esE="; 19 + }; 20 + 21 + nativeBuildInputs = [ 22 + cmake 23 + rocm-cmake 24 + gfortran 25 + ]; 26 + 27 + cmakeFlags = [ 28 + "-DHIPFORT_COMPILER=${gfortran}/bin/gfortran" 29 + "-DHIPFORT_AR=${gfortran.cc}/bin/gcc-ar" 30 + "-DHIPFORT_RANLIB=${gfortran.cc}/bin/gcc-ranlib" 31 + # Manually define CMAKE_INSTALL_<DIR> 32 + # See: https://github.com/NixOS/nixpkgs/pull/197838 33 + "-DCMAKE_INSTALL_BINDIR=bin" 34 + "-DCMAKE_INSTALL_LIBDIR=lib" 35 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 36 + ]; 37 + 38 + postPatch = '' 39 + patchShebangs bin 40 + 41 + substituteInPlace bin/hipfc bin/mymcpu \ 42 + --replace "/bin/cat" "cat" 43 + 44 + substituteInPlace bin/CMakeLists.txt \ 45 + --replace "/bin/mkdir" "mkdir" \ 46 + --replace "/bin/cp" "cp" \ 47 + --replace "/bin/sed" "sed" \ 48 + --replace "/bin/chmod" "chmod" \ 49 + --replace "/bin/ln" "ln" 50 + ''; 51 + 52 + passthru.updateScript = rocmUpdateScript { 53 + name = finalAttrs.pname; 54 + owner = finalAttrs.src.owner; 55 + repo = finalAttrs.src.repo; 56 + }; 57 + 58 + meta = with lib; { 59 + description = "Fortran interfaces for ROCm libraries"; 60 + homepage = "https://github.com/ROCm/hipfort"; 61 + license = with licenses; [ mit ]; # mitx11 62 + maintainers = teams.rocm.members; 63 + platforms = platforms.linux; 64 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 65 + }; 66 + })
+47
pkgs/development/rocm-modules/6/hipify/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , clang 7 + , libxml2 8 + }: 9 + 10 + stdenv.mkDerivation (finalAttrs: { 11 + pname = "hipify"; 12 + version = "6.0.2"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "ROCm"; 16 + repo = "HIPIFY"; 17 + rev = "rocm-${finalAttrs.version}"; 18 + hash = "sha256-nNyWrPPhUwT7FyASzc3kf5NCTzeqvHybVOc+6hBzkA4="; 19 + }; 20 + 21 + nativeBuildInputs = [ cmake ]; 22 + buildInputs = [ libxml2 ]; 23 + 24 + postPatch = '' 25 + substituteInPlace CMakeLists.txt \ 26 + --replace "\''${LLVM_TOOLS_BINARY_DIR}/clang" "${clang}/bin/clang" 27 + ''; 28 + 29 + passthru.updateScript = rocmUpdateScript { 30 + name = finalAttrs.pname; 31 + owner = finalAttrs.src.owner; 32 + repo = finalAttrs.src.repo; 33 + }; 34 + 35 + postInstall = '' 36 + patchShebangs $out/bin 37 + ''; 38 + 39 + meta = with lib; { 40 + description = "Convert CUDA to Portable C++ Code"; 41 + homepage = "https://github.com/ROCm/HIPIFY"; 42 + license = with licenses; [ mit ]; 43 + maintainers = teams.rocm.members; 44 + platforms = platforms.linux; 45 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 46 + }; 47 + })
+100
pkgs/development/rocm-modules/6/hipsolver/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , clr 8 + , gfortran 9 + , rocblas 10 + , rocsolver 11 + , gtest 12 + , lapack-reference 13 + , buildTests ? false 14 + , buildBenchmarks ? false 15 + , buildSamples ? false 16 + }: 17 + 18 + # Can also use cuSOLVER 19 + stdenv.mkDerivation (finalAttrs: { 20 + pname = "hipsolver"; 21 + version = "6.0.2"; 22 + 23 + outputs = [ 24 + "out" 25 + ] ++ lib.optionals buildTests [ 26 + "test" 27 + ] ++ lib.optionals buildBenchmarks [ 28 + "benchmark" 29 + ] ++ lib.optionals buildSamples [ 30 + "sample" 31 + ]; 32 + 33 + src = fetchFromGitHub { 34 + owner = "ROCm"; 35 + repo = "hipSOLVER"; 36 + rev = "rocm-${finalAttrs.version}"; 37 + hash = "sha256-iMfaOv4TdTkmaRHCZOuqUfjO081J6on71+s8nIwwV00="; 38 + }; 39 + 40 + nativeBuildInputs = [ 41 + cmake 42 + rocm-cmake 43 + clr 44 + gfortran 45 + ]; 46 + 47 + buildInputs = [ 48 + rocblas 49 + rocsolver 50 + ] ++ lib.optionals buildTests [ 51 + gtest 52 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 53 + lapack-reference 54 + ]; 55 + 56 + cmakeFlags = [ 57 + "-DCMAKE_C_COMPILER=hipcc" 58 + "-DCMAKE_CXX_COMPILER=hipcc" 59 + # Manually define CMAKE_INSTALL_<DIR> 60 + # See: https://github.com/NixOS/nixpkgs/pull/197838 61 + "-DCMAKE_INSTALL_BINDIR=bin" 62 + "-DCMAKE_INSTALL_LIBDIR=lib" 63 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 64 + ] ++ lib.optionals buildTests [ 65 + "-DBUILD_CLIENTS_TESTS=ON" 66 + ] ++ lib.optionals buildBenchmarks [ 67 + "-DBUILD_CLIENTS_BENCHMARKS=ON" 68 + ] ++ lib.optionals buildSamples [ 69 + "-DBUILD_CLIENTS_SAMPLES=ON" 70 + ]; 71 + 72 + postInstall = lib.optionalString buildTests '' 73 + mkdir -p $test/bin 74 + mv $out/bin/hipsolver-test $test/bin 75 + '' + lib.optionalString buildBenchmarks '' 76 + mkdir -p $benchmark/bin 77 + mv $out/bin/hipsolver-bench $benchmark/bin 78 + '' + lib.optionalString buildSamples '' 79 + mkdir -p $sample/bin 80 + mv clients/staging/example-* $sample/bin 81 + patchelf $sample/bin/example-* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" 82 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 83 + rmdir $out/bin 84 + ''; 85 + 86 + passthru.updateScript = rocmUpdateScript { 87 + name = finalAttrs.pname; 88 + owner = finalAttrs.src.owner; 89 + repo = finalAttrs.src.repo; 90 + }; 91 + 92 + meta = with lib; { 93 + description = "ROCm SOLVER marshalling library"; 94 + homepage = "https://github.com/ROCm/hipSOLVER"; 95 + license = with licenses; [ mit ]; 96 + maintainers = teams.rocm.members; 97 + platforms = platforms.linux; 98 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 99 + }; 100 + })
+136
pkgs/development/rocm-modules/6/hipsparse/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocsparse 8 + , clr 9 + , gfortran 10 + , git 11 + , gtest 12 + , openmp 13 + , buildTests ? false 14 + , buildSamples ? false 15 + , gpuTargets ? [ ] 16 + }: 17 + 18 + # This can also use cuSPARSE as a backend instead of rocSPARSE 19 + stdenv.mkDerivation (finalAttrs: { 20 + pname = "hipsparse"; 21 + version = "6.0.2"; 22 + 23 + outputs = [ 24 + "out" 25 + ] ++ lib.optionals buildTests [ 26 + "test" 27 + ] ++ lib.optionals buildSamples [ 28 + "sample" 29 + ]; 30 + 31 + src = fetchFromGitHub { 32 + owner = "ROCm"; 33 + repo = "hipSPARSE"; 34 + rev = "rocm-${finalAttrs.version}"; 35 + hash = "sha256-fi5b0IF++OiezpM3JuUkhwpmW2apeFH4r5g6CcFseNY="; 36 + }; 37 + 38 + nativeBuildInputs = [ 39 + cmake 40 + rocm-cmake 41 + clr 42 + gfortran 43 + ]; 44 + 45 + buildInputs = [ 46 + rocsparse 47 + git 48 + ] ++ lib.optionals buildTests [ 49 + gtest 50 + ] ++ lib.optionals (buildTests || buildSamples) [ 51 + openmp 52 + ]; 53 + 54 + cmakeFlags = [ 55 + "-DCMAKE_C_COMPILER=hipcc" 56 + "-DCMAKE_CXX_COMPILER=hipcc" 57 + "-DBUILD_CLIENTS_SAMPLES=${if buildSamples then "ON" else "OFF"}" 58 + # Manually define CMAKE_INSTALL_<DIR> 59 + # See: https://github.com/NixOS/nixpkgs/pull/197838 60 + "-DCMAKE_INSTALL_BINDIR=bin" 61 + "-DCMAKE_INSTALL_LIBDIR=lib" 62 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 63 + ] ++ lib.optionals (gpuTargets != [ ]) [ 64 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 65 + ] ++ lib.optionals buildTests [ 66 + "-DBUILD_CLIENTS_TESTS=ON" 67 + ]; 68 + 69 + # We have to manually generate the matrices 70 + # CMAKE_MATRICES_DIR seems to be reset in clients/tests/CMakeLists.txt 71 + postPatch = lib.optionalString buildTests '' 72 + mkdir -p matrices 73 + 74 + ln -s ${rocsparse.passthru.matrices.matrix-01}/*.mtx matrices 75 + ln -s ${rocsparse.passthru.matrices.matrix-02}/*.mtx matrices 76 + ln -s ${rocsparse.passthru.matrices.matrix-03}/*.mtx matrices 77 + ln -s ${rocsparse.passthru.matrices.matrix-04}/*.mtx matrices 78 + ln -s ${rocsparse.passthru.matrices.matrix-05}/*.mtx matrices 79 + ln -s ${rocsparse.passthru.matrices.matrix-06}/*.mtx matrices 80 + ln -s ${rocsparse.passthru.matrices.matrix-07}/*.mtx matrices 81 + ln -s ${rocsparse.passthru.matrices.matrix-08}/*.mtx matrices 82 + ln -s ${rocsparse.passthru.matrices.matrix-09}/*.mtx matrices 83 + ln -s ${rocsparse.passthru.matrices.matrix-10}/*.mtx matrices 84 + ln -s ${rocsparse.passthru.matrices.matrix-11}/*.mtx matrices 85 + ln -s ${rocsparse.passthru.matrices.matrix-12}/*.mtx matrices 86 + ln -s ${rocsparse.passthru.matrices.matrix-13}/*.mtx matrices 87 + ln -s ${rocsparse.passthru.matrices.matrix-14}/*.mtx matrices 88 + ln -s ${rocsparse.passthru.matrices.matrix-15}/*.mtx matrices 89 + ln -s ${rocsparse.passthru.matrices.matrix-16}/*.mtx matrices 90 + ln -s ${rocsparse.passthru.matrices.matrix-17}/*.mtx matrices 91 + ln -s ${rocsparse.passthru.matrices.matrix-18}/*.mtx matrices 92 + ln -s ${rocsparse.passthru.matrices.matrix-19}/*.mtx matrices 93 + 94 + # Not used by the original cmake, causes an error 95 + rm matrices/*_b.mtx 96 + 97 + echo "deps/convert.cpp -> deps/mtx2csr" 98 + hipcc deps/convert.cpp -O3 -o deps/mtx2csr 99 + 100 + for mat in $(ls -1 matrices | cut -d "." -f 1); do 101 + echo "mtx2csr: $mat.mtx -> $mat.bin" 102 + deps/mtx2csr matrices/$mat.mtx matrices/$mat.bin 103 + unlink matrices/$mat.mtx 104 + done 105 + 106 + substituteInPlace clients/tests/CMakeLists.txt \ 107 + --replace "\''${PROJECT_BINARY_DIR}/matrices" "/build/source/matrices" 108 + ''; 109 + 110 + postInstall = lib.optionalString buildTests '' 111 + mkdir -p $test/bin 112 + mv $out/bin/hipsparse-test $test/bin 113 + mv /build/source/matrices $test 114 + rmdir $out/bin 115 + '' + lib.optionalString buildSamples '' 116 + mkdir -p $sample/bin 117 + mv clients/staging/example_* $sample/bin 118 + patchelf --set-rpath $out/lib:${lib.makeLibraryPath ( 119 + finalAttrs.buildInputs ++ [ clr gfortran.cc ])} $sample/bin/example_* 120 + ''; 121 + 122 + passthru.updateScript = rocmUpdateScript { 123 + name = finalAttrs.pname; 124 + owner = finalAttrs.src.owner; 125 + repo = finalAttrs.src.repo; 126 + }; 127 + 128 + meta = with lib; { 129 + description = "ROCm SPARSE marshalling library"; 130 + homepage = "https://github.com/ROCm/hipSPARSE"; 131 + license = with licenses; [ mit ]; 132 + maintainers = teams.rocm.members; 133 + platforms = platforms.linux; 134 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 135 + }; 136 + })
+48
pkgs/development/rocm-modules/6/hsa-amd-aqlprofile-bin/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , callPackage 5 + , dpkg 6 + }: 7 + 8 + stdenv.mkDerivation (finalAttrs: { 9 + pname = "hsa-amd-aqlprofile-bin"; 10 + version = "6.0.2"; 11 + 12 + src = let 13 + version = finalAttrs.version; 14 + dotless = builtins.replaceStrings ["."] ["0"] version; 15 + incremental = "115"; 16 + osRelease = "22.04"; 17 + in fetchurl { 18 + url = "https://repo.radeon.com/rocm/apt/${version}/pool/main/h/hsa-amd-aqlprofile/hsa-amd-aqlprofile_1.0.0.${dotless}.${dotless}-${incremental}~${osRelease}_amd64.deb"; 19 + hash = "sha256-0XeKUKaof5pSMS/UgLwumBDBYgyH/pCex9jViUKENXY="; 20 + }; 21 + 22 + nativeBuildInputs = [ dpkg ]; 23 + dontPatch = true; 24 + dontConfigure = true; 25 + dontBuild = true; 26 + 27 + installPhase = '' 28 + runHook preInstall 29 + 30 + mkdir -p $out 31 + cp -a opt/rocm-${finalAttrs.version}/* $out 32 + chmod +x $out/lib/libhsa-amd-aqlprofile64.so.1.* 33 + chmod +x $out/lib/hsa-amd-aqlprofile/librocprofv2_att.so 34 + 35 + runHook postInstall 36 + ''; 37 + 38 + passthru.updateScript = (callPackage ./update.nix { }) { inherit (finalAttrs) version; }; 39 + 40 + meta = with lib; { 41 + description = "AQLPROFILE library for AMD HSA runtime API extension support"; 42 + homepage = "https://rocm.docs.amd.com/en/latest/"; 43 + license = with licenses; [ unfree ]; 44 + maintainers = teams.rocm.members; 45 + platforms = platforms.linux; 46 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 47 + }; 48 + })
+57
pkgs/development/rocm-modules/6/hsa-amd-aqlprofile-bin/update.nix
···
··· 1 + { lib 2 + , writeScript 3 + }: 4 + 5 + { version }: 6 + 7 + let 8 + prefix = "hsa-amd-aqlprofile"; 9 + extVersion = lib.strings.concatStrings (lib.strings.intersperse "0" (lib.versions.splitVersion version)); 10 + major = lib.versions.major version; 11 + minor = lib.versions.minor version; 12 + patch = lib.versions.patch version; 13 + 14 + updateScript = writeScript "update.sh" '' 15 + #!/usr/bin/env nix-shell 16 + #!nix-shell -i bash -p curl common-updater-scripts 17 + apt="https://repo.radeon.com/rocm/apt" 18 + pool="pool/main/h/${prefix}/" 19 + url="$apt/latest/$pool" 20 + res="$(curl -sL "$url")" 21 + deb="${prefix}$(echo "$res" | grep -o -P "(?<=href=\"${prefix}).*(?=\">)" | tail -1)" 22 + patch="${patch}" 23 + 24 + # Try up to 10 patch versions 25 + for i in {1..10}; do 26 + ((patch++)) 27 + extVersion="$(echo "$deb" | grep -o -P "(?<=\.....).*(?=\..*-)")" 28 + 29 + if (( ''${#extVersion} == 6 )) && (( $extVersion <= ${extVersion} )); then 30 + url="https://repo.radeon.com/rocm/apt/${major}.${minor}.$patch/pool/main/h/${prefix}/" 31 + res="$(curl -sL "$url")" 32 + deb="${prefix}$(echo "$res" | grep -o -P "(?<=href=\"${prefix}).*(?=\">)" | tail -1)" 33 + else 34 + break 35 + fi 36 + done 37 + 38 + extVersion="$(echo $deb | grep -o -P "(?<=\.....).*(?=\..*-)")" 39 + version="$(echo $extVersion | sed "s/0/./1" | sed "s/0/./1")" 40 + IFS='.' read -a version_arr <<< "$version" 41 + 42 + if (( ''${version_arr[0]} > 6 )); then 43 + echo "'rocmPackages_6.${prefix}-bin' is already at it's maximum allowed version.''\nAny further upgrades should go into 'rocmPackages_X.${prefix}-bin'." 1>&2 44 + exit 1 45 + fi 46 + 47 + if (( ''${#extVersion} == 6 )); then 48 + repoVersion="$version" 49 + 50 + if (( ''${version:4:1} == 0 )); then 51 + repoVersion=''${version:0:3} 52 + fi 53 + 54 + update-source-version rocmPackages_6.${prefix}-bin "$version" "" "$apt/$repoVersion/$pool$deb" --ignore-same-hash 55 + fi 56 + ''; 57 + in [ updateScript ]
+175
pkgs/development/rocm-modules/6/llvm/base.nix
···
··· 1 + { lib 2 + , stdenv 3 + , gcc12Stdenv 4 + , fetchFromGitHub 5 + , rocmUpdateScript 6 + , pkg-config 7 + , cmake 8 + , ninja 9 + , git 10 + , doxygen 11 + , sphinx 12 + , lit 13 + , libxml2 14 + , libxcrypt 15 + , libedit 16 + , libffi 17 + , mpfr 18 + , zlib 19 + , ncurses 20 + , python3Packages 21 + , buildDocs ? true 22 + , buildMan ? true 23 + , buildTests ? true 24 + , targetName ? "llvm" 25 + , targetDir ? "llvm" 26 + , targetProjects ? [ ] 27 + , targetRuntimes ? [ ] 28 + , llvmTargetsToBuild ? [ "NATIVE" ] # "NATIVE" resolves into x86 or aarch64 depending on stdenv 29 + , extraPatches ? [ ] 30 + , extraNativeBuildInputs ? [ ] 31 + , extraBuildInputs ? [ ] 32 + , extraCMakeFlags ? [ ] 33 + , extraPostPatch ? "" 34 + , checkTargets ? [( 35 + lib.optionalString buildTests ( 36 + if targetDir == "runtimes" 37 + then "check-runtimes" 38 + else "check-all" 39 + ) 40 + )] 41 + , extraPostInstall ? "" 42 + , hardeningDisable ? [ ] 43 + , requiredSystemFeatures ? [ ] 44 + , extraLicenses ? [ ] 45 + , isBroken ? false 46 + }: 47 + 48 + let stdenv' = stdenv; in 49 + let stdenv = 50 + if stdenv'.cc.cc.isGNU or false && lib.versionAtLeast stdenv'.cc.cc.version "13.0" 51 + then gcc12Stdenv 52 + else stdenv'; 53 + in 54 + 55 + let 56 + llvmNativeTarget = 57 + if stdenv.isx86_64 then "X86" 58 + else if stdenv.isAarch64 then "AArch64" 59 + else throw "Unsupported ROCm LLVM platform"; 60 + inferNativeTarget = t: if t == "NATIVE" then llvmNativeTarget else t; 61 + llvmTargetsToBuild' = [ "AMDGPU" ] ++ builtins.map inferNativeTarget llvmTargetsToBuild; 62 + in stdenv.mkDerivation (finalAttrs: { 63 + pname = "rocm-llvm-${targetName}"; 64 + version = "6.0.2"; 65 + 66 + outputs = [ 67 + "out" 68 + ] ++ lib.optionals buildDocs [ 69 + "doc" 70 + ] ++ lib.optionals buildMan [ 71 + "man" 72 + "info" # Avoid `attribute 'info' missing` when using with wrapCC 73 + ]; 74 + 75 + patches = extraPatches; 76 + 77 + src = fetchFromGitHub { 78 + owner = "ROCm"; 79 + repo = "llvm-project"; 80 + rev = "rocm-${finalAttrs.version}"; 81 + hash = "sha256-uGxalrwMNCOSqSFVrYUBi3ijkMEFFTrzFImmvZKQf6I="; 82 + }; 83 + 84 + nativeBuildInputs = [ 85 + pkg-config 86 + cmake 87 + ninja 88 + git 89 + python3Packages.python 90 + ] ++ lib.optionals (buildDocs || buildMan) [ 91 + doxygen 92 + sphinx 93 + python3Packages.recommonmark 94 + ] ++ lib.optionals (buildTests && !finalAttrs.passthru.isLLVM) [ 95 + lit 96 + ] ++ extraNativeBuildInputs; 97 + 98 + buildInputs = [ 99 + libxml2 100 + libxcrypt 101 + libedit 102 + libffi 103 + mpfr 104 + ] ++ extraBuildInputs; 105 + 106 + propagatedBuildInputs = lib.optionals finalAttrs.passthru.isLLVM [ 107 + zlib 108 + ncurses 109 + ]; 110 + 111 + sourceRoot = "${finalAttrs.src.name}/${targetDir}"; 112 + 113 + cmakeFlags = [ 114 + "-DLLVM_TARGETS_TO_BUILD=${builtins.concatStringsSep ";" llvmTargetsToBuild'}" 115 + ] ++ lib.optionals (finalAttrs.passthru.isLLVM && targetProjects != [ ]) [ 116 + "-DLLVM_ENABLE_PROJECTS=${lib.concatStringsSep ";" targetProjects}" 117 + ] ++ lib.optionals ((finalAttrs.passthru.isLLVM || targetDir == "runtimes") && targetRuntimes != [ ]) [ 118 + "-DLLVM_ENABLE_RUNTIMES=${lib.concatStringsSep ";" targetRuntimes}" 119 + ] ++ lib.optionals finalAttrs.passthru.isLLVM [ 120 + "-DLLVM_INSTALL_UTILS=ON" 121 + "-DLLVM_INSTALL_GTEST=ON" 122 + ] ++ lib.optionals (buildDocs || buildMan) [ 123 + "-DLLVM_INCLUDE_DOCS=ON" 124 + "-DLLVM_BUILD_DOCS=ON" 125 + # "-DLLVM_ENABLE_DOXYGEN=ON" Way too slow, only uses one core 126 + "-DLLVM_ENABLE_SPHINX=ON" 127 + "-DSPHINX_OUTPUT_HTML=ON" 128 + "-DSPHINX_OUTPUT_MAN=ON" 129 + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 130 + ] ++ lib.optionals buildTests [ 131 + "-DLLVM_INCLUDE_TESTS=ON" 132 + "-DLLVM_BUILD_TESTS=ON" 133 + "-DLLVM_EXTERNAL_LIT=${lit}/bin/.lit-wrapped" 134 + ] ++ extraCMakeFlags; 135 + 136 + postPatch = lib.optionalString finalAttrs.passthru.isLLVM '' 137 + patchShebangs lib/OffloadArch/make_generated_offload_arch_h.sh 138 + '' + lib.optionalString (buildTests && finalAttrs.passthru.isLLVM) '' 139 + # FileSystem permissions tests fail with various special bits 140 + rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test 141 + rm unittests/Support/Path.cpp 142 + 143 + substituteInPlace unittests/Support/CMakeLists.txt \ 144 + --replace "Path.cpp" "" 145 + '' + extraPostPatch; 146 + 147 + doCheck = buildTests; 148 + checkTarget = lib.concatStringsSep " " checkTargets; 149 + 150 + postInstall = lib.optionalString buildMan '' 151 + mkdir -p $info 152 + '' + extraPostInstall; 153 + 154 + passthru = { 155 + isLLVM = targetDir == "llvm"; 156 + isClang = targetDir == "clang" || builtins.elem "clang" targetProjects; 157 + 158 + updateScript = rocmUpdateScript { 159 + name = finalAttrs.pname; 160 + owner = finalAttrs.src.owner; 161 + repo = finalAttrs.src.repo; 162 + }; 163 + }; 164 + 165 + inherit hardeningDisable requiredSystemFeatures; 166 + 167 + meta = with lib; { 168 + description = "ROCm fork of the LLVM compiler infrastructure"; 169 + homepage = "https://github.com/ROCm/llvm-project"; 170 + license = with licenses; [ ncsa ] ++ extraLicenses; 171 + maintainers = with maintainers; [ acowley lovesegfault ] ++ teams.rocm.members; 172 + platforms = platforms.linux; 173 + broken = isBroken || versionAtLeast finalAttrs.version "7.0.0"; 174 + }; 175 + })
+58
pkgs/development/rocm-modules/6/llvm/default.nix
···
··· 1 + { # stdenv FIXME: Try changing back to this with a new ROCm release https://github.com/NixOS/nixpkgs/issues/271943 2 + gcc12Stdenv 3 + , callPackage 4 + , rocmUpdateScript 5 + , wrapBintoolsWith 6 + , overrideCC 7 + , rocm-device-libs 8 + , rocm-runtime 9 + , rocm-thunk 10 + , clr 11 + }: 12 + 13 + let 14 + ## Stage 1 ## 15 + # Projects 16 + llvm = callPackage ./stage-1/llvm.nix { inherit rocmUpdateScript; stdenv = gcc12Stdenv; }; 17 + clang-unwrapped = callPackage ./stage-1/clang-unwrapped.nix { inherit rocmUpdateScript llvm; stdenv = gcc12Stdenv; }; 18 + lld = callPackage ./stage-1/lld.nix { inherit rocmUpdateScript llvm; stdenv = gcc12Stdenv; }; 19 + 20 + # Runtimes 21 + runtimes = callPackage ./stage-1/runtimes.nix { inherit rocmUpdateScript llvm; stdenv = gcc12Stdenv; }; 22 + 23 + ## Stage 2 ## 24 + # Helpers 25 + bintools-unwrapped = callPackage ./stage-2/bintools-unwrapped.nix { inherit llvm lld; }; 26 + bintools = wrapBintoolsWith { bintools = bintools-unwrapped; }; 27 + rStdenv = callPackage ./stage-2/rstdenv.nix { inherit llvm clang-unwrapped lld runtimes bintools; stdenv = gcc12Stdenv; }; 28 + in rec { 29 + inherit 30 + llvm 31 + clang-unwrapped 32 + lld 33 + bintools; 34 + 35 + # Runtimes 36 + libc = callPackage ./stage-2/libc.nix { inherit rocmUpdateScript; stdenv = rStdenv; }; 37 + libunwind = callPackage ./stage-2/libunwind.nix { inherit rocmUpdateScript; stdenv = rStdenv; }; 38 + libcxxabi = callPackage ./stage-2/libcxxabi.nix { inherit rocmUpdateScript; stdenv = rStdenv; }; 39 + libcxx = callPackage ./stage-2/libcxx.nix { inherit rocmUpdateScript; stdenv = rStdenv; }; 40 + compiler-rt = callPackage ./stage-2/compiler-rt.nix { inherit rocmUpdateScript llvm; stdenv = rStdenv; }; 41 + 42 + ## Stage 3 ## 43 + # Helpers 44 + clang = callPackage ./stage-3/clang.nix { inherit llvm lld clang-unwrapped bintools libc libunwind libcxxabi libcxx compiler-rt; stdenv = gcc12Stdenv; }; 45 + rocmClangStdenv = overrideCC gcc12Stdenv clang; 46 + 47 + # Projects 48 + clang-tools-extra = callPackage ./stage-3/clang-tools-extra.nix { inherit rocmUpdateScript llvm clang-unwrapped; stdenv = rocmClangStdenv; }; 49 + libclc = callPackage ./stage-3/libclc.nix { inherit rocmUpdateScript llvm clang; stdenv = rocmClangStdenv; }; 50 + lldb = callPackage ./stage-3/lldb.nix { inherit rocmUpdateScript clang; stdenv = rocmClangStdenv; }; 51 + mlir = callPackage ./stage-3/mlir.nix { inherit rocmUpdateScript clr; stdenv = rocmClangStdenv; }; 52 + polly = callPackage ./stage-3/polly.nix { inherit rocmUpdateScript; stdenv = rocmClangStdenv; }; 53 + flang = callPackage ./stage-3/flang.nix { inherit rocmUpdateScript clang-unwrapped mlir; stdenv = rocmClangStdenv; }; 54 + openmp = callPackage ./stage-3/openmp.nix { inherit rocmUpdateScript llvm clang-unwrapped clang rocm-device-libs rocm-runtime rocm-thunk; stdenv = rocmClangStdenv; }; 55 + 56 + # Runtimes 57 + pstl = callPackage ./stage-3/pstl.nix { inherit rocmUpdateScript; stdenv = rocmClangStdenv; }; 58 + }
+47
pkgs/development/rocm-modules/6/llvm/stage-1/clang-unwrapped.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + , llvm 5 + }: 6 + 7 + callPackage ../base.nix rec { 8 + inherit stdenv rocmUpdateScript; 9 + targetName = "clang-unwrapped"; 10 + targetDir = "clang"; 11 + extraBuildInputs = [ llvm ]; 12 + 13 + extraCMakeFlags = [ 14 + "-DCLANG_INCLUDE_DOCS=ON" 15 + "-DCLANG_INCLUDE_TESTS=ON" 16 + ]; 17 + 18 + extraPostPatch = '' 19 + # Looks like they forgot to add finding libedit to the standalone build 20 + ln -s ../cmake/Modules/FindLibEdit.cmake cmake/modules 21 + 22 + substituteInPlace CMakeLists.txt \ 23 + --replace "include(CheckIncludeFile)" "include(CheckIncludeFile)''\nfind_package(LibEdit)" 24 + 25 + # `No such file or directory: '/build/source/clang/tools/scan-build/bin/scan-build'` 26 + rm test/Analysis/scan-build/*.test 27 + rm test/Analysis/scan-build/rebuild_index/rebuild_index.test 28 + 29 + # `does not depend on a module exporting 'baz.h'` 30 + rm test/Modules/header-attribs.cpp 31 + 32 + # We do not have HIP or the ROCm stack available yet 33 + rm test/Driver/hip-options.hip 34 + 35 + # ???? `ld: cannot find crti.o: No such file or directory` linker issue? 36 + rm test/Interpreter/dynamic-library.cpp 37 + 38 + # `fatal error: 'stdio.h' file not found` 39 + rm test/OpenMP/amdgcn_emit_llvm.c 40 + ''; 41 + 42 + extraPostInstall = '' 43 + mv bin/clang-tblgen $out/bin 44 + ''; 45 + 46 + requiredSystemFeatures = [ "big-parallel" ]; 47 + }
+14
pkgs/development/rocm-modules/6/llvm/stage-1/lld.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + , llvm 5 + }: 6 + 7 + callPackage ../base.nix rec { 8 + inherit stdenv rocmUpdateScript; 9 + buildMan = false; # No man pages to build 10 + targetName = "lld"; 11 + targetDir = targetName; 12 + extraBuildInputs = [ llvm ]; 13 + checkTargets = [ "check-${targetName}" ]; 14 + }
+10
pkgs/development/rocm-modules/6/llvm/stage-1/llvm.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + }: 5 + 6 + callPackage ../base.nix { 7 + inherit stdenv rocmUpdateScript; 8 + requiredSystemFeatures = [ "big-parallel" ]; 9 + isBroken = stdenv.isAarch64; # https://github.com/ROCm/ROCm/issues/1831#issuecomment-1278205344 10 + }
+31
pkgs/development/rocm-modules/6/llvm/stage-1/runtimes.nix
···
··· 1 + { lib 2 + , stdenv 3 + , callPackage 4 + , rocmUpdateScript 5 + , llvm 6 + }: 7 + 8 + callPackage ../base.nix rec { 9 + inherit stdenv rocmUpdateScript; 10 + buildDocs = false; 11 + buildMan = false; 12 + buildTests = false; 13 + targetName = "runtimes"; 14 + targetDir = targetName; 15 + 16 + targetRuntimes = [ 17 + "libunwind" 18 + "libcxxabi" 19 + "libcxx" 20 + "compiler-rt" 21 + ]; 22 + 23 + extraBuildInputs = [ llvm ]; 24 + 25 + extraCMakeFlags = [ 26 + "-DLIBCXX_INCLUDE_BENCHMARKS=OFF" 27 + "-DLIBCXX_CXX_ABI=libcxxabi" 28 + ]; 29 + 30 + extraLicenses = [ lib.licenses.mit ]; 31 + }
+171
pkgs/development/rocm-modules/6/llvm/stage-2/1000-libcxx-failing-tests.list
···
··· 1 + ../libcxx/test/libcxx/containers/gnu_cxx/hash_map.pass.cpp 2 + ../libcxx/test/libcxx/containers/gnu_cxx/hash_set.pass.cpp 3 + ../libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp 4 + ../libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/construct.cxx2a.pass.cpp 5 + ../libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp 6 + ../libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp 7 + ../libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp 8 + ../libcxx/test/libcxx/localization/locales/locale/locale.types/locale.facet/no_allocation.pass.cpp 9 + ../libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp 10 + ../libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp 11 + ../libcxx/test/std/containers/associative/map/map.access/index_key.pass.cpp 12 + ../libcxx/test/std/containers/associative/map/map.access/index_rv_key.pass.cpp 13 + ../libcxx/test/std/containers/associative/map/map.modifiers/insert_and_emplace_allocator_requirements.pass.cpp 14 + ../libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_allocator_requirements.pass.cpp 15 + ../libcxx/test/std/containers/associative/multiset/insert_emplace_allocator_requirements.pass.cpp 16 + ../libcxx/test/std/containers/associative/set/insert_and_emplace_allocator_requirements.pass.cpp 17 + ../libcxx/test/std/containers/sequences/list/list.modifiers/insert_iter_iter_iter.pass.cpp 18 + ../libcxx/test/std/containers/sequences/list/list.modifiers/insert_iter_size_value.pass.cpp 19 + ../libcxx/test/std/containers/sequences/list/list.modifiers/insert_iter_value.pass.cpp 20 + ../libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp 21 + ../libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp 22 + ../libcxx/test/std/containers/unord/unord.map/unord.map.elem/index.pass.cpp 23 + ../libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_and_emplace_allocator_requirements.pass.cpp 24 + ../libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_allocator_requirements.pass.cpp 25 + ../libcxx/test/std/containers/unord/unord.multiset/insert_emplace_allocator_requirements.pass.cpp 26 + ../libcxx/test/std/containers/unord/unord.set/insert_and_emplace_allocator_requirements.pass.cpp 27 + ../libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp 28 + ../libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp 29 + ../libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp 30 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp 31 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp 32 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp 33 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp 34 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp 35 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp 36 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp 37 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp 38 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp 39 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp 40 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp 41 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp 42 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp 43 + ../libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp 44 + ../libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp 45 + ../libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp 46 + ../libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp 47 + ../libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp 48 + ../libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp 49 + ../libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp 50 + ../libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp 51 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp 52 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp 53 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp 54 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp 55 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp 56 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp 57 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp 58 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp 59 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp 60 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp 61 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp 62 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/clear.pass.cpp 63 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/make_preferred.pass.cpp 64 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp 65 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_extension.pass.cpp 66 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp 67 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/swap.pass.cpp 68 + ../libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp 69 + ../libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp 70 + ../libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp 71 + ../libcxx/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp 72 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp 73 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp 74 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp 75 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp 76 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp 77 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp 78 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp 79 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp 80 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp 81 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp 82 + ../libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp 83 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp 84 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp 85 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp 86 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp 87 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp 88 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp 89 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp 90 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp 91 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp 92 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp 93 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp 94 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp 95 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp 96 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp 97 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp 98 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp 99 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp 100 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp 101 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp 102 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp 103 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp 104 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp 105 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp 106 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp 107 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp 108 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp 109 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp 110 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp 111 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp 112 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp 113 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp 114 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/toctou.pass.cpp 115 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp 116 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp 117 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp 118 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp 119 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp 120 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp 121 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp 122 + ../libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp 123 + ../libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.dtor/dtor.pass.cpp 124 + ../libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp 125 + ../libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp 126 + ../libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp 127 + ../libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp 128 + ../libcxx/test/std/strings/basic.string/string.cons/substr_rvalue.pass.cpp 129 + ../libcxx/test/std/utilities/any/any.class/any.assign/copy.pass.cpp 130 + ../libcxx/test/std/utilities/any/any.class/any.assign/value.pass.cpp 131 + ../libcxx/test/std/utilities/any/any.class/any.cons/copy.pass.cpp 132 + ../libcxx/test/std/utilities/any/any.class/any.cons/default.pass.cpp 133 + ../libcxx/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp 134 + ../libcxx/test/std/utilities/any/any.class/any.cons/move.pass.cpp 135 + ../libcxx/test/std/utilities/any/any.class/any.cons/value.pass.cpp 136 + ../libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp 137 + ../libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp 138 + ../libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp 139 + ../libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp 140 + ../libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp 141 + ../libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp 142 + ../libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp 143 + ../libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp 144 + ../libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp 145 + ../libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp 146 + ../libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate_at_least.pass.cpp 147 + ../libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp 148 + ../libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp 149 + ../libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/nullptr_t_deleter_throw.pass.cpp 150 + ../libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp 151 + ../libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp 152 + ../libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp 153 + ../libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp 154 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp 155 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp 156 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp 157 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp 158 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp 159 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp 160 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp 161 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp 162 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp 163 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp 164 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp 165 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp 166 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp 167 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp 168 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp 169 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp 170 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp 171 + ../libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp
+28
pkgs/development/rocm-modules/6/llvm/stage-2/bintools-unwrapped.nix
···
··· 1 + { runCommand 2 + , llvm 3 + , lld 4 + }: 5 + 6 + runCommand "rocm-llvm-binutils-${llvm.version}" { preferLocalBuild = true; } '' 7 + mkdir -p $out/bin 8 + 9 + for prog in ${lld}/bin/*; do 10 + ln -s $prog $out/bin/$(basename $prog) 11 + done 12 + 13 + for prog in ${llvm}/bin/*; do 14 + ln -sf $prog $out/bin/$(basename $prog) 15 + done 16 + 17 + ln -s ${llvm}/bin/llvm-ar $out/bin/ar 18 + ln -s ${llvm}/bin/llvm-as $out/bin/as 19 + ln -s ${llvm}/bin/llvm-dwp $out/bin/dwp 20 + ln -s ${llvm}/bin/llvm-nm $out/bin/nm 21 + ln -s ${llvm}/bin/llvm-objcopy $out/bin/objcopy 22 + ln -s ${llvm}/bin/llvm-objdump $out/bin/objdump 23 + ln -s ${llvm}/bin/llvm-ranlib $out/bin/ranlib 24 + ln -s ${llvm}/bin/llvm-readelf $out/bin/readelf 25 + ln -s ${llvm}/bin/llvm-size $out/bin/size 26 + ln -s ${llvm}/bin/llvm-strip $out/bin/strip 27 + ln -s ${lld}/bin/lld $out/bin/ld 28 + ''
+63
pkgs/development/rocm-modules/6/llvm/stage-2/compiler-rt.nix
···
··· 1 + { lib 2 + , stdenv 3 + , callPackage 4 + , rocmUpdateScript 5 + , llvm 6 + , glibc 7 + }: 8 + 9 + callPackage ../base.nix rec { 10 + inherit stdenv rocmUpdateScript; 11 + buildDocs = false; # No documentation to build 12 + buildMan = false; # No man pages to build 13 + targetName = "compiler-rt"; 14 + targetDir = "runtimes"; 15 + 16 + targetRuntimes = [ 17 + "libunwind" 18 + "libcxxabi" 19 + "libcxx" 20 + targetName 21 + ]; 22 + 23 + extraCMakeFlags = [ 24 + "-DCOMPILER_RT_INCLUDE_TESTS=ON" 25 + "-DCOMPILER_RT_USE_LLVM_UNWINDER=ON" 26 + "-DCOMPILER_RT_CXX_LIBRARY=libcxx" 27 + "-DCOMPILER_RT_CAN_EXECUTE_TESTS=OFF" # We can't run most of these 28 + 29 + # Workaround having to build combined 30 + "-DLIBUNWIND_INCLUDE_DOCS=OFF" 31 + "-DLIBUNWIND_INCLUDE_TESTS=OFF" 32 + "-DLIBUNWIND_USE_COMPILER_RT=ON" 33 + "-DLIBUNWIND_INSTALL_LIBRARY=OFF" 34 + "-DLIBUNWIND_INSTALL_HEADERS=OFF" 35 + "-DLIBCXXABI_INCLUDE_TESTS=OFF" 36 + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 37 + "-DLIBCXXABI_USE_COMPILER_RT=ON" 38 + "-DLIBCXXABI_INSTALL_LIBRARY=OFF" 39 + "-DLIBCXXABI_INSTALL_HEADERS=OFF" 40 + "-DLIBCXX_INCLUDE_DOCS=OFF" 41 + "-DLIBCXX_INCLUDE_TESTS=OFF" 42 + "-DLIBCXX_USE_COMPILER_RT=ON" 43 + "-DLIBCXX_CXX_ABI=libcxxabi" 44 + "-DLIBCXX_INSTALL_LIBRARY=OFF" 45 + "-DLIBCXX_INSTALL_HEADERS=OFF" 46 + ]; 47 + 48 + extraPostPatch = '' 49 + # `No such file or directory: 'ldd'` 50 + substituteInPlace ../compiler-rt/test/lit.common.cfg.py \ 51 + --replace "'ldd'," "'${glibc.bin}/bin/ldd'," 52 + 53 + # We can run these 54 + substituteInPlace ../compiler-rt/test/CMakeLists.txt \ 55 + --replace "endfunction()" "endfunction()''\nadd_subdirectory(builtins)''\nadd_subdirectory(shadowcallstack)" 56 + 57 + # Could not launch llvm-config in /build/source/runtimes/build/bin 58 + mkdir -p build/bin 59 + ln -s ${llvm}/bin/llvm-config build/bin 60 + ''; 61 + 62 + extraLicenses = [ lib.licenses.mit ]; 63 + }
+26
pkgs/development/rocm-modules/6/llvm/stage-2/libc.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + }: 5 + 6 + callPackage ../base.nix rec { 7 + inherit stdenv rocmUpdateScript; 8 + buildMan = false; # No man pages to build 9 + targetName = "libc"; 10 + targetDir = "runtimes"; 11 + targetRuntimes = [ targetName ]; 12 + 13 + extraPostPatch = '' 14 + # `Failed to match ... against ...` `Match value not within tolerance value of MPFR result:` 15 + # We need a better way, but I don't know enough sed magic and patching `CMakeLists.txt` isn't working... 16 + substituteInPlace ../libc/test/src/math/log10_test.cpp \ 17 + --replace "i < N" "i < 0" \ 18 + --replace "test(mpfr::RoundingMode::Nearest);" "" \ 19 + --replace "test(mpfr::RoundingMode::Downward);" "" \ 20 + --replace "test(mpfr::RoundingMode::Upward);" "" \ 21 + --replace "test(mpfr::RoundingMode::TowardZero);" "" 22 + ''; 23 + 24 + checkTargets = [ "check-${targetName}" ]; 25 + hardeningDisable = [ "fortify" ]; # Prevent `error: "Assumed value of MB_LEN_MAX wrong"` 26 + }
+42
pkgs/development/rocm-modules/6/llvm/stage-2/libcxx.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + }: 5 + 6 + callPackage ../base.nix rec { 7 + inherit stdenv rocmUpdateScript; 8 + buildMan = false; # No man pages to build 9 + targetName = "libcxx"; 10 + targetDir = "runtimes"; 11 + 12 + targetRuntimes = [ 13 + "libunwind" 14 + "libcxxabi" 15 + targetName 16 + ]; 17 + 18 + extraCMakeFlags = [ 19 + "-DLIBCXX_INCLUDE_DOCS=ON" 20 + "-DLIBCXX_INCLUDE_TESTS=ON" 21 + "-DLIBCXX_USE_COMPILER_RT=ON" 22 + "-DLIBCXX_CXX_ABI=libcxxabi" 23 + 24 + # Workaround having to build combined 25 + "-DLIBUNWIND_INCLUDE_DOCS=OFF" 26 + "-DLIBUNWIND_INCLUDE_TESTS=OFF" 27 + "-DLIBUNWIND_USE_COMPILER_RT=ON" 28 + "-DLIBUNWIND_INSTALL_LIBRARY=OFF" 29 + "-DLIBUNWIND_INSTALL_HEADERS=OFF" 30 + "-DLIBCXXABI_INCLUDE_TESTS=OFF" 31 + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 32 + "-DLIBCXXABI_USE_COMPILER_RT=ON" 33 + "-DLIBCXXABI_INSTALL_LIBRARY=OFF" 34 + "-DLIBCXXABI_INSTALL_HEADERS=OFF" 35 + ]; 36 + 37 + # Most of these can't find `bash` or `mkdir`, might just be hard-coded paths, or PATH is altered 38 + extraPostPatch = '' 39 + chmod +w -R ../libcxx/test/{libcxx,std} 40 + cat ${./1000-libcxx-failing-tests.list} | xargs -d \\n rm 41 + ''; 42 + }
+37
pkgs/development/rocm-modules/6/llvm/stage-2/libcxxabi.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + }: 5 + 6 + callPackage ../base.nix rec { 7 + inherit stdenv rocmUpdateScript; 8 + buildDocs = false; # No documentation to build 9 + buildMan = false; # No man pages to build 10 + targetName = "libcxxabi"; 11 + targetDir = "runtimes"; 12 + 13 + targetRuntimes = [ 14 + "libunwind" 15 + targetName 16 + "libcxx" 17 + ]; 18 + 19 + extraCMakeFlags = [ 20 + "-DLIBCXXABI_INCLUDE_TESTS=ON" 21 + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 22 + "-DLIBCXXABI_USE_COMPILER_RT=ON" 23 + 24 + # Workaround having to build combined 25 + "-DLIBUNWIND_INCLUDE_DOCS=OFF" 26 + "-DLIBUNWIND_INCLUDE_TESTS=OFF" 27 + "-DLIBUNWIND_USE_COMPILER_RT=ON" 28 + "-DLIBUNWIND_INSTALL_LIBRARY=OFF" 29 + "-DLIBUNWIND_INSTALL_HEADERS=OFF" 30 + "-DLIBCXX_INCLUDE_DOCS=OFF" 31 + "-DLIBCXX_INCLUDE_TESTS=OFF" 32 + "-DLIBCXX_USE_COMPILER_RT=ON" 33 + "-DLIBCXX_CXX_ABI=libcxxabi" 34 + "-DLIBCXX_INSTALL_LIBRARY=OFF" 35 + "-DLIBCXX_INSTALL_HEADERS=OFF" 36 + ]; 37 + }
+26
pkgs/development/rocm-modules/6/llvm/stage-2/libunwind.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + }: 5 + 6 + callPackage ../base.nix rec { 7 + inherit stdenv rocmUpdateScript; 8 + buildMan = false; # No man pages to build 9 + targetName = "libunwind"; 10 + targetDir = "runtimes"; 11 + targetRuntimes = [ targetName ]; 12 + 13 + extraCMakeFlags = [ 14 + "-DLIBUNWIND_INCLUDE_DOCS=ON" 15 + "-DLIBUNWIND_INCLUDE_TESTS=ON" 16 + "-DLIBUNWIND_USE_COMPILER_RT=ON" 17 + ]; 18 + 19 + extraPostPatch = '' 20 + # `command had no output on stdout or stderr` (Says these unsupported tests) 21 + chmod +w -R ../libunwind/test 22 + rm ../libunwind/test/floatregister.pass.cpp 23 + rm ../libunwind/test/unwind_leaffunction.pass.cpp 24 + rm ../libunwind/test/libunwind_02.pass.cpp 25 + ''; 26 + }
+36
pkgs/development/rocm-modules/6/llvm/stage-2/rstdenv.nix
···
··· 1 + { stdenv 2 + , overrideCC 3 + , wrapCCWith 4 + , llvm 5 + , clang-unwrapped 6 + , lld 7 + , runtimes 8 + , bintools 9 + }: 10 + 11 + overrideCC stdenv (wrapCCWith rec { 12 + inherit bintools; 13 + libcxx = runtimes; 14 + cc = clang-unwrapped; 15 + gccForLibs = stdenv.cc.cc; 16 + 17 + extraPackages = [ 18 + llvm 19 + lld 20 + ]; 21 + 22 + nixSupport.cc-cflags = [ 23 + "-resource-dir=$out/resource-root" 24 + "-fuse-ld=lld" 25 + "-rtlib=compiler-rt" 26 + "-unwindlib=libunwind" 27 + "-Wno-unused-command-line-argument" 28 + ]; 29 + 30 + extraBuildCommands = '' 31 + clang_version=`${cc}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` 32 + mkdir -p $out/resource-root 33 + ln -s ${cc}/lib/clang/$clang_version/include $out/resource-root 34 + ln -s ${runtimes}/lib $out/resource-root 35 + ''; 36 + })
+36
pkgs/development/rocm-modules/6/llvm/stage-3/0000-mlir-fix-debugtranslation.patch
···
··· 1 + From f1d1e10ec7e1061bf0b90abbc1e298d9438a5e74 Mon Sep 17 00:00:00 2001 2 + From: Scott Linder <Scott.Linder@amd.com> 3 + Date: Mon, 11 Sep 2023 18:37:37 +0000 4 + Subject: [PATCH] [HeterogeneousDWARF] Update MLIR DI Metadata handling 5 + 6 + Pass a default DW_MSPACE_LLVM_none to satisfy new API 7 + 8 + Change-Id: I50df461f00b5510a715f55f61107122318102d22 9 + --- 10 + lib/Target/LLVMIR/DebugTranslation.cpp | 6 ++++-- 11 + 1 file changed, 4 insertions(+), 2 deletions(-) 12 + 13 + diff --git a/lib/Target/LLVMIR/DebugTranslation.cpp b/lib/Target/LLVMIR/DebugTranslation.cpp 14 + index 2053f5bcef06aa6..635ee5d7e5fefdc 100644 15 + --- a/lib/Target/LLVMIR/DebugTranslation.cpp 16 + +++ b/lib/Target/LLVMIR/DebugTranslation.cpp 17 + @@ -148,7 +148,8 @@ llvm::DIDerivedType *DebugTranslation::translateImpl(DIDerivedTypeAttr attr) { 18 + /*File=*/nullptr, /*Line=*/0, 19 + /*Scope=*/nullptr, translate(attr.getBaseType()), attr.getSizeInBits(), 20 + attr.getAlignInBits(), attr.getOffsetInBits(), 21 + - /*DWARFAddressSpace=*/std::nullopt, /*Flags=*/llvm::DINode::FlagZero); 22 + + /*DWARFAddressSpace=*/std::nullopt, llvm::dwarf::DW_MSPACE_LLVM_none, 23 + + /*Flags=*/llvm::DINode::FlagZero); 24 + } 25 + 26 + llvm::DIFile *DebugTranslation::translateImpl(DIFileAttr attr) { 27 + @@ -185,7 +186,8 @@ DebugTranslation::translateImpl(DILocalVariableAttr attr) { 28 + llvmCtx, translate(attr.getScope()), getMDStringOrNull(attr.getName()), 29 + translate(attr.getFile()), attr.getLine(), translate(attr.getType()), 30 + attr.getArg(), 31 + - /*Flags=*/llvm::DINode::FlagZero, attr.getAlignInBits(), 32 + + /*Flags=*/llvm::DINode::FlagZero, llvm::dwarf::DW_MSPACE_LLVM_none, 33 + + attr.getAlignInBits(), 34 + /*Annotations=*/nullptr); 35 + } 36 +
+122
pkgs/development/rocm-modules/6/llvm/stage-3/1000-openmp-failing-tests.list
···
··· 1 + runtime/test/tasking/hidden_helper_task/gtid.cpp 2 + runtime/test/ompt/parallel/parallel_if0.c 3 + runtime/test/ompt/parallel/serialized.c 4 + runtime/test/ompt/teams/parallel_team.c 5 + runtime/test/ompt/teams/serial_teams.c 6 + runtime/test/ompt/teams/serialized.c 7 + runtime/test/ompt/teams/team.c 8 + libomptarget/test/api/assert.c 9 + libomptarget/test/api/omp_device_managed_memory.c 10 + libomptarget/test/api/omp_device_memory.c 11 + libomptarget/test/api/omp_get_device_num.c 12 + libomptarget/test/api/omp_host_pinned_memory.c 13 + libomptarget/test/api/omp_host_pinned_memory_alloc.c 14 + libomptarget/test/api/omp_target_memcpy_async1.c 15 + libomptarget/test/api/omp_target_memcpy_async2.c 16 + libomptarget/test/api/omp_target_memcpy_rect_async1.c 17 + libomptarget/test/api/omp_target_memcpy_rect_async2.c 18 + libomptarget/test/mapping/array_section_implicit_capture.c 19 + libomptarget/test/mapping/data_absent_at_exit.c 20 + libomptarget/test/mapping/data_member_ref.cpp 21 + libomptarget/test/mapping/declare_mapper_api.cpp 22 + libomptarget/test/mapping/declare_mapper_target.cpp 23 + libomptarget/test/mapping/declare_mapper_target_data.cpp 24 + libomptarget/test/mapping/declare_mapper_target_data_enter_exit.cpp 25 + libomptarget/test/mapping/firstprivate_aligned.cpp 26 + libomptarget/test/mapping/has_device_addr.cpp 27 + libomptarget/test/mapping/implicit_device_ptr.c 28 + libomptarget/test/mapping/is_device_ptr.cpp 29 + libomptarget/test/mapping/lambda_mapping.cpp 30 + libomptarget/test/mapping/low_alignment.c 31 + libomptarget/test/mapping/map_back_race.cpp 32 + libomptarget/test/mapping/power_of_two_alignment.c 33 + libomptarget/test/mapping/pr38704.c 34 + libomptarget/test/mapping/prelock.cpp 35 + libomptarget/test/mapping/present/target_data_at_exit.c 36 + libomptarget/test/mapping/private_mapping.c 37 + libomptarget/test/mapping/ptr_and_obj_motion.c 38 + libomptarget/test/mapping/reduction_implicit_map.cpp 39 + libomptarget/test/mapping/target_derefence_array_pointrs.cpp 40 + libomptarget/test/mapping/target_map_for_member_data.cpp 41 + libomptarget/test/mapping/target_update_array_extension.c 42 + libomptarget/test/mapping/target_use_device_addr.c 43 + libomptarget/test/offloading/atomic-compare-signedness.c 44 + libomptarget/test/offloading/bug47654.cpp 45 + libomptarget/test/offloading/bug49021.cpp 46 + libomptarget/test/offloading/bug49779.cpp 47 + libomptarget/test/offloading/bug50022.cpp 48 + libomptarget/test/offloading/bug51781.c 49 + libomptarget/test/offloading/bug51982.c 50 + libomptarget/test/offloading/bug53727.cpp 51 + libomptarget/test/offloading/complex_reduction.cpp 52 + libomptarget/test/offloading/cuda_no_devices.c 53 + libomptarget/test/offloading/d2d_memcpy.c 54 + libomptarget/test/offloading/dynamic_module.c 55 + libomptarget/test/offloading/dynamic_module_load.c 56 + libomptarget/test/offloading/global_constructor.cpp 57 + libomptarget/test/offloading/lone_target_exit_data.c 58 + libomptarget/test/offloading/memory_manager.cpp 59 + libomptarget/test/offloading/parallel_offloading_map.cpp 60 + libomptarget/test/offloading/static_linking.c 61 + libomptarget/test/offloading/std_complex_arithmetic.cpp 62 + libomptarget/test/offloading/target-teams-atomic.c 63 + libomptarget/test/offloading/target_constexpr_mapping.cpp 64 + libomptarget/test/offloading/target_critical_region.cpp 65 + libomptarget/test/offloading/target_depend_nowait.cpp 66 + libomptarget/test/offloading/target_nowait_target.cpp 67 + libomptarget/test/offloading/taskloop_offload_nowait.cpp 68 + libomptarget/test/offloading/test_libc.cpp 69 + libomptarget/test/ompt/veccopy.c 70 + libomptarget/test/ompt/veccopy_disallow_both.c 71 + libomptarget/test/ompt/veccopy_emi.c 72 + libomptarget/test/ompt/veccopy_emi_map.c 73 + libomptarget/test/ompt/veccopy_map.c 74 + libomptarget/test/ompt/veccopy_no_device_init.c 75 + libomptarget/test/ompt/veccopy_wrong_return.c 76 + libomptarget/test/api/is_initial_device.c 77 + libomptarget/test/mapping/declare_mapper_nested_default_mappers_array_subscript.cpp 78 + libomptarget/test/mapping/declare_mapper_nested_default_mappers_ptr_subscript.cpp 79 + libomptarget/test/mapping/declare_mapper_nested_default_mappers_var.cpp 80 + libomptarget/test/mapping/target_pointers_members_map.cpp 81 + libomptarget/test/api/omp_dynamic_shared_memory_mixed.c 82 + libomptarget/test/api/omp_env_vars.c 83 + libomptarget/test/api/omp_get_mapped_ptr.c 84 + libomptarget/test/api/omp_get_num_devices.c 85 + libomptarget/test/api/omp_get_num_devices_with_empty_target.c 86 + libomptarget/test/mapping/alloc_fail.c 87 + libomptarget/test/mapping/array_section_use_device_ptr.c 88 + libomptarget/test/mapping/declare_mapper_nested_default_mappers.cpp 89 + libomptarget/test/mapping/declare_mapper_nested_mappers.cpp 90 + libomptarget/test/mapping/declare_mapper_target_update.cpp 91 + libomptarget/test/mapping/delete_inf_refcount.c 92 + libomptarget/test/mapping/lambda_by_value.cpp 93 + libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c 94 + libomptarget/test/mapping/ompx_hold/struct.c 95 + libomptarget/test/mapping/ompx_hold/target-data.c 96 + libomptarget/test/mapping/ompx_hold/target.c 97 + libomptarget/test/mapping/present/target.c 98 + libomptarget/test/mapping/present/target_array_extension.c 99 + libomptarget/test/mapping/present/target_data.c 100 + libomptarget/test/mapping/present/target_data_array_extension.c 101 + libomptarget/test/mapping/present/target_enter_data.c 102 + libomptarget/test/mapping/present/target_exit_data_delete.c 103 + libomptarget/test/mapping/present/target_exit_data_release.c 104 + libomptarget/test/mapping/present/target_update.c 105 + libomptarget/test/mapping/present/target_update_array_extension.c 106 + libomptarget/test/mapping/present/zero_length_array_section.c 107 + libomptarget/test/mapping/present/zero_length_array_section_exit.c 108 + libomptarget/test/mapping/target_data_array_extension_at_exit.c 109 + libomptarget/test/mapping/target_has_device_addr.c 110 + libomptarget/test/mapping/target_implicit_partial_map.c 111 + libomptarget/test/mapping/target_wrong_use_device_addr.c 112 + libomptarget/test/offloading/host_as_target.c 113 + libomptarget/test/offloading/info.c 114 + libomptarget/test/offloading/offloading_success.c 115 + libomptarget/test/offloading/offloading_success.cpp 116 + libomptarget/test/offloading/wtime.c 117 + libomptarget/test/unified_shared_memory/api.c 118 + libomptarget/test/unified_shared_memory/associate_ptr.c 119 + libomptarget/test/unified_shared_memory/close_enter_exit.c 120 + libomptarget/test/unified_shared_memory/close_manual.c 121 + libomptarget/test/unified_shared_memory/close_member.c 122 + libomptarget/test/unified_shared_memory/close_modifier.c
+11
pkgs/development/rocm-modules/6/llvm/stage-3/1001-mlir-failing-tests.list
···
··· 1 + ./test/Target/LLVMIR/openmp-llvm.mlir 2 + ./test/mlir-spirv-cpu-runner/double.mlir 3 + ./test/mlir-spirv-cpu-runner/simple_add.mlir 4 + ./test/mlir-vulkan-runner/addf.mlir 5 + ./test/mlir-vulkan-runner/addi.mlir 6 + ./test/mlir-vulkan-runner/addi8.mlir 7 + ./test/mlir-vulkan-runner/mulf.mlir 8 + ./test/mlir-vulkan-runner/smul_extended.mlir 9 + ./test/mlir-vulkan-runner/subf.mlir 10 + ./test/mlir-vulkan-runner/time.mlir 11 + ./test/mlir-vulkan-runner/umul_extended.mlir
+42
pkgs/development/rocm-modules/6/llvm/stage-3/clang-tools-extra.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + , llvm 5 + , clang-unwrapped 6 + , gtest 7 + }: 8 + 9 + callPackage ../base.nix rec { 10 + inherit stdenv rocmUpdateScript; 11 + buildTests = false; # `invalid operands to binary expression ('std::basic_stringstream<char>' and 'const llvm::StringRef')` 12 + targetName = "clang-tools-extra"; 13 + 14 + targetProjects = [ 15 + "clang" 16 + "clang-tools-extra" 17 + ]; 18 + 19 + extraBuildInputs = [ gtest ]; 20 + 21 + extraCMakeFlags = [ 22 + "-DLLVM_INCLUDE_DOCS=OFF" 23 + "-DLLVM_INCLUDE_TESTS=OFF" 24 + "-DCLANG_INCLUDE_DOCS=OFF" 25 + "-DCLANG_INCLUDE_TESTS=ON" 26 + "-DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=ON" 27 + ]; 28 + 29 + extraPostInstall = '' 30 + # Remove LLVM and Clang 31 + for path in `find ${llvm} ${clang-unwrapped}`; do 32 + if [ $path != ${llvm} ] && [ $path != ${clang-unwrapped} ]; then 33 + rm -f $out''${path#${llvm}} $out''${path#${clang-unwrapped}} || true 34 + fi 35 + done 36 + 37 + # Cleanup empty directories 38 + find $out -type d -empty -delete 39 + ''; 40 + 41 + requiredSystemFeatures = [ "big-parallel" ]; 42 + }
+73
pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix
···
··· 1 + { stdenv 2 + , wrapCCWith 3 + , llvm 4 + , lld 5 + , clang-unwrapped 6 + , bintools 7 + , libc 8 + , libunwind 9 + , libcxxabi 10 + , libcxx 11 + , compiler-rt 12 + }: 13 + 14 + wrapCCWith rec { 15 + inherit libcxx bintools; 16 + 17 + # We do this to avoid HIP pathing problems, and mimic a monolithic install 18 + cc = stdenv.mkDerivation (finalAttrs: { 19 + inherit (clang-unwrapped) version; 20 + pname = "rocm-llvm-clang"; 21 + dontUnpack = true; 22 + 23 + installPhase = '' 24 + runHook preInstall 25 + 26 + clang_version=`${clang-unwrapped}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` 27 + mkdir -p $out/{bin,include/c++/v1,lib/{cmake,clang/$clang_version/{include,lib}},libexec,share} 28 + 29 + for path in ${llvm} ${clang-unwrapped} ${lld} ${libc} ${libunwind} ${libcxxabi} ${libcxx} ${compiler-rt}; do 30 + cp -as $path/* $out 31 + chmod +w $out/{*,include/c++/v1,lib/{clang/$clang_version/include,cmake}} 32 + rm -f $out/lib/libc++.so 33 + done 34 + 35 + ln -s $out/lib/* $out/lib/clang/$clang_version/lib 36 + ln -sf $out/include/* $out/lib/clang/$clang_version/include 37 + 38 + runHook postInstall 39 + ''; 40 + 41 + passthru.isClang = true; 42 + }); 43 + 44 + extraPackages = [ 45 + llvm 46 + lld 47 + libc 48 + libunwind 49 + libcxxabi 50 + compiler-rt 51 + ]; 52 + 53 + nixSupport.cc-cflags = [ 54 + "-resource-dir=$out/resource-root" 55 + "-fuse-ld=lld" 56 + "-rtlib=compiler-rt" 57 + "-unwindlib=libunwind" 58 + "-Wno-unused-command-line-argument" 59 + ]; 60 + 61 + extraBuildCommands = '' 62 + clang_version=`${cc}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` 63 + mkdir -p $out/resource-root 64 + ln -s ${cc}/lib/clang/$clang_version/{include,lib} $out/resource-root 65 + 66 + # Not sure why, but hardening seems to make things break 67 + echo "" > $out/nix-support/add-hardening.sh 68 + 69 + # GPU compilation uses builtin `lld` 70 + substituteInPlace $out/bin/{clang,clang++} \ 71 + --replace "-MM) dontLink=1 ;;" "-MM | --cuda-device-only) dontLink=1 ;;''\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;" 72 + ''; 73 + }
+31
pkgs/development/rocm-modules/6/llvm/stage-3/flang.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + , clang-unwrapped 5 + , mlir 6 + , graphviz 7 + , python3Packages 8 + }: 9 + 10 + callPackage ../base.nix rec { 11 + inherit stdenv rocmUpdateScript; 12 + targetName = "flang"; 13 + targetDir = targetName; 14 + 15 + extraNativeBuildInputs = [ 16 + graphviz 17 + python3Packages.sphinx-markdown-tables 18 + ]; 19 + 20 + extraBuildInputs = [ mlir ]; 21 + 22 + extraCMakeFlags = [ 23 + "-DCLANG_DIR=${clang-unwrapped}/lib/cmake/clang" 24 + "-DMLIR_TABLEGEN_EXE=${mlir}/bin/mlir-tblgen" 25 + "-DCLANG_TABLEGEN_EXE=${clang-unwrapped}/bin/clang-tblgen" 26 + "-DFLANG_INCLUDE_TESTS=OFF" # `The dependency target "Bye" of target ...` 27 + ]; 28 + 29 + # `flang/lib/Semantics/check-omp-structure.cpp:1905:1: error: no member named 'v' in 'Fortran::parser::OmpClause::OmpxDynCgroupMem'` 30 + isBroken = true; 31 + }
+36
pkgs/development/rocm-modules/6/llvm/stage-3/libclc.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + , llvm 5 + , clang 6 + , spirv-llvm-translator 7 + }: 8 + 9 + let 10 + spirv = (spirv-llvm-translator.override { inherit llvm; }); 11 + in callPackage ../base.nix rec { 12 + inherit stdenv rocmUpdateScript; 13 + buildDocs = false; # No documentation to build 14 + buildMan = false; # No man pages to build 15 + targetName = "libclc"; 16 + targetDir = targetName; 17 + extraBuildInputs = [ spirv ]; 18 + 19 + # `spirv-mesa3d` isn't compiling with LLVM 15.0.0, it does with LLVM 14.0.0 20 + # Try removing the `spirv-mesa3d` and `clspv` patches next update 21 + # `clspv` tests fail, unresolved calls 22 + extraPostPatch = '' 23 + substituteInPlace CMakeLists.txt \ 24 + --replace "find_program( LLVM_CLANG clang PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ 25 + "find_program( LLVM_CLANG clang PATHS \"${clang}/bin\" NO_DEFAULT_PATH )" \ 26 + --replace "find_program( LLVM_SPIRV llvm-spirv PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \ 27 + "find_program( LLVM_SPIRV llvm-spirv PATHS \"${spirv}/bin\" NO_DEFAULT_PATH )" \ 28 + --replace " spirv-mesa3d-" "" \ 29 + --replace " spirv64-mesa3d-" "" \ 30 + --replace "NOT \''${t} MATCHES" \ 31 + "NOT \''${ARCH} STREQUAL \"clspv\" AND NOT \''${ARCH} STREQUAL \"clspv64\" AND NOT \''${t} MATCHES" 32 + ''; 33 + 34 + checkTargets = [ ]; 35 + isBroken = true; # ROCm 5.7.0 doesn't have IR/AttributeMask.h yet...? 36 + }
+39
pkgs/development/rocm-modules/6/llvm/stage-3/lldb.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + , clang 5 + , xz 6 + , swig 7 + , lua5_3 8 + , graphviz 9 + , gtest 10 + , python3Packages 11 + }: 12 + 13 + callPackage ../base.nix rec { 14 + inherit stdenv rocmUpdateScript; 15 + buildTests = false; # FIXME: Bad pathing for clang executable in tests, using relative path most likely 16 + targetName = "lldb"; 17 + targetDir = targetName; 18 + extraNativeBuildInputs = [ python3Packages.sphinx-automodapi ]; 19 + 20 + extraBuildInputs = [ 21 + xz 22 + swig 23 + lua5_3 24 + graphviz 25 + gtest 26 + ]; 27 + 28 + extraCMakeFlags = [ 29 + "-DLLDB_EXTERNAL_CLANG_RESOURCE_DIR=${clang}/resource-root/lib/clang/$clang_version" 30 + "-DLLDB_INCLUDE_TESTS=ON" 31 + "-DLLDB_INCLUDE_UNITTESTS=ON" 32 + ]; 33 + 34 + extraPostPatch = '' 35 + export clang_version=`clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"` 36 + ''; 37 + 38 + checkTargets = [ "check-${targetName}" ]; 39 + }
+57
pkgs/development/rocm-modules/6/llvm/stage-3/mlir.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + , clr 5 + , vulkan-headers 6 + , vulkan-loader 7 + , glslang 8 + , shaderc 9 + , lit 10 + }: 11 + 12 + callPackage ../base.nix rec { 13 + inherit stdenv rocmUpdateScript; 14 + buildDocs = false; # No decent way to hack this to work 15 + buildMan = false; # No man pages to build 16 + targetName = "mlir"; 17 + targetDir = targetName; 18 + 19 + # Fix `DebugTranslation.cpp:139:10: error: no matching function for call to 'get'` 20 + # We patch at a different source root, so we modify the patch and include it locally 21 + # https://github.com/ROCm/llvm-project/commit/f1d1e10ec7e1061bf0b90abbc1e298d9438a5e74.patch 22 + extraPatches = [ ./0000-mlir-fix-debugtranslation.patch ]; 23 + extraNativeBuildInputs = [ clr ]; 24 + 25 + extraBuildInputs = [ 26 + vulkan-headers 27 + vulkan-loader 28 + glslang 29 + shaderc 30 + ]; 31 + 32 + extraCMakeFlags = [ 33 + "-DMLIR_INCLUDE_DOCS=ON" 34 + "-DMLIR_INCLUDE_TESTS=ON" 35 + "-DMLIR_ENABLE_ROCM_RUNNER=ON" 36 + "-DMLIR_ENABLE_SPIRV_CPU_RUNNER=ON" 37 + "-DMLIR_ENABLE_VULKAN_RUNNER=ON" 38 + "-DROCM_TEST_CHIPSET=gfx000" # CPU runner 39 + ]; 40 + 41 + extraPostPatch = '' 42 + # `add_library cannot create target "llvm_gtest" because an imported target with the same name already exists` 43 + substituteInPlace CMakeLists.txt \ 44 + --replace "EXISTS \''${UNITTEST_DIR}/googletest/include/gtest/gtest.h" "FALSE" 45 + 46 + # Mainly `No such file or directory` 47 + cat ${./1001-mlir-failing-tests.list} | xargs -d \\n rm 48 + ''; 49 + 50 + extraPostInstall = '' 51 + mkdir -p $out/bin 52 + mv bin/mlir-tblgen $out/bin 53 + ''; 54 + 55 + checkTargets = [ "check-${targetName}" ]; 56 + requiredSystemFeatures = [ "big-parallel" ]; 57 + }
+54
pkgs/development/rocm-modules/6/llvm/stage-3/openmp.nix
···
··· 1 + { lib 2 + , stdenv 3 + , callPackage 4 + , rocmUpdateScript 5 + , llvm 6 + , clang 7 + , clang-unwrapped 8 + , rocm-device-libs 9 + , rocm-runtime 10 + , rocm-thunk 11 + , perl 12 + , elfutils 13 + , libdrm 14 + , numactl 15 + , lit 16 + }: 17 + 18 + callPackage ../base.nix rec { 19 + inherit stdenv rocmUpdateScript; 20 + targetName = "openmp"; 21 + targetDir = targetName; 22 + extraNativeBuildInputs = [ perl ]; 23 + 24 + extraBuildInputs = [ 25 + rocm-device-libs 26 + rocm-runtime 27 + rocm-thunk 28 + elfutils 29 + libdrm 30 + numactl 31 + ]; 32 + 33 + extraCMakeFlags = [ 34 + "-DCMAKE_MODULE_PATH=/build/source/llvm/cmake/modules" # For docs 35 + "-DCLANG_TOOL=${clang}/bin/clang" 36 + "-DCLANG_OFFLOAD_BUNDLER_TOOL=${clang-unwrapped}/bin/clang-offload-bundler" 37 + "-DPACKAGER_TOOL=${clang-unwrapped}/bin/clang-offload-packager" 38 + "-DOPENMP_LLVM_TOOLS_DIR=${llvm}/bin" 39 + "-DOPENMP_LLVM_LIT_EXECUTABLE=${lit}/bin/.lit-wrapped" 40 + "-DDEVICELIBS_ROOT=${rocm-device-libs.src}" 41 + ]; 42 + 43 + extraPostPatch = '' 44 + # We can't build this target at the moment 45 + substituteInPlace libomptarget/DeviceRTL/CMakeLists.txt \ 46 + --replace "gfx1010" "" 47 + 48 + # No idea what's going on here... 49 + cat ${./1000-openmp-failing-tests.list} | xargs -d \\n rm 50 + ''; 51 + 52 + checkTargets = [ "check-${targetName}" ]; 53 + extraLicenses = [ lib.licenses.mit ]; 54 + }
+18
pkgs/development/rocm-modules/6/llvm/stage-3/polly.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + }: 5 + 6 + callPackage ../base.nix rec { 7 + inherit stdenv rocmUpdateScript; 8 + targetName = "polly"; 9 + targetDir = targetName; 10 + 11 + extraPostPatch = '' 12 + # `add_library cannot create target "llvm_gtest" because an imported target with the same name already exists` 13 + substituteInPlace CMakeLists.txt \ 14 + --replace "NOT TARGET gtest" "FALSE" 15 + ''; 16 + 17 + checkTargets = [ "check-${targetName}" ]; 18 + }
+15
pkgs/development/rocm-modules/6/llvm/stage-3/pstl.nix
···
··· 1 + { stdenv 2 + , callPackage 3 + , rocmUpdateScript 4 + }: 5 + 6 + callPackage ../base.nix rec { 7 + inherit stdenv rocmUpdateScript; 8 + buildDocs = false; # No documentation to build 9 + buildMan = false; # No man pages to build 10 + buildTests = false; # Too many errors 11 + targetName = "pstl"; 12 + targetDir = "runtimes"; 13 + targetRuntimes = [ targetName ]; 14 + checkTargets = [ "check-${targetName}" ]; 15 + }
+171
pkgs/development/rocm-modules/6/migraphx/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , pkg-config 6 + , cmake 7 + , rocm-cmake 8 + , clr 9 + , clang-tools-extra 10 + , openmp 11 + , rocblas 12 + , rocmlir 13 + , composable_kernel 14 + , miopen 15 + , protobuf 16 + , half 17 + , nlohmann_json 18 + , msgpack 19 + , sqlite 20 + , oneDNN_2 21 + , blaze 22 + , cppcheck 23 + , rocm-device-libs 24 + , texliveSmall 25 + , doxygen 26 + , sphinx 27 + , docutils 28 + , ghostscript 29 + , python3Packages 30 + , buildDocs ? false 31 + , buildTests ? false 32 + , gpuTargets ? clr.gpuTargets 33 + }: 34 + 35 + let 36 + latex = lib.optionalAttrs buildDocs (texliveSmall.withPackages (ps: with ps; [ 37 + latexmk 38 + tex-gyre 39 + fncychap 40 + wrapfig 41 + capt-of 42 + framed 43 + needspace 44 + tabulary 45 + varwidth 46 + titlesec 47 + epstopdf 48 + ])); 49 + in stdenv.mkDerivation (finalAttrs: { 50 + pname = "migraphx"; 51 + version = "6.0.2"; 52 + 53 + outputs = [ 54 + "out" 55 + ] ++ lib.optionals buildDocs [ 56 + "doc" 57 + ] ++ lib.optionals buildTests [ 58 + "test" 59 + ]; 60 + 61 + src = fetchFromGitHub { 62 + owner = "ROCm"; 63 + repo = "AMDMIGraphX"; 64 + rev = "rocm-${finalAttrs.version}"; 65 + hash = "sha256-VDYUSpWYAdJ63SKVCO26DVAC3RtZM7otqN0sYUA6DBQ="; 66 + }; 67 + 68 + nativeBuildInputs = [ 69 + pkg-config 70 + cmake 71 + rocm-cmake 72 + clr 73 + clang-tools-extra 74 + python3Packages.python 75 + ] ++ lib.optionals buildDocs [ 76 + latex 77 + doxygen 78 + sphinx 79 + docutils 80 + ghostscript 81 + python3Packages.sphinx-rtd-theme 82 + python3Packages.breathe 83 + ]; 84 + 85 + buildInputs = [ 86 + openmp 87 + rocblas 88 + rocmlir 89 + composable_kernel 90 + miopen 91 + protobuf 92 + half 93 + nlohmann_json 94 + msgpack 95 + sqlite 96 + oneDNN_2 97 + blaze 98 + cppcheck 99 + python3Packages.pybind11 100 + python3Packages.onnx 101 + ]; 102 + 103 + cmakeFlags = [ 104 + "-DMIGRAPHX_ENABLE_GPU=ON" 105 + "-DMIGRAPHX_ENABLE_CPU=ON" 106 + "-DMIGRAPHX_ENABLE_FPGA=ON" 107 + "-DMIGRAPHX_ENABLE_MLIR=OFF" # LLVM or rocMLIR mismatch? 108 + # Manually define CMAKE_INSTALL_<DIR> 109 + # See: https://github.com/NixOS/nixpkgs/pull/197838 110 + "-DCMAKE_INSTALL_BINDIR=bin" 111 + "-DCMAKE_INSTALL_LIBDIR=lib" 112 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 113 + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 114 + ]; 115 + 116 + postPatch = '' 117 + # We need to not use hipcc and define the CXXFLAGS manually due to `undefined hidden symbol: tensorflow:: ...` 118 + export CXXFLAGS+="--rocm-path=${clr} --rocm-device-lib-path=${rocm-device-libs}/amdgcn/bitcode" 119 + patchShebangs tools 120 + 121 + # `error: '__clang_hip_runtime_wrapper.h' file not found [clang-diagnostic-error]` 122 + substituteInPlace CMakeLists.txt \ 123 + --replace "set(MIGRAPHX_TIDY_ERRORS ALL)" "" 124 + 125 + # JIT library was removed from composable_kernel... 126 + # https://github.com/ROCm/composable_kernel/issues/782 127 + substituteInPlace src/targets/gpu/CMakeLists.txt \ 128 + --replace " COMPONENTS jit_library" "" \ 129 + --replace " composable_kernel::jit_library" "" \ 130 + --replace "if(WIN32)" "if(TRUE)" 131 + '' + lib.optionalString (!buildDocs) '' 132 + substituteInPlace CMakeLists.txt \ 133 + --replace "add_subdirectory(doc)" "" 134 + '' + lib.optionalString (!buildTests) '' 135 + substituteInPlace CMakeLists.txt \ 136 + --replace "add_subdirectory(test)" "" 137 + ''; 138 + 139 + # Unfortunately, it seems like we have to call make on this manually 140 + preInstall = lib.optionalString buildDocs '' 141 + export HOME=$(mktemp -d) 142 + make -j$NIX_BUILD_CORES doc 143 + cd ../doc/pdf 144 + make -j$NIX_BUILD_CORES 145 + cd - 146 + ''; 147 + 148 + postInstall = lib.optionalString buildDocs '' 149 + mv ../doc/html $out/share/doc/migraphx 150 + mv ../doc/pdf/MIGraphX.pdf $out/share/doc/migraphx 151 + '' + lib.optionalString buildTests '' 152 + mkdir -p $test/bin 153 + mv bin/test_* $test/bin 154 + patchelf $test/bin/test_* --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" 155 + ''; 156 + 157 + passthru.updateScript = rocmUpdateScript { 158 + name = finalAttrs.pname; 159 + owner = finalAttrs.src.owner; 160 + repo = finalAttrs.src.repo; 161 + }; 162 + 163 + meta = with lib; { 164 + description = "AMD's graph optimization engine"; 165 + homepage = "https://github.com/ROCm/AMDMIGraphX"; 166 + license = with licenses; [ mit ]; 167 + maintainers = teams.rocm.members; 168 + platforms = platforms.linux; 169 + broken = true; 170 + }; 171 + })
+234
pkgs/development/rocm-modules/6/miopen/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , fetchpatch 5 + , rocmUpdateScript 6 + , runCommand 7 + , pkg-config 8 + , cmake 9 + , rocm-cmake 10 + , rocblas 11 + , rocmlir 12 + , clr 13 + , clang-tools-extra 14 + , clang-ocl 15 + , composable_kernel 16 + , frugally-deep 17 + , rocm-docs-core 18 + , half 19 + , boost 20 + , sqlite 21 + , bzip2 22 + , lbzip2 23 + , nlohmann_json 24 + , texliveSmall 25 + , doxygen 26 + , sphinx 27 + , zlib 28 + , gtest 29 + , rocm-comgr 30 + , roctracer 31 + , python3Packages 32 + , buildDocs ? false # Needs internet because of rocm-docs-core 33 + , buildTests ? false 34 + }: 35 + 36 + let 37 + version = "6.0.2"; 38 + 39 + src = fetchFromGitHub { 40 + owner = "ROCm"; 41 + repo = "MIOpen"; 42 + rev = "rocm-${version}"; 43 + hash = "sha256-mbOdlSb0ESKi9hMkq3amv70Xkp/YKnZYre24d/y5TD0="; 44 + fetchLFS = true; 45 + leaveDotGit = true; 46 + 47 + # If you're reading this, it's gonna take a bit of time. 48 + # fetchSubModules doesn't work with postFetch??? 49 + # fetchLFS isn't actually fetching the LFS files... 50 + postFetch = '' 51 + export HOME=$(mktemp -d) 52 + cd $out 53 + 54 + # We need more history to fetch LFS files 55 + git remote add origin $url 56 + git fetch origin 57 + git clean -fdx 58 + git checkout rocm-${version} 59 + 60 + # We need to do this manually since using leaveDotGit and fetchSubmodules errors 61 + git submodule update --init 62 + 63 + # Fetch the LFS files 64 + git lfs install 65 + git lfs fetch --all 66 + git lfs checkout 67 + 68 + # Remove the defunct .git folder 69 + rm -rf .git 70 + ''; 71 + }; 72 + 73 + latex = lib.optionalAttrs buildDocs (texliveSmall.withPackages (ps: with ps; [ 74 + latexmk 75 + tex-gyre 76 + fncychap 77 + wrapfig 78 + capt-of 79 + framed 80 + needspace 81 + tabulary 82 + varwidth 83 + titlesec 84 + ])); 85 + 86 + gfx900 = runCommand "miopen-gfx900.kdb" { preferLocalBuild = true; } '' 87 + ${lbzip2}/bin/lbzip2 -ckd ${src}/src/kernels/gfx900.kdb.bz2 > $out 88 + ''; 89 + 90 + gfx906 = runCommand "miopen-gfx906.kdb" { preferLocalBuild = true; } '' 91 + ${lbzip2}/bin/lbzip2 -ckd ${src}/src/kernels/gfx906.kdb.bz2 > $out 92 + ''; 93 + 94 + gfx908 = runCommand "miopen-gfx908.kdb" { preferLocalBuild = true; } '' 95 + ${lbzip2}/bin/lbzip2 -ckd ${src}/src/kernels/gfx908.kdb.bz2 > $out 96 + ''; 97 + 98 + gfx90a = runCommand "miopen-gfx90a.kdb" { preferLocalBuild = true; } '' 99 + ${lbzip2}/bin/lbzip2 -ckd ${src}/src/kernels/gfx90a.kdb.bz2 > $out 100 + ''; 101 + 102 + gfx1030 = runCommand "miopen-gfx1030.kdb" { preferLocalBuild = true; } '' 103 + ${lbzip2}/bin/lbzip2 -ckd ${src}/src/kernels/gfx1030.kdb.bz2 > $out 104 + ''; 105 + in stdenv.mkDerivation (finalAttrs: { 106 + inherit version src; 107 + pname = "miopen"; 108 + 109 + # Find zstd and add to target. Mainly for torch. 110 + patches = [ 111 + (fetchpatch { 112 + url = "https://github.com/ROCm/MIOpen/commit/e608b4325646afeabb5e52846997b926d2019d19.patch"; 113 + hash = "sha256-oxa3qlIC2bzbwGxrQOZXoY/S7CpLsMrnWRB7Og0tk0M="; 114 + }) 115 + (fetchpatch { 116 + url = "https://github.com/ROCm/MIOpen/commit/3413d2daaeb44b7d6eadcc03033a5954a118491e.patch"; 117 + hash = "sha256-ST4snUcTmmSI1Ogx815KEX9GdMnmubsavDzXCGJkiKs="; 118 + }) 119 + ]; 120 + 121 + outputs = [ 122 + "out" 123 + ] ++ lib.optionals buildDocs [ 124 + "doc" 125 + ] ++ lib.optionals buildTests [ 126 + "test" 127 + ]; 128 + 129 + nativeBuildInputs = [ 130 + pkg-config 131 + cmake 132 + rocm-cmake 133 + clr 134 + clang-tools-extra 135 + ]; 136 + 137 + buildInputs = [ 138 + rocblas 139 + rocmlir 140 + clang-ocl 141 + composable_kernel 142 + half 143 + boost 144 + sqlite 145 + bzip2 146 + nlohmann_json 147 + frugally-deep 148 + roctracer 149 + ] ++ lib.optionals buildDocs [ 150 + latex 151 + doxygen 152 + sphinx 153 + rocm-docs-core 154 + python3Packages.sphinx-rtd-theme 155 + python3Packages.breathe 156 + python3Packages.myst-parser 157 + ] ++ lib.optionals buildTests [ 158 + zlib 159 + ]; 160 + 161 + cmakeFlags = [ 162 + "-DCMAKE_CXX_FLAGS=-Wno-#warnings" # <half> -> <half/half.hpp> 163 + "-DUNZIPPER=${bzip2}/bin/bunzip2" 164 + # Manually define CMAKE_INSTALL_<DIR> 165 + # See: https://github.com/NixOS/nixpkgs/pull/197838 166 + "-DCMAKE_INSTALL_BINDIR=bin" 167 + "-DCMAKE_INSTALL_LIBDIR=lib" 168 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 169 + "-DCMAKE_C_COMPILER=hipcc" 170 + "-DCMAKE_CXX_COMPILER=hipcc" 171 + "-DMIOPEN_BACKEND=HIP" 172 + ] ++ lib.optionals buildTests [ 173 + "-DBUILD_TESTS=ON" 174 + "-DMIOPEN_TEST_ALL=ON" 175 + ]; 176 + 177 + postPatch = '' 178 + patchShebangs test src/composable_kernel fin utils install_deps.cmake 179 + 180 + substituteInPlace CMakeLists.txt \ 181 + --replace "unpack_db(\"\''${CMAKE_SOURCE_DIR}/src/kernels/\''${FILE_NAME}.kdb.bz2\")" "" \ 182 + --replace "MIOPEN_HIP_COMPILER MATCHES \".*clang\\\\+\\\\+$\"" "true" \ 183 + --replace "set(MIOPEN_TIDY_ERRORS ALL)" "" # error: missing required key 'key' 184 + 185 + substituteInPlace test/gtest/CMakeLists.txt \ 186 + --replace "include(googletest)" "" 187 + 188 + ln -sf ${gfx900} src/kernels/gfx900.kdb 189 + ln -sf ${gfx906} src/kernels/gfx906.kdb 190 + ln -sf ${gfx908} src/kernels/gfx908.kdb 191 + ln -sf ${gfx90a} src/kernels/gfx90a.kdb 192 + ln -sf ${gfx1030} src/kernels/gfx1030.kdb 193 + ''; 194 + 195 + # Unfortunately, it seems like we have to call make on these manually 196 + postBuild = lib.optionalString buildDocs '' 197 + python -m sphinx -T -E -b html -d _build/doctrees -D language=en ../docs _build/html 198 + '' + lib.optionalString buildTests '' 199 + make -j$NIX_BUILD_CORES check 200 + ''; 201 + 202 + postInstall = '' 203 + rm $out/bin/install_precompiled_kernels.sh 204 + ln -sf ${gfx900} $out/share/miopen/db/gfx900.kdb 205 + ln -sf ${gfx906} $out/share/miopen/db/gfx906.kdb 206 + ln -sf ${gfx908} $out/share/miopen/db/gfx908.kdb 207 + ln -sf ${gfx90a} $out/share/miopen/db/gfx90a.kdb 208 + ln -sf ${gfx1030} $out/share/miopen/db/gfx1030.kdb 209 + '' + lib.optionalString buildDocs '' 210 + mv ../doc/html $out/share/doc/miopen-hip 211 + '' + lib.optionalString buildTests '' 212 + mkdir -p $test/bin 213 + mv bin/test_* $test/bin 214 + patchelf --set-rpath $out/lib:${lib.makeLibraryPath (finalAttrs.buildInputs ++ 215 + [ clr rocm-comgr ])} $test/bin/* 216 + ''; 217 + 218 + requiredSystemFeatures = [ "big-parallel" ]; 219 + 220 + passthru.updateScript = rocmUpdateScript { 221 + name = finalAttrs.pname; 222 + owner = finalAttrs.src.owner; 223 + repo = finalAttrs.src.repo; 224 + }; 225 + 226 + meta = with lib; { 227 + description = "Machine intelligence library for ROCm"; 228 + homepage = "https://github.com/ROCm/MIOpen"; 229 + license = with licenses; [ mit ]; 230 + maintainers = teams.rocm.members; 231 + platforms = platforms.linux; 232 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 233 + }; 234 + })
+142
pkgs/development/rocm-modules/6/mivisionx/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocm-device-libs 8 + , clr 9 + , pkg-config 10 + , rpp 11 + , rocblas 12 + , miopen 13 + , migraphx 14 + , clang 15 + , openmp 16 + , protobuf 17 + , qtcreator 18 + , opencv 19 + , ffmpeg 20 + , boost 21 + , libjpeg_turbo 22 + , half 23 + , lmdb 24 + , rapidjson 25 + , rocm-docs-core 26 + , python3Packages 27 + , useOpenCL ? false 28 + , useCPU ? false 29 + , buildDocs ? false # Needs internet 30 + , gpuTargets ? [ ] 31 + }: 32 + 33 + stdenv.mkDerivation (finalAttrs: { 34 + pname = "mivisionx-" + ( 35 + if (!useOpenCL && !useCPU) then "hip" 36 + else if (!useOpenCL && !useCPU) then "opencl" 37 + else "cpu" 38 + ); 39 + 40 + version = "6.0.2"; 41 + 42 + src = fetchFromGitHub { 43 + owner = "ROCm"; 44 + repo = "MIVisionX"; 45 + rev = "rocm-${finalAttrs.version}"; 46 + hash = "sha256-d32lcJq24MXeIWbNbo6putWaol5kF2io6cz4ZuL+DbE="; 47 + }; 48 + 49 + nativeBuildInputs = [ 50 + cmake 51 + rocm-cmake 52 + clr 53 + pkg-config 54 + ] ++ lib.optionals buildDocs [ 55 + rocm-docs-core 56 + python3Packages.python 57 + ]; 58 + 59 + buildInputs = [ 60 + miopen 61 + migraphx 62 + rpp 63 + rocblas 64 + openmp 65 + half 66 + protobuf 67 + qtcreator 68 + opencv 69 + ffmpeg 70 + boost 71 + libjpeg_turbo 72 + lmdb 73 + rapidjson 74 + python3Packages.pybind11 75 + python3Packages.numpy 76 + python3Packages.torchWithRocm 77 + ]; 78 + 79 + cmakeFlags = [ 80 + "-DROCM_PATH=${clr}" 81 + "-DAMDRPP_PATH=${rpp}" 82 + # Manually define CMAKE_INSTALL_<DIR> 83 + # See: https://github.com/NixOS/nixpkgs/pull/197838 84 + "-DCMAKE_INSTALL_BINDIR=bin" 85 + "-DCMAKE_INSTALL_LIBDIR=lib" 86 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 87 + "-DCMAKE_INSTALL_PREFIX_PYTHON=lib" 88 + # "-DAMD_FP16_SUPPORT=ON" `error: typedef redefinition with different types ('__half' vs 'half_float::half')` 89 + ] ++ lib.optionals (gpuTargets != [ ]) [ 90 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 91 + ] ++ lib.optionals (!useOpenCL && !useCPU) [ 92 + "-DBACKEND=HIP" 93 + ] ++ lib.optionals (useOpenCL && !useCPU) [ 94 + "-DBACKEND=OCL" 95 + ] ++ lib.optionals useCPU [ 96 + "-DBACKEND=CPU" 97 + ]; 98 + 99 + postPatch = '' 100 + # We need to not use hipcc and define the CXXFLAGS manually due to `undefined hidden symbol: tensorflow:: ...` 101 + export CXXFLAGS+="--rocm-path=${clr} --rocm-device-lib-path=${rocm-device-libs}/amdgcn/bitcode" 102 + patchShebangs rocAL/rocAL_pybind/examples 103 + 104 + # Properly find miopen 105 + substituteInPlace amd_openvx_extensions/CMakeLists.txt \ 106 + --replace "miopen PATHS \''${ROCM_PATH} QUIET" "miopen PATHS ${miopen} QUIET" \ 107 + --replace "\''${ROCM_PATH}/include/miopen/config.h" "${miopen}/include/miopen/config.h" 108 + 109 + # Properly find turbojpeg 110 + substituteInPlace amd_openvx/cmake/FindTurboJpeg.cmake \ 111 + --replace "\''${TURBO_JPEG_PATH}/include" "${libjpeg_turbo.dev}/include" \ 112 + --replace "\''${TURBO_JPEG_PATH}/lib" "${libjpeg_turbo.out}/lib" 113 + 114 + # Fix bad paths 115 + substituteInPlace rocAL/rocAL/rocAL_hip/CMakeLists.txt amd_openvx_extensions/amd_nn/nn_hip/CMakeLists.txt amd_openvx/openvx/hipvx/CMakeLists.txt \ 116 + --replace "COMPILER_FOR_HIP \''${ROCM_PATH}/llvm/bin/clang++" "COMPILER_FOR_HIP ${clang}/bin/clang++" 117 + ''; 118 + 119 + postBuild = lib.optionalString buildDocs '' 120 + python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en ../docs _build/html 121 + ''; 122 + 123 + postInstall = lib.optionalString (!useOpenCL && !useCPU) '' 124 + patchelf $out/lib/rocal_pybind*.so --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" 125 + chmod +x $out/lib/rocal_pybind*.so 126 + ''; 127 + 128 + passthru.updateScript = rocmUpdateScript { 129 + name = finalAttrs.pname; 130 + owner = finalAttrs.src.owner; 131 + repo = finalAttrs.src.repo; 132 + }; 133 + 134 + meta = with lib; { 135 + description = "Set of comprehensive computer vision and machine intelligence libraries, utilities, and applications"; 136 + homepage = "https://github.com/ROCm/MIVisionX"; 137 + license = with licenses; [ mit ]; 138 + maintainers = teams.rocm.members; 139 + platforms = platforms.linux; 140 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 141 + }; 142 + })
+91
pkgs/development/rocm-modules/6/rccl/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocm-smi 8 + , clr 9 + , perl 10 + , hipify 11 + , gtest 12 + , chrpath 13 + , buildTests ? false 14 + , gpuTargets ? [ ] 15 + }: 16 + 17 + stdenv.mkDerivation (finalAttrs: { 18 + pname = "rccl"; 19 + version = "6.0.2"; 20 + 21 + outputs = [ 22 + "out" 23 + ] ++ lib.optionals buildTests [ 24 + "test" 25 + ]; 26 + 27 + src = fetchFromGitHub { 28 + owner = "ROCm"; 29 + repo = "rccl"; 30 + rev = "rocm-${finalAttrs.version}"; 31 + hash = "sha256-Oyml47yGEB7fALxBcDjqFngS38cnI39sDj94/JV7wE0="; 32 + }; 33 + 34 + nativeBuildInputs = [ 35 + cmake 36 + rocm-cmake 37 + clr 38 + perl 39 + hipify 40 + ]; 41 + 42 + buildInputs = [ 43 + rocm-smi 44 + gtest 45 + ] ++ lib.optionals buildTests [ 46 + chrpath 47 + ]; 48 + 49 + cmakeFlags = [ 50 + "-DCMAKE_CXX_COMPILER=hipcc" 51 + "-DBUILD_BFD=OFF" # Can't get it to detect bfd.h 52 + # Manually define CMAKE_INSTALL_<DIR> 53 + # See: https://github.com/NixOS/nixpkgs/pull/197838 54 + "-DCMAKE_INSTALL_BINDIR=bin" 55 + "-DCMAKE_INSTALL_LIBDIR=lib" 56 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 57 + ] ++ lib.optionals (gpuTargets != [ ]) [ 58 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 59 + ] ++ lib.optionals buildTests [ 60 + "-DBUILD_TESTS=ON" 61 + ]; 62 + 63 + postPatch = '' 64 + patchShebangs src tools 65 + 66 + # Really strange behavior, `#!/usr/bin/env perl` should work... 67 + substituteInPlace CMakeLists.txt \ 68 + --replace "\''$ \''${hipify-perl_executable}" "${perl}/bin/perl ${hipify}/bin/hipify-perl" 69 + ''; 70 + 71 + postInstall = lib.optionalString buildTests '' 72 + mkdir -p $test/bin 73 + mv $out/bin/* $test/bin 74 + rmdir $out/bin 75 + ''; 76 + 77 + passthru.updateScript = rocmUpdateScript { 78 + name = finalAttrs.pname; 79 + owner = finalAttrs.src.owner; 80 + repo = finalAttrs.src.repo; 81 + }; 82 + 83 + meta = with lib; { 84 + description = "ROCm communication collectives library"; 85 + homepage = "https://github.com/ROCm/rccl"; 86 + license = with licenses; [ bsd2 bsd3 ]; 87 + maintainers = teams.rocm.members; 88 + platforms = platforms.linux; 89 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 90 + }; 91 + })
+125
pkgs/development/rocm-modules/6/rdc/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-smi 7 + , rocm-runtime 8 + , libcap 9 + , grpc 10 + , protobuf 11 + , openssl 12 + , doxygen 13 + , graphviz 14 + , texliveSmall 15 + , gtest 16 + , buildDocs ? true 17 + , buildTests ? false 18 + }: 19 + 20 + let 21 + latex = lib.optionalAttrs buildDocs (texliveSmall.withPackages (ps: with ps; [ 22 + changepage 23 + latexmk 24 + varwidth 25 + multirow 26 + hanging 27 + adjustbox 28 + collectbox 29 + stackengine 30 + enumitem 31 + alphalph 32 + wasysym 33 + sectsty 34 + tocloft 35 + newunicodechar 36 + etoc 37 + helvetic 38 + wasy 39 + courier 40 + ])); 41 + in stdenv.mkDerivation (finalAttrs: { 42 + pname = "rdc"; 43 + version = "6.0.2"; 44 + 45 + outputs = [ 46 + "out" 47 + ] ++ lib.optionals buildDocs [ 48 + "doc" 49 + ] ++ lib.optionals buildTests [ 50 + "test" 51 + ]; 52 + 53 + src = fetchFromGitHub { 54 + owner = "ROCm"; 55 + repo = "rdc"; 56 + rev = "rocm-${finalAttrs.version}"; 57 + hash = "sha256-QugcajxILmDeQiWG5uAUO41Wut45irg2Ynufgn1bmps="; 58 + }; 59 + 60 + nativeBuildInputs = [ 61 + cmake 62 + protobuf 63 + ] ++ lib.optionals buildDocs [ 64 + doxygen 65 + graphviz 66 + latex 67 + ]; 68 + 69 + buildInputs = [ 70 + rocm-smi 71 + rocm-runtime 72 + libcap 73 + grpc 74 + openssl 75 + ] ++ lib.optionals buildTests [ 76 + gtest 77 + ]; 78 + 79 + cmakeFlags = [ 80 + "-DCMAKE_VERBOSE_MAKEFILE=OFF" 81 + "-DRDC_INSTALL_PREFIX=${placeholder "out"}" 82 + "-DBUILD_ROCRTEST=ON" 83 + "-DRSMI_INC_DIR=${rocm-smi}/include" 84 + "-DRSMI_LIB_DIR=${rocm-smi}/lib" 85 + "-DGRPC_ROOT=${grpc}" 86 + # Manually define CMAKE_INSTALL_<DIR> 87 + # See: https://github.com/NixOS/nixpkgs/pull/197838 88 + "-DCMAKE_INSTALL_BINDIR=bin" 89 + "-DCMAKE_INSTALL_LIBDIR=lib" 90 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 91 + "-DCMAKE_INSTALL_LIBEXECDIR=libexec" 92 + "-DCMAKE_INSTALL_DOCDIR=doc" 93 + ] ++ lib.optionals buildTests [ 94 + "-DBUILD_TESTS=ON" 95 + ]; 96 + 97 + postPatch = '' 98 + substituteInPlace CMakeLists.txt \ 99 + --replace "file(STRINGS /etc/os-release LINUX_DISTRO LIMIT_COUNT 1 REGEX \"NAME=\")" "set(LINUX_DISTRO \"NixOS\")" 100 + ''; 101 + 102 + postInstall = '' 103 + find $out/bin -executable -type f -exec \ 104 + patchelf {} --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" \; 105 + '' + lib.optionalString buildTests '' 106 + mkdir -p $test 107 + mv $out/bin/rdctst_tests $test/bin 108 + ''; 109 + 110 + passthru.updateScript = rocmUpdateScript { 111 + name = finalAttrs.pname; 112 + owner = finalAttrs.src.owner; 113 + repo = finalAttrs.src.repo; 114 + }; 115 + 116 + meta = with lib; { 117 + description = "Simplifies administration and addresses infrastructure challenges in cluster and datacenter environments"; 118 + homepage = "https://github.com/ROCm/rdc"; 119 + license = with licenses; [ mit ]; 120 + maintainers = teams.rocm.members; 121 + platforms = platforms.linux; 122 + # broken = versions.minor finalAttrs.version != versions.minor rocm-smi.version || versionAtLeast finalAttrs.version "7.0.0"; 123 + broken = true; # Too many errors, unsure how to fix 124 + }; 125 + })
+115
pkgs/development/rocm-modules/6/rocalution/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocblas 8 + , rocsparse 9 + , rocprim 10 + , rocrand 11 + , clr 12 + , git 13 + , openmp 14 + , openmpi 15 + , gtest 16 + , buildTests ? false 17 + , buildBenchmarks ? false 18 + , buildSamples ? false 19 + , gpuTargets ? [ ] # gpuTargets = [ "gfx803" "gfx900:xnack-" "gfx906:xnack-" ... ] 20 + }: 21 + 22 + stdenv.mkDerivation (finalAttrs: { 23 + pname = "rocalution"; 24 + version = "6.0.2"; 25 + 26 + outputs = [ 27 + "out" 28 + ] ++ lib.optionals buildTests [ 29 + "test" 30 + ] ++ lib.optionals buildBenchmarks [ 31 + "benchmark" 32 + ] ++ lib.optionals buildSamples [ 33 + "sample" 34 + ]; 35 + 36 + src = fetchFromGitHub { 37 + owner = "ROCm"; 38 + repo = "rocALUTION"; 39 + rev = "rocm-${finalAttrs.version}"; 40 + hash = "sha256-mrN+CI2mqaMi8oKxui7HAIE2qSn50aNaFipkWwYMtbc="; 41 + }; 42 + 43 + nativeBuildInputs = [ 44 + cmake 45 + rocm-cmake 46 + clr 47 + git 48 + ]; 49 + 50 + buildInputs = [ 51 + rocblas 52 + rocsparse 53 + rocprim 54 + rocrand 55 + openmp 56 + openmpi 57 + ] ++ lib.optionals buildTests [ 58 + gtest 59 + ]; 60 + 61 + cmakeFlags = [ 62 + "-DCMAKE_CXX_COMPILER=hipcc" 63 + "-DROCM_PATH=${clr}" 64 + "-DHIP_ROOT_DIR=${clr}" 65 + "-DSUPPORT_HIP=ON" 66 + "-DSUPPORT_OMP=ON" 67 + "-DSUPPORT_MPI=ON" 68 + "-DBUILD_CLIENTS_SAMPLES=${if buildSamples then "ON" else "OFF"}" 69 + # Manually define CMAKE_INSTALL_<DIR> 70 + # See: https://github.com/NixOS/nixpkgs/pull/197838 71 + "-DCMAKE_INSTALL_BINDIR=bin" 72 + "-DCMAKE_INSTALL_LIBDIR=lib" 73 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 74 + ] ++ lib.optionals (gpuTargets != [ ]) [ 75 + "-DAMDGPU_TARGETS=${lib.strings.concatStringsSep ";" gpuTargets}" 76 + ] ++ lib.optionals buildTests [ 77 + "-DBUILD_CLIENTS_TESTS=ON" 78 + ] ++ lib.optionals buildBenchmarks [ 79 + "-DBUILD_CLIENTS_BENCHMARKS=ON" 80 + ]; 81 + 82 + postInstall = lib.optionalString buildTests '' 83 + mkdir -p $test/bin 84 + mv $out/bin/rocalution-test $test/bin 85 + '' + lib.optionalString buildBenchmarks '' 86 + mkdir -p $benchmark/bin 87 + mv $out/bin/rocalution-bench $benchmark/bin 88 + '' + lib.optionalString buildSamples '' 89 + mkdir -p $sample/bin 90 + mv clients/staging/* $sample/bin 91 + rm $sample/bin/rocalution-test || true 92 + rm $sample/bin/rocalution-bench || true 93 + 94 + patchelf --set-rpath \ 95 + $out/lib:${lib.makeLibraryPath (finalAttrs.buildInputs ++ [ clr ])} \ 96 + $sample/bin/* 97 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 98 + rmdir $out/bin 99 + ''; 100 + 101 + passthru.updateScript = rocmUpdateScript { 102 + name = finalAttrs.pname; 103 + owner = finalAttrs.src.owner; 104 + repo = finalAttrs.src.repo; 105 + }; 106 + 107 + meta = with lib; { 108 + description = "Iterative sparse solvers for ROCm"; 109 + homepage = "https://github.com/ROCm/rocALUTION"; 110 + license = with licenses; [ mit ]; 111 + maintainers = teams.rocm.members; 112 + platforms = platforms.linux; 113 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 114 + }; 115 + })
+209
pkgs/development/rocm-modules/6/rocblas/default.nix
···
··· 1 + { rocblas 2 + , lib 3 + , stdenv 4 + , fetchFromGitHub 5 + , rocmUpdateScript 6 + , runCommand 7 + , cmake 8 + , rocm-cmake 9 + , clr 10 + , python3 11 + , tensile 12 + , msgpack 13 + , libxml2 14 + , gtest 15 + , gfortran 16 + , openmp 17 + , amd-blis 18 + , python3Packages 19 + , buildTensile ? true 20 + , buildTests ? false 21 + , buildBenchmarks ? false 22 + , tensileLogic ? "asm_full" 23 + , tensileCOVersion ? "default" 24 + , tensileSepArch ? true 25 + , tensileLazyLib ? true 26 + , tensileLibFormat ? "msgpack" 27 + , gpuTargets ? [ "all" ] 28 + }: 29 + 30 + let 31 + # NOTE: Update the default GPU targets on every update 32 + gfx80 = (rocblas.override { 33 + gpuTargets = [ 34 + "gfx803" 35 + ]; 36 + }).overrideAttrs { pname = "rocblas-tensile-gfx80"; }; 37 + 38 + gfx90 = (rocblas.override { 39 + gpuTargets = [ 40 + "gfx900" 41 + "gfx906:xnack-" 42 + "gfx908:xnack-" 43 + "gfx90a:xnack+" 44 + "gfx90a:xnack-" 45 + ]; 46 + }).overrideAttrs { pname = "rocblas-tensile-gfx90"; }; 47 + 48 + gfx94 = (rocblas.override { 49 + gpuTargets = [ 50 + "gfx940" 51 + "gfx941" 52 + "gfx942" 53 + ]; 54 + }).overrideAttrs { pname = "rocblas-tensile-gfx94"; }; 55 + 56 + gfx10 = (rocblas.override { 57 + gpuTargets = [ 58 + "gfx1010" 59 + "gfx1012" 60 + "gfx1030" 61 + ]; 62 + }).overrideAttrs { pname = "rocblas-tensile-gfx10"; }; 63 + 64 + gfx11 = (rocblas.override { 65 + gpuTargets = [ 66 + "gfx1100" 67 + "gfx1101" 68 + "gfx1102" 69 + ]; 70 + }).overrideAttrs { pname = "rocblas-tensile-gfx11"; }; 71 + 72 + # Unfortunately, we have to do two full builds, otherwise we get overlapping _fallback.dat files 73 + fallbacks = rocblas.overrideAttrs { pname = "rocblas-tensile-fallbacks"; }; 74 + in stdenv.mkDerivation (finalAttrs: { 75 + pname = "rocblas"; 76 + version = "6.0.2"; 77 + 78 + outputs = [ 79 + "out" 80 + ] ++ lib.optionals buildTests [ 81 + "test" 82 + ] ++ lib.optionals buildBenchmarks [ 83 + "benchmark" 84 + ]; 85 + 86 + src = fetchFromGitHub { 87 + owner = "ROCm"; 88 + repo = "rocBLAS"; 89 + rev = "rocm-${finalAttrs.version}"; 90 + hash = "sha256-G68d/gvBbTdNx8xR3xY+OkBm5Yxq1NFjxby9BbpOcUk="; 91 + }; 92 + 93 + nativeBuildInputs = [ 94 + cmake 95 + rocm-cmake 96 + clr 97 + ]; 98 + 99 + buildInputs = [ 100 + python3 101 + ] ++ lib.optionals buildTensile [ 102 + msgpack 103 + libxml2 104 + python3Packages.msgpack 105 + python3Packages.joblib 106 + ] ++ lib.optionals buildTests [ 107 + gtest 108 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 109 + gfortran 110 + openmp 111 + amd-blis 112 + ] ++ lib.optionals (buildTensile || buildTests || buildBenchmarks) [ 113 + python3Packages.pyyaml 114 + ]; 115 + 116 + cmakeFlags = [ 117 + "-DCMAKE_C_COMPILER=hipcc" 118 + "-DCMAKE_CXX_COMPILER=hipcc" 119 + "-Dpython=python3" 120 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 121 + "-DBUILD_WITH_TENSILE=${if buildTensile then "ON" else "OFF"}" 122 + # Manually define CMAKE_INSTALL_<DIR> 123 + # See: https://github.com/NixOS/nixpkgs/pull/197838 124 + "-DCMAKE_INSTALL_BINDIR=bin" 125 + "-DCMAKE_INSTALL_LIBDIR=lib" 126 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 127 + ] ++ lib.optionals buildTensile [ 128 + "-DVIRTUALENV_HOME_DIR=/build/source/tensile" 129 + "-DTensile_TEST_LOCAL_PATH=/build/source/tensile" 130 + "-DTensile_ROOT=/build/source/tensile/${python3.sitePackages}/Tensile" 131 + "-DTensile_LOGIC=${tensileLogic}" 132 + "-DTensile_CODE_OBJECT_VERSION=${tensileCOVersion}" 133 + "-DTensile_SEPARATE_ARCHITECTURES=${if tensileSepArch then "ON" else "OFF"}" 134 + "-DTensile_LAZY_LIBRARY_LOADING=${if tensileLazyLib then "ON" else "OFF"}" 135 + "-DTensile_LIBRARY_FORMAT=${tensileLibFormat}" 136 + ] ++ lib.optionals buildTests [ 137 + "-DBUILD_CLIENTS_TESTS=ON" 138 + ] ++ lib.optionals buildBenchmarks [ 139 + "-DBUILD_CLIENTS_BENCHMARKS=ON" 140 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 141 + "-DCMAKE_CXX_FLAGS=-I${amd-blis}/include/blis" 142 + ]; 143 + 144 + postPatch = lib.optionalString (finalAttrs.pname != "rocblas") '' 145 + # Return early and install tensile files manually 146 + substituteInPlace library/src/CMakeLists.txt \ 147 + --replace "set_target_properties( TensileHost PROPERTIES OUTPUT_NAME" "return()''\nset_target_properties( TensileHost PROPERTIES OUTPUT_NAME" 148 + '' + lib.optionalString (buildTensile && finalAttrs.pname == "rocblas") '' 149 + # Link the prebuilt Tensile files 150 + mkdir -p build/Tensile/library 151 + 152 + for path in ${gfx80} ${gfx90} ${gfx94} ${gfx10} ${gfx11} ${fallbacks}; do 153 + ln -s $path/lib/rocblas/library/* build/Tensile/library 154 + done 155 + 156 + unlink build/Tensile/library/TensileManifest.txt 157 + '' + lib.optionalString buildTensile '' 158 + # Tensile REALLY wants to write to the nix directory if we include it normally 159 + cp -a ${tensile} tensile 160 + chmod +w -R tensile 161 + 162 + # Rewrap Tensile 163 + substituteInPlace tensile/bin/{.t*,.T*,*} \ 164 + --replace "${tensile}" "/build/source/tensile" 165 + 166 + substituteInPlace CMakeLists.txt \ 167 + --replace "include(virtualenv)" "" \ 168 + --replace "virtualenv_install(\''${Tensile_TEST_LOCAL_PATH})" "" 169 + ''; 170 + 171 + postInstall = lib.optionalString (finalAttrs.pname == "rocblas") '' 172 + ln -sf ${fallbacks}/lib/rocblas/library/TensileManifest.txt $out/lib/rocblas/library 173 + '' + lib.optionalString (finalAttrs.pname != "rocblas") '' 174 + mkdir -p $out/lib/rocblas/library 175 + rm -rf $out/share 176 + '' + lib.optionalString (finalAttrs.pname != "rocblas" && finalAttrs.pname != "rocblas-tensile-fallbacks") '' 177 + rm Tensile/library/{TensileManifest.txt,*_fallback.dat} 178 + mv Tensile/library/* $out/lib/rocblas/library 179 + '' + lib.optionalString (finalAttrs.pname == "rocblas-tensile-fallbacks") '' 180 + mv Tensile/library/{TensileManifest.txt,*_fallback.dat} $out/lib/rocblas/library 181 + '' + lib.optionalString buildTests '' 182 + mkdir -p $test/bin 183 + cp -a $out/bin/* $test/bin 184 + rm $test/bin/*-bench || true 185 + '' + lib.optionalString buildBenchmarks '' 186 + mkdir -p $benchmark/bin 187 + cp -a $out/bin/* $benchmark/bin 188 + rm $benchmark/bin/*-test || true 189 + '' + lib.optionalString (buildTests || buildBenchmarks ) '' 190 + rm -rf $out/bin 191 + ''; 192 + 193 + passthru.updateScript = rocmUpdateScript { 194 + name = finalAttrs.pname; 195 + owner = finalAttrs.src.owner; 196 + repo = finalAttrs.src.repo; 197 + }; 198 + 199 + requiredSystemFeatures = [ "big-parallel" ]; 200 + 201 + meta = with lib; { 202 + description = "BLAS implementation for ROCm platform"; 203 + homepage = "https://github.com/ROCm/rocBLAS"; 204 + license = with licenses; [ mit ]; 205 + maintainers = teams.rocm.members; 206 + platforms = platforms.linux; 207 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 208 + }; 209 + })
+111
pkgs/development/rocm-modules/6/rocdbgapi/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , git 8 + , rocm-comgr 9 + , rocm-runtime 10 + , hwdata 11 + , texliveSmall 12 + , doxygen 13 + , graphviz 14 + , buildDocs ? true 15 + }: 16 + 17 + let 18 + latex = lib.optionalAttrs buildDocs (texliveSmall.withPackages (ps: with ps; [ 19 + changepage 20 + latexmk 21 + varwidth 22 + multirow 23 + hanging 24 + adjustbox 25 + collectbox 26 + stackengine 27 + enumitem 28 + alphalph 29 + wasysym 30 + sectsty 31 + tocloft 32 + newunicodechar 33 + etoc 34 + helvetic 35 + wasy 36 + courier 37 + ])); 38 + in stdenv.mkDerivation (finalAttrs: { 39 + pname = "rocdbgapi"; 40 + version = "6.0.2"; 41 + 42 + outputs = [ 43 + "out" 44 + ] ++ lib.optionals buildDocs [ 45 + "doc" 46 + ]; 47 + 48 + src = fetchFromGitHub { 49 + owner = "ROCm"; 50 + repo = "ROCdbgapi"; 51 + rev = "rocm-${finalAttrs.version}"; 52 + hash = "sha256-+CxaTmxRt/RicqQddqIEHs8vvAPCMKXkWg7kbZvnUsQ="; 53 + }; 54 + 55 + nativeBuildInputs = [ 56 + cmake 57 + rocm-cmake 58 + git 59 + ] ++ lib.optionals buildDocs [ 60 + latex 61 + doxygen 62 + graphviz 63 + ]; 64 + 65 + buildInputs = [ 66 + rocm-comgr 67 + rocm-runtime 68 + hwdata 69 + ]; 70 + 71 + cmakeFlags = [ 72 + "-DPCI_IDS_PATH=${hwdata}/share/hwdata" 73 + # Manually define CMAKE_INSTALL_<DIR> 74 + # See: https://github.com/NixOS/nixpkgs/pull/197838 75 + "-DCMAKE_INSTALL_BINDIR=bin" 76 + "-DCMAKE_INSTALL_LIBDIR=lib" 77 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 78 + ]; 79 + 80 + # Unfortunately, it seems like we have to call make on this manually 81 + postBuild = lib.optionalString buildDocs '' 82 + export HOME=$(mktemp -d) 83 + make -j$NIX_BUILD_CORES doc 84 + ''; 85 + 86 + postInstall = '' 87 + substituteInPlace $out/lib/cmake/amd-dbgapi/amd-dbgapi-config.cmake \ 88 + --replace "/build/source/build/" "" 89 + 90 + substituteInPlace $out/lib/cmake/amd-dbgapi/amd-dbgapi-targets.cmake \ 91 + --replace "/build/source/build" "$out" 92 + '' + lib.optionalString buildDocs '' 93 + mv $out/share/html/amd-dbgapi $doc/share/doc/amd-dbgapi/html 94 + rmdir $out/share/html 95 + ''; 96 + 97 + passthru.updateScript = rocmUpdateScript { 98 + name = finalAttrs.pname; 99 + owner = finalAttrs.src.owner; 100 + repo = finalAttrs.src.repo; 101 + }; 102 + 103 + meta = with lib; { 104 + description = "Debugger support for control of execution and inspection state"; 105 + homepage = "https://github.com/ROCm/ROCdbgapi"; 106 + license = with licenses; [ mit ]; 107 + maintainers = teams.rocm.members; 108 + platforms = platforms.linux; 109 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 110 + }; 111 + })
+169
pkgs/development/rocm-modules/6/rocfft/default.nix
···
··· 1 + { rocfft 2 + , lib 3 + , stdenv 4 + , fetchFromGitHub 5 + , rocmUpdateScript 6 + , cmake 7 + , clr 8 + , python3 9 + , rocm-cmake 10 + , sqlite 11 + , boost 12 + , fftw 13 + , fftwFloat 14 + , gtest 15 + , openmp 16 + , rocrand 17 + , gpuTargets ? [ ] 18 + }: 19 + 20 + stdenv.mkDerivation (finalAttrs: { 21 + pname = "rocfft"; 22 + version = "6.0.2"; 23 + 24 + src = fetchFromGitHub { 25 + owner = "ROCm"; 26 + repo = "rocFFT"; 27 + rev = "rocm-${finalAttrs.version}"; 28 + hash = "sha256-6Gjsy14GeR08VqnNmFhu8EyYDnQ+VZRlg+u9MAAWfHc="; 29 + }; 30 + 31 + nativeBuildInputs = [ 32 + cmake 33 + clr 34 + python3 35 + rocm-cmake 36 + ]; 37 + 38 + buildInputs = [ sqlite ]; 39 + 40 + cmakeFlags = [ 41 + "-DCMAKE_C_COMPILER=hipcc" 42 + "-DCMAKE_CXX_COMPILER=hipcc" 43 + "-DSQLITE_USE_SYSTEM_PACKAGE=ON" 44 + # Manually define CMAKE_INSTALL_<DIR> 45 + # See: https://github.com/NixOS/nixpkgs/pull/197838 46 + "-DCMAKE_INSTALL_BINDIR=bin" 47 + "-DCMAKE_INSTALL_LIBDIR=lib" 48 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 49 + ] ++ lib.optionals (gpuTargets != [ ]) [ 50 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 51 + ]; 52 + 53 + passthru = { 54 + test = stdenv.mkDerivation { 55 + pname = "${finalAttrs.pname}-test"; 56 + inherit (finalAttrs) version src; 57 + 58 + sourceRoot = "${finalAttrs.src.name}/clients/tests"; 59 + 60 + nativeBuildInputs = [ 61 + cmake 62 + clr 63 + rocm-cmake 64 + ]; 65 + 66 + buildInputs = [ 67 + boost 68 + fftw 69 + fftwFloat 70 + finalAttrs.finalPackage 71 + gtest 72 + openmp 73 + rocrand 74 + ]; 75 + 76 + cmakeFlags = [ 77 + "-DCMAKE_C_COMPILER=hipcc" 78 + "-DCMAKE_CXX_COMPILER=hipcc" 79 + ]; 80 + 81 + postInstall = '' 82 + rm -r "$out/lib/fftw" 83 + rmdir "$out/lib" 84 + ''; 85 + }; 86 + 87 + benchmark = stdenv.mkDerivation { 88 + pname = "${finalAttrs.pname}-benchmark"; 89 + inherit (finalAttrs) version src; 90 + 91 + sourceRoot = "${finalAttrs.src.name}/clients/rider"; 92 + 93 + nativeBuildInputs = [ 94 + cmake 95 + clr 96 + rocm-cmake 97 + ]; 98 + 99 + buildInputs = [ 100 + boost 101 + finalAttrs.finalPackage 102 + openmp 103 + (python3.withPackages (ps: with ps; [ 104 + pandas 105 + scipy 106 + ])) 107 + rocrand 108 + ]; 109 + 110 + cmakeFlags = [ 111 + "-DCMAKE_C_COMPILER=hipcc" 112 + "-DCMAKE_CXX_COMPILER=hipcc" 113 + ]; 114 + 115 + postInstall = '' 116 + cp -a ../../../scripts/perf "$out/bin" 117 + ''; 118 + }; 119 + 120 + samples = stdenv.mkDerivation { 121 + pname = "${finalAttrs.pname}-samples"; 122 + inherit (finalAttrs) version src; 123 + 124 + sourceRoot = "${finalAttrs.src.name}/clients/samples"; 125 + 126 + nativeBuildInputs = [ 127 + cmake 128 + clr 129 + rocm-cmake 130 + ]; 131 + 132 + buildInputs = [ 133 + boost 134 + finalAttrs.finalPackage 135 + openmp 136 + rocrand 137 + ]; 138 + 139 + cmakeFlags = [ 140 + "-DCMAKE_C_COMPILER=hipcc" 141 + "-DCMAKE_CXX_COMPILER=hipcc" 142 + ]; 143 + 144 + installPhase = '' 145 + runHook preInstall 146 + mkdir "$out" 147 + cp -a bin "$out" 148 + runHook postInstall 149 + ''; 150 + }; 151 + 152 + updateScript = rocmUpdateScript { 153 + name = finalAttrs.pname; 154 + owner = finalAttrs.src.owner; 155 + repo = finalAttrs.src.repo; 156 + }; 157 + }; 158 + 159 + requiredSystemFeatures = [ "big-parallel" ]; 160 + 161 + meta = with lib; { 162 + description = "FFT implementation for ROCm"; 163 + homepage = "https://github.com/ROCm/rocFFT"; 164 + license = with licenses; [ mit ]; 165 + maintainers = with maintainers; [ kira-bruneau ] ++ teams.rocm.members; 166 + platforms = platforms.linux; 167 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 168 + }; 169 + })
+59
pkgs/development/rocm-modules/6/rocgdb/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , pkg-config 6 + , texinfo 7 + , bison 8 + , flex 9 + , zlib 10 + , elfutils 11 + , gmp 12 + , ncurses 13 + , expat 14 + }: 15 + 16 + stdenv.mkDerivation (finalAttrs: { 17 + pname = "rocgdb"; 18 + version = "6.0.2"; 19 + 20 + src = fetchFromGitHub { 21 + owner = "ROCm"; 22 + repo = "ROCgdb"; 23 + rev = "rocm-${finalAttrs.version}"; 24 + hash = "sha256-XeX/k8gfo9HgcUSIjs35C7IqCmFhvBOqQJSOoPF6HK4="; 25 + }; 26 + 27 + nativeBuildInputs = [ 28 + pkg-config 29 + texinfo # For makeinfo 30 + bison 31 + flex 32 + ]; 33 + 34 + buildInputs = [ 35 + zlib 36 + elfutils 37 + gmp 38 + ncurses 39 + expat 40 + ]; 41 + 42 + # `-Wno-format-nonliteral` doesn't work 43 + env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security"; 44 + 45 + passthru.updateScript = rocmUpdateScript { 46 + name = finalAttrs.pname; 47 + owner = finalAttrs.src.owner; 48 + repo = finalAttrs.src.repo; 49 + }; 50 + 51 + meta = with lib; { 52 + description = "ROCm source-level debugger for Linux, based on GDB"; 53 + homepage = "https://github.com/ROCm/ROCgdb"; 54 + license = with licenses; [ gpl2 gpl3 bsd3 ]; 55 + maintainers = teams.rocm.members; 56 + platforms = platforms.linux; 57 + broken = versionAtLeast finalAttrs.version "7.0.0"; 58 + }; 59 + })
+35
pkgs/development/rocm-modules/6/rocm-cmake/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + }: 7 + 8 + stdenv.mkDerivation (finalAttrs: { 9 + pname = "rocm-cmake"; 10 + version = "6.0.2"; 11 + 12 + src = fetchFromGitHub { 13 + owner = "ROCm"; 14 + repo = "rocm-cmake"; 15 + rev = "rocm-${finalAttrs.version}"; 16 + hash = "sha256-qSjWT0KOQ5oDV06tfnKN+H/JzdoOnR9KY0c+SjvDepM="; 17 + }; 18 + 19 + nativeBuildInputs = [ cmake ]; 20 + 21 + passthru.updateScript = rocmUpdateScript { 22 + name = finalAttrs.pname; 23 + owner = finalAttrs.src.owner; 24 + repo = finalAttrs.src.repo; 25 + }; 26 + 27 + meta = with lib; { 28 + description = "CMake modules for common build tasks for the ROCm stack"; 29 + homepage = "https://github.com/ROCm/rocm-cmake"; 30 + license = licenses.mit; 31 + maintainers = teams.rocm.members; 32 + platforms = platforms.unix; 33 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 34 + }; 35 + })
+55
pkgs/development/rocm-modules/6/rocm-comgr/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocm-device-libs 8 + , libxml2 9 + }: 10 + 11 + let 12 + llvmNativeTarget = 13 + if stdenv.isx86_64 then "X86" 14 + else if stdenv.isAarch64 then "AArch64" 15 + else throw "Unsupported ROCm LLVM platform"; 16 + in stdenv.mkDerivation (finalAttrs: { 17 + pname = "rocm-comgr"; 18 + version = "6.0.2"; 19 + 20 + src = fetchFromGitHub { 21 + owner = "ROCm"; 22 + repo = "ROCm-CompilerSupport"; 23 + rev = "rocm-${finalAttrs.version}"; 24 + hash = "sha256-9HuNU/k+kPJMlzqOTM20gm6SAOWJe9tpAZXEj4erdmI="; 25 + }; 26 + 27 + sourceRoot = "${finalAttrs.src.name}/lib/comgr"; 28 + 29 + nativeBuildInputs = [ 30 + cmake 31 + rocm-cmake 32 + ]; 33 + 34 + buildInputs = [ 35 + rocm-device-libs 36 + libxml2 37 + ]; 38 + 39 + cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;X86" ]; 40 + 41 + passthru.updateScript = rocmUpdateScript { 42 + name = finalAttrs.pname; 43 + owner = finalAttrs.src.owner; 44 + repo = finalAttrs.src.repo; 45 + }; 46 + 47 + meta = with lib; { 48 + description = "APIs for compiling and inspecting AMDGPU code objects"; 49 + homepage = "https://github.com/ROCm/ROCm-CompilerSupport/tree/amd-stg-open/lib/comgr"; 50 + license = licenses.ncsa; 51 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 52 + platforms = platforms.linux; 53 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 54 + }; 55 + })
+38
pkgs/development/rocm-modules/6/rocm-core/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + }: 7 + 8 + stdenv.mkDerivation (finalAttrs: { 9 + pname = "rocm-core"; 10 + version = "6.0.2"; 11 + 12 + src = fetchFromGitHub { 13 + owner = "ROCm"; 14 + repo = "rocm-core"; 15 + rev = "rocm-${finalAttrs.version}"; 16 + hash = "sha256-sgL1UMt3o01zA8v41dyCG1fAsK/PkTRsHQJOvlNatZ4="; 17 + }; 18 + 19 + nativeBuildInputs = [ cmake ]; 20 + cmakeFlags = [ "-DROCM_VERSION=${finalAttrs.version}" ]; 21 + 22 + passthru.updateScript = rocmUpdateScript { 23 + name = finalAttrs.pname; 24 + owner = finalAttrs.src.owner; 25 + repo = finalAttrs.src.repo; 26 + page = "tags?per_page=1"; 27 + filter = ".[0].name | split(\"-\") | .[1]"; 28 + }; 29 + 30 + meta = with lib; { 31 + description = "Utility for getting the ROCm release version"; 32 + homepage = "https://github.com/ROCm/rocm-core"; 33 + license = with licenses; [ mit ]; 34 + maintainers = teams.rocm.members; 35 + platforms = platforms.linux; 36 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 37 + }; 38 + })
+43
pkgs/development/rocm-modules/6/rocm-device-libs/cmake.patch
···
··· 1 + diff --git a/cmake/Packages.cmake b/cmake/Packages.cmake 2 + index 07c60eb..c736b3e 100644 3 + --- a/cmake/Packages.cmake 4 + +++ b/cmake/Packages.cmake 5 + @@ -12,24 +12,29 @@ set_target_properties(${target} PROPERTIES 6 + IMPORTED_LOCATION \"${target_path}\")") 7 + endforeach() 8 + configure_file(AMDDeviceLibsConfig.cmake.in 9 + - ${PACKAGE_PREFIX}/AMDDeviceLibsConfig.cmake 10 + + lib/cmake/AMDDeviceLibs/AMDDeviceLibsConfig.cmake 11 + @ONLY) 12 + 13 + 14 + set(install_path_suffix "amdgcn/bitcode") 15 + 16 + # Generate the install-tree package. 17 + -# We do not know the absolute path to the intall tree until we are installed, 18 + -# so we calculate it dynamically in AMD_DEVICE_LIBS_PREFIX_CODE and use 19 + -# relative paths in the target imports in AMD_DEVICE_LIBS_TARGET_CODE. 20 + -set(AMD_DEVICE_LIBS_PREFIX_CODE " 21 + +if(IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}") 22 + + set(AMD_DEVICE_LIBS_PREFIX_CODE "set(AMD_DEVICE_LIBS_PREFIX \"${CMAKE_INSTALL_PREFIX}\")") 23 + +else() 24 + + # We do not know the absolute path to the install tree until we are installed, 25 + + # so we calculate it dynamically in AMD_DEVICE_LIBS_PREFIX_CODE and use 26 + + # relative paths in the target imports in AMD_DEVICE_LIBS_TARGET_CODE. 27 + + set(AMD_DEVICE_LIBS_PREFIX_CODE " 28 + # Derive absolute install prefix from config file path. 29 + get_filename_component(AMD_DEVICE_LIBS_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)") 30 + -string(REGEX REPLACE "/" ";" count "${PACKAGE_PREFIX}") 31 + -foreach(p ${count}) 32 + - set(AMD_DEVICE_LIBS_PREFIX_CODE "${AMD_DEVICE_LIBS_PREFIX_CODE} 33 + + string(REGEX REPLACE "/" ";" count "${PACKAGE_PREFIX}") 34 + + foreach(p ${count}) 35 + + set(AMD_DEVICE_LIBS_PREFIX_CODE "${AMD_DEVICE_LIBS_PREFIX_CODE} 36 + get_filename_component(AMD_DEVICE_LIBS_PREFIX \"\${AMD_DEVICE_LIBS_PREFIX}\" PATH)") 37 + -endforeach() 38 + + endforeach() 39 + +endif() 40 + + 41 + set(AMD_DEVICE_LIBS_TARGET_CODE) 42 + foreach(target ${AMDGCN_LIB_LIST}) 43 + get_target_property(target_name ${target} ARCHIVE_OUTPUT_NAME)
+50
pkgs/development/rocm-modules/6/rocm-device-libs/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , libxml2 8 + }: 9 + 10 + let 11 + llvmNativeTarget = 12 + if stdenv.isx86_64 then "X86" 13 + else if stdenv.isAarch64 then "AArch64" 14 + else throw "Unsupported ROCm LLVM platform"; 15 + in stdenv.mkDerivation (finalAttrs: { 16 + pname = "rocm-device-libs"; 17 + version = "6.0.2"; 18 + 19 + src = fetchFromGitHub { 20 + owner = "ROCm"; 21 + repo = "ROCm-Device-Libs"; 22 + rev = "rocm-${finalAttrs.version}"; 23 + hash = "sha256-7XG7oSkJ3EPWTYGea0I50eB1/DPMD5agmjctxZYTbLQ="; 24 + }; 25 + 26 + patches = [ ./cmake.patch ]; 27 + 28 + nativeBuildInputs = [ 29 + cmake 30 + rocm-cmake 31 + ]; 32 + 33 + buildInputs = [ libxml2 ]; 34 + cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" ]; 35 + 36 + passthru.updateScript = rocmUpdateScript { 37 + name = finalAttrs.pname; 38 + owner = finalAttrs.src.owner; 39 + repo = finalAttrs.src.repo; 40 + }; 41 + 42 + meta = with lib; { 43 + description = "Set of AMD-specific device-side language runtime libraries"; 44 + homepage = "https://github.com/ROCm/ROCm-Device-Libs"; 45 + license = licenses.ncsa; 46 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 47 + platforms = platforms.linux; 48 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 49 + }; 50 + })
+66
pkgs/development/rocm-modules/6/rocm-docs-core/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , gitUpdater 5 + , buildPythonPackage 6 + , setuptools 7 + , beautifulsoup4 8 + , gitpython 9 + , pydata-sphinx-theme 10 + , pygithub 11 + , sphinx 12 + , breathe 13 + , myst-parser 14 + , sphinx-book-theme 15 + , sphinx-copybutton 16 + , sphinx-design 17 + , sphinx-external-toc 18 + , sphinx-notfound-page 19 + , pyyaml 20 + , fastjsonschema 21 + }: 22 + 23 + # FIXME: Move to rocmPackages_common 24 + buildPythonPackage rec { 25 + pname = "rocm-docs-core"; 26 + version = "0.34.0"; 27 + format = "pyproject"; 28 + 29 + src = fetchFromGitHub { 30 + owner = "ROCm"; 31 + repo = "rocm-docs-core"; 32 + rev = "v${version}"; 33 + hash = "sha256-p75g68Dn0RrjX9vYY+AWNu0qOKTLsBCnOZekMO0Usho="; 34 + }; 35 + 36 + buildInputs = [ setuptools ]; 37 + 38 + propagatedBuildInputs = [ 39 + beautifulsoup4 40 + gitpython 41 + pydata-sphinx-theme 42 + pygithub 43 + sphinx 44 + breathe 45 + myst-parser 46 + sphinx-book-theme 47 + sphinx-copybutton 48 + sphinx-design 49 + sphinx-external-toc 50 + sphinx-notfound-page 51 + pyyaml 52 + fastjsonschema 53 + ]; 54 + 55 + pythonImportsCheck = [ "rocm_docs" ]; 56 + 57 + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; 58 + 59 + meta = with lib; { 60 + description = "ROCm Documentation Python package for ReadTheDocs build standardization"; 61 + homepage = "https://github.com/ROCm/rocm-docs-core"; 62 + license = with licenses; [ mit cc-by-40 ]; 63 + maintainers = teams.rocm.members; 64 + platforms = platforms.linux; 65 + }; 66 + }
+74
pkgs/development/rocm-modules/6/rocm-runtime/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , pkg-config 6 + , cmake 7 + , xxd 8 + , rocm-device-libs 9 + , rocm-thunk 10 + , libelf 11 + , libdrm 12 + , numactl 13 + , valgrind 14 + , libxml2 15 + }: 16 + 17 + stdenv.mkDerivation (finalAttrs: { 18 + pname = "rocm-runtime"; 19 + version = "6.0.2"; 20 + 21 + src = fetchFromGitHub { 22 + owner = "ROCm"; 23 + repo = "ROCR-Runtime"; 24 + rev = "rocm-${finalAttrs.version}"; 25 + hash = "sha256-xNMG954HI9SOfvYYB/62fhmm9mmR4I10uHP2nqn9EgI="; 26 + }; 27 + 28 + sourceRoot = "${finalAttrs.src.name}/src"; 29 + 30 + nativeBuildInputs = [ 31 + pkg-config 32 + cmake 33 + xxd 34 + ]; 35 + 36 + buildInputs = [ 37 + rocm-thunk 38 + libelf 39 + libdrm 40 + numactl 41 + valgrind 42 + libxml2 43 + ]; 44 + 45 + postPatch = '' 46 + patchShebangs image/blit_src/create_hsaco_ascii_file.sh 47 + patchShebangs core/runtime/trap_handler/create_trap_handler_header.sh 48 + patchShebangs core/runtime/blit_shaders/create_blit_shader_header.sh 49 + 50 + substituteInPlace CMakeLists.txt \ 51 + --replace 'hsa/include/hsa' 'include/hsa' 52 + 53 + # We compile clang before rocm-device-libs, so patch it in afterwards 54 + # Replace object version: https://github.com/ROCm/ROCR-Runtime/issues/166 (TODO: Remove on LLVM update?) 55 + substituteInPlace image/blit_src/CMakeLists.txt \ 56 + --replace '-cl-denorms-are-zero' '-cl-denorms-are-zero --rocm-device-lib-path=${rocm-device-libs}/amdgcn/bitcode' \ 57 + --replace '-mcode-object-version=4' '-mcode-object-version=5' 58 + ''; 59 + 60 + passthru.updateScript = rocmUpdateScript { 61 + name = finalAttrs.pname; 62 + owner = finalAttrs.src.owner; 63 + repo = finalAttrs.src.repo; 64 + }; 65 + 66 + meta = with lib; { 67 + description = "Platform runtime for ROCm"; 68 + homepage = "https://github.com/ROCm/ROCR-Runtime"; 69 + license = with licenses; [ ncsa ]; 70 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 71 + platforms = platforms.linux; 72 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 73 + }; 74 + })
+89
pkgs/development/rocm-modules/6/rocm-smi/cmake.patch
···
··· 1 + diff --git a/rocm_smi-backward-compat.cmake b/rocm_smi-backward-compat.cmake 2 + index aa8fd9c..59afce5 100644 3 + --- a/rocm_smi-backward-compat.cmake 4 + +++ b/rocm_smi-backward-compat.cmake 5 + @@ -72,7 +72,12 @@ function(generate_wrapper_header) 6 + set(include_guard "${include_guard}COMGR_WRAPPER_INCLUDE_${INC_GAURD_NAME}_H") 7 + #set #include statement 8 + get_filename_component(file_name ${header_file} NAME) 9 + - set(include_statements "${include_statements}#include \"../../../${CMAKE_INSTALL_INCLUDEDIR}/${ROCM_SMI}/${file_name}\"\n") 10 + + if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR}) 11 + + set(include_dir "${CMAKE_INSTALL_INCLUDEDIR}") 12 + + else() 13 + + set(include_dir "../../../${CMAKE_INSTALL_INCLUDEDIR}") 14 + + endif() 15 + + set(include_statements "${include_statements}#include \"${include_dir}/${ROCM_SMI}/${file_name}\"\n") 16 + configure_file(${RSMI_WRAPPER_DIR}/header.hpp.in ${RSMI_WRAPPER_INC_DIR}/${file_name}) 17 + unset(include_guard) 18 + unset(include_statements) 19 + @@ -90,7 +95,12 @@ function(generate_wrapper_header) 20 + set(include_guard "${include_guard}COMGR_WRAPPER_INCLUDE_${INC_GAURD_NAME}_H") 21 + #set #include statement 22 + get_filename_component(file_name ${header_file} NAME) 23 + - set(include_statements "${include_statements}#include \"../../../${CMAKE_INSTALL_INCLUDEDIR}/${OAM_TARGET_NAME}/${file_name}\"\n") 24 + + if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR}) 25 + + set(include_dir "${CMAKE_INSTALL_INCLUDEDIR}") 26 + + else() 27 + + set(include_dir "../../../${CMAKE_INSTALL_INCLUDEDIR}") 28 + + endif() 29 + + set(include_statements "${include_statements}#include \"${include_dir}/${OAM_TARGET_NAME}/${file_name}\"\n") 30 + configure_file(${RSMI_WRAPPER_DIR}/header.hpp.in ${OAM_WRAPPER_INC_DIR}/${file_name}) 31 + unset(include_guard) 32 + unset(include_statements) 33 + @@ -123,11 +133,16 @@ function(create_library_symlink) 34 + set(library_files "${LIB_RSMI}") 35 + endif() 36 + 37 + + if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) 38 + + set(install_libdir "${CMAKE_INSTALL_LIBDIR}") 39 + + else() 40 + + set(install_libdir "../../${CMAKE_INSTALL_LIBDIR}") 41 + + endif() 42 + foreach(file_name ${library_files}) 43 + add_custom_target(link_${file_name} ALL 44 + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 45 + COMMAND ${CMAKE_COMMAND} -E create_symlink 46 + - ../../${CMAKE_INSTALL_LIBDIR}/${file_name} ${RSMI_WRAPPER_LIB_DIR}/${file_name}) 47 + + ${install_libdir}/${file_name} ${RSMI_WRAPPER_LIB_DIR}/${file_name}) 48 + endforeach() 49 + 50 + file(MAKE_DIRECTORY ${OAM_WRAPPER_LIB_DIR}) 51 + @@ -151,11 +166,16 @@ function(create_library_symlink) 52 + set(library_files "${LIB_OAM}") 53 + endif() 54 + 55 + + if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) 56 + + set(install_libdir "${CMAKE_INSTALL_LIBDIR}") 57 + + else() 58 + + set(install_libdir "../../${CMAKE_INSTALL_LIBDIR}") 59 + + endif() 60 + foreach(file_name ${library_files}) 61 + add_custom_target(link_${file_name} ALL 62 + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 63 + COMMAND ${CMAKE_COMMAND} -E create_symlink 64 + - ../../${CMAKE_INSTALL_LIBDIR}/${file_name} ${OAM_WRAPPER_LIB_DIR}/${file_name}) 65 + + ${install_libdir}/${file_name} ${OAM_WRAPPER_LIB_DIR}/${file_name}) 66 + endforeach() 67 + 68 + endfunction() 69 + diff --git a/rocm_smi/CMakeLists.txt b/rocm_smi/CMakeLists.txt 70 + index c594eeb..d3ed39d 100755 71 + --- a/rocm_smi/CMakeLists.txt 72 + +++ b/rocm_smi/CMakeLists.txt 73 + @@ -105,10 +105,15 @@ endif () 74 + #file reorganization changes 75 + #rocm_smi.py moved to libexec/rocm_smi. so creating rocm-smi symlink 76 + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) 77 + +if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBEXECDIR}) 78 + + set(install_libexecdir "${CMAKE_INSTALL_LIBEXECDIR}") 79 + +else() 80 + + set(install_libexecdir "../${CMAKE_INSTALL_LIBEXECDIR}") 81 + +endif() 82 + add_custom_target(link-rocm-smi ALL 83 + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 84 + COMMAND ${CMAKE_COMMAND} -E create_symlink 85 + - ../${CMAKE_INSTALL_LIBEXECDIR}/${ROCM_SMI}/rocm_smi.py ${CMAKE_CURRENT_BINARY_DIR}/bin/rocm-smi) 86 + + ${install_libexecdir}/${ROCM_SMI}/rocm_smi.py ${CMAKE_CURRENT_BINARY_DIR}/bin/rocm-smi) 87 + 88 + ## Add the install directives for the runtime library. 89 + install(TARGETS ${ROCM_SMI_TARGET}
+54
pkgs/development/rocm-modules/6/rocm-smi/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , wrapPython 7 + }: 8 + 9 + stdenv.mkDerivation (finalAttrs: { 10 + pname = "rocm-smi"; 11 + version = "6.0.2"; 12 + 13 + src = fetchFromGitHub { 14 + owner = "ROCm"; 15 + repo = "rocm_smi_lib"; 16 + rev = "rocm-${finalAttrs.version}"; 17 + hash = "sha256-fS52hpTv1WEycwkGZLXjz383WJWzyk8RvJRshEQSG/A="; 18 + }; 19 + 20 + patches = [ ./cmake.patch ]; 21 + 22 + nativeBuildInputs = [ 23 + cmake 24 + wrapPython 25 + ]; 26 + 27 + cmakeFlags = [ 28 + # Manually define CMAKE_INSTALL_<DIR> 29 + # See: https://github.com/NixOS/nixpkgs/pull/197838 30 + "-DCMAKE_INSTALL_BINDIR=bin" 31 + "-DCMAKE_INSTALL_LIBDIR=lib" 32 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 33 + ]; 34 + 35 + postInstall = '' 36 + wrapPythonProgramsIn $out 37 + mv $out/libexec/rocm_smi/.rsmiBindings.py-wrapped $out/libexec/rocm_smi/rsmiBindings.py 38 + ''; 39 + 40 + passthru.updateScript = rocmUpdateScript { 41 + name = finalAttrs.pname; 42 + owner = finalAttrs.src.owner; 43 + repo = finalAttrs.src.repo; 44 + }; 45 + 46 + meta = with lib; { 47 + description = "System management interface for AMD GPUs supported by ROCm"; 48 + homepage = "https://github.com/ROCm/rocm_smi_lib"; 49 + license = with licenses; [ mit ]; 50 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 51 + platforms = [ "x86_64-linux" ]; 52 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 53 + }; 54 + })
+54
pkgs/development/rocm-modules/6/rocm-thunk/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , pkg-config 6 + , cmake 7 + , libdrm 8 + , numactl 9 + }: 10 + 11 + stdenv.mkDerivation (finalAttrs: { 12 + pname = "rocm-thunk"; 13 + version = "6.0.2"; 14 + 15 + src = fetchFromGitHub { 16 + owner = "ROCm"; 17 + repo = "ROCT-Thunk-Interface"; 18 + rev = "rocm-${finalAttrs.version}"; 19 + hash = "sha256-F6Qi+A9DuSx2e4WSfp4cnniKr0CkCZcZqsKwQmmZHhk="; 20 + }; 21 + 22 + nativeBuildInputs = [ 23 + pkg-config 24 + cmake 25 + ]; 26 + 27 + buildInputs = [ 28 + libdrm 29 + numactl 30 + ]; 31 + 32 + cmakeFlags = [ 33 + # Manually define CMAKE_INSTALL_<DIR> 34 + # See: https://github.com/NixOS/nixpkgs/pull/197838 35 + "-DCMAKE_INSTALL_BINDIR=bin" 36 + "-DCMAKE_INSTALL_LIBDIR=lib" 37 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 38 + ]; 39 + 40 + passthru.updateScript = rocmUpdateScript { 41 + name = finalAttrs.pname; 42 + owner = finalAttrs.src.owner; 43 + repo = finalAttrs.src.repo; 44 + }; 45 + 46 + meta = with lib; { 47 + description = "Radeon open compute thunk interface"; 48 + homepage = "https://github.com/ROCm/ROCT-Thunk-Interface"; 49 + license = with licenses; [ bsd2 mit ]; 50 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 51 + platforms = platforms.linux; 52 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 53 + }; 54 + })
+63
pkgs/development/rocm-modules/6/rocminfo/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocm-runtime 8 + , busybox 9 + , python3 10 + , gnugrep 11 + # rocminfo requires that the calling user have a password and be in 12 + # the video group. If we let rocm_agent_enumerator rely upon 13 + # rocminfo's output, then it, too, has those requirements. Instead, 14 + # we can specify the GPU targets for this system (e.g. "gfx803" for 15 + # Polaris) such that no system call is needed for downstream 16 + # compilers to determine the desired target. 17 + , defaultTargets ? [] 18 + }: 19 + 20 + stdenv.mkDerivation (finalAttrs: { 21 + version = "6.0.2"; 22 + pname = "rocminfo"; 23 + 24 + src = fetchFromGitHub { 25 + owner = "ROCm"; 26 + repo = "rocminfo"; 27 + rev = "rocm-${finalAttrs.version}"; 28 + sha256 = "sha256-k0QeCyQcarGbAh4ft8Y7JBK6l2nWxDUc20XoYmtrMMs="; 29 + }; 30 + 31 + nativeBuildInputs = [ 32 + cmake 33 + rocm-cmake 34 + ]; 35 + 36 + buildInputs = [ rocm-runtime ]; 37 + propagatedBuildInputs = [ python3 ]; 38 + cmakeFlags = [ "-DROCRTST_BLD_TYPE=Release" ]; 39 + 40 + prePatch = '' 41 + patchShebangs rocm_agent_enumerator 42 + sed 's,lsmod | grep ,${busybox}/bin/lsmod | ${gnugrep}/bin/grep ,' -i rocminfo.cc 43 + ''; 44 + 45 + postInstall = lib.optionalString (defaultTargets != [ ]) '' 46 + echo '${lib.concatStringsSep "\n" defaultTargets}' > $out/bin/target.lst 47 + ''; 48 + 49 + passthru.updateScript = rocmUpdateScript { 50 + name = finalAttrs.pname; 51 + owner = finalAttrs.src.owner; 52 + repo = finalAttrs.src.repo; 53 + }; 54 + 55 + meta = with lib; { 56 + description = "ROCm Application for Reporting System Info"; 57 + homepage = "https://github.com/ROCm/rocminfo"; 58 + license = licenses.ncsa; 59 + maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members; 60 + platforms = platforms.linux; 61 + broken = stdenv.isAarch64 || versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 62 + }; 63 + })
+136
pkgs/development/rocm-modules/6/rocmlir/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocminfo 8 + , ninja 9 + , clr 10 + , git 11 + , libxml2 12 + , libedit 13 + , zstd 14 + , zlib 15 + , ncurses 16 + , python3Packages 17 + , buildRockCompiler ? false 18 + , buildTests ? false # `argument of type 'NoneType' is not iterable` 19 + }: 20 + 21 + # Theoretically, we could have our MLIR have an output 22 + # with the source and built objects so that we can just 23 + # use it as the external LLVM repo for this 24 + let 25 + suffix = 26 + if buildRockCompiler 27 + then "-rock" 28 + else ""; 29 + 30 + llvmNativeTarget = 31 + if stdenv.isx86_64 then "X86" 32 + else if stdenv.isAarch64 then "AArch64" 33 + else throw "Unsupported ROCm LLVM platform"; 34 + in stdenv.mkDerivation (finalAttrs: { 35 + pname = "rocmlir${suffix}"; 36 + version = "6.0.2"; 37 + 38 + outputs = [ 39 + "out" 40 + ] ++ lib.optionals (!buildRockCompiler) [ 41 + "external" 42 + ]; 43 + 44 + src = fetchFromGitHub { 45 + owner = "ROCm"; 46 + repo = "rocMLIR"; 47 + rev = "rocm-${finalAttrs.version}"; 48 + hash = "sha256-AypY0vL8Ij1zLycwpG2EPWWl4utp4ejXpAK0Jj/UvrA="; 49 + }; 50 + 51 + nativeBuildInputs = [ 52 + cmake 53 + rocm-cmake 54 + ninja 55 + clr 56 + python3Packages.python 57 + python3Packages.tomli 58 + ]; 59 + 60 + buildInputs = [ 61 + git 62 + libxml2 63 + libedit 64 + ]; 65 + 66 + propagatedBuildInputs = [ 67 + zstd 68 + zlib 69 + ncurses 70 + ]; 71 + 72 + cmakeFlags = [ 73 + "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" 74 + "-DLLVM_ENABLE_ZSTD=ON" 75 + "-DLLVM_ENABLE_ZLIB=ON" 76 + "-DLLVM_ENABLE_TERMINFO=ON" 77 + "-DROCM_PATH=${clr}" 78 + # Manually define CMAKE_INSTALL_<DIR> 79 + # See: https://github.com/NixOS/nixpkgs/pull/197838 80 + "-DCMAKE_INSTALL_BINDIR=bin" 81 + "-DCMAKE_INSTALL_LIBDIR=lib" 82 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 83 + ] ++ lib.optionals buildRockCompiler [ 84 + "-DBUILD_FAT_LIBROCKCOMPILER=ON" 85 + ] ++ lib.optionals (!buildRockCompiler) [ 86 + "-DROCM_TEST_CHIPSET=gfx000" 87 + ]; 88 + 89 + postPatch = '' 90 + patchShebangs mlir 91 + patchShebangs external/llvm-project/mlir/lib/Dialect/GPU/AmdDeviceLibsIncGen.py 92 + 93 + # remove when no longer required 94 + substituteInPlace mlir/test/{e2e/generateE2ETest.py,fusion/e2e/generate-fusion-tests.py} \ 95 + --replace-fail "\"/opt/rocm/bin" "\"${rocminfo}/bin" 96 + 97 + substituteInPlace mlir/utils/performance/common/CMakeLists.txt \ 98 + --replace-fail "/opt/rocm" "${clr}" 99 + ''; 100 + 101 + dontBuild = true; 102 + doCheck = true; 103 + 104 + # Certain libs aren't being generated, try enabling tests next update 105 + checkTarget = if buildRockCompiler 106 + then "librockCompiler" 107 + else if buildTests 108 + then "check-rocmlir" 109 + else "check-rocmlir-build-only"; 110 + 111 + postInstall = let 112 + libPath = lib.makeLibraryPath [ zstd zlib ncurses clr stdenv.cc.cc ]; 113 + in lib.optionals (!buildRockCompiler) '' 114 + mkdir -p $external/lib 115 + cp -a external/llvm-project/llvm/lib/{*.a*,*.so*} $external/lib 116 + patchelf --set-rpath $external/lib:$out/lib:${libPath} $external/lib/*.so* 117 + patchelf --set-rpath $out/lib:$external/lib:${libPath} $out/{bin/*,lib/*.so*} 118 + ''; 119 + 120 + passthru.updateScript = rocmUpdateScript { 121 + name = finalAttrs.pname; 122 + owner = finalAttrs.src.owner; 123 + repo = finalAttrs.src.repo; 124 + page = "tags?per_page=2"; 125 + filter = ".[1].name | split(\"-\") | .[1]"; 126 + }; 127 + 128 + meta = with lib; { 129 + description = "MLIR-based convolution and GEMM kernel generator"; 130 + homepage = "https://github.com/ROCm/rocMLIR"; 131 + license = with licenses; [ asl20 ]; 132 + maintainers = teams.rocm.members; 133 + platforms = platforms.linux; 134 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 135 + }; 136 + })
+86
pkgs/development/rocm-modules/6/rocprim/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , clr 8 + , gtest 9 + , gbenchmark 10 + , buildTests ? false 11 + , buildBenchmarks ? false 12 + , gpuTargets ? [ ] 13 + }: 14 + 15 + stdenv.mkDerivation (finalAttrs: { 16 + pname = "rocprim"; 17 + version = "6.0.2"; 18 + 19 + outputs = [ 20 + "out" 21 + ] ++ lib.optionals buildTests [ 22 + "test" 23 + ] ++ lib.optionals buildBenchmarks [ 24 + "benchmark" 25 + ]; 26 + 27 + src = fetchFromGitHub { 28 + owner = "ROCm"; 29 + repo = "rocPRIM"; 30 + rev = "rocm-${finalAttrs.version}"; 31 + hash = "sha256-nWvq26qRPZ6Au1rc5cR74TKArcdUFg7O9djFi8SvMeM="; 32 + }; 33 + 34 + nativeBuildInputs = [ 35 + cmake 36 + rocm-cmake 37 + clr 38 + ]; 39 + 40 + buildInputs = lib.optionals buildTests [ 41 + gtest 42 + ] ++ lib.optionals buildBenchmarks [ 43 + gbenchmark 44 + ]; 45 + 46 + cmakeFlags = [ 47 + "-DCMAKE_CXX_COMPILER=hipcc" 48 + # Manually define CMAKE_INSTALL_<DIR> 49 + # See: https://github.com/NixOS/nixpkgs/pull/197838 50 + "-DCMAKE_INSTALL_BINDIR=bin" 51 + "-DCMAKE_INSTALL_LIBDIR=lib" 52 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 53 + ] ++ lib.optionals (gpuTargets != [ ]) [ 54 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 55 + ] ++ lib.optionals buildTests [ 56 + "-DBUILD_TEST=ON" 57 + ] ++ lib.optionals buildBenchmarks [ 58 + "-DBUILD_BENCHMARK=ON" 59 + ]; 60 + 61 + postInstall = lib.optionalString buildTests '' 62 + mkdir -p $test/bin 63 + mv $out/bin/test_* $test/bin 64 + mv $out/bin/rocprim $test/bin 65 + '' + lib.optionalString buildBenchmarks '' 66 + mkdir -p $benchmark/bin 67 + mv $out/bin/benchmark_* $benchmark/bin 68 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 69 + rmdir $out/bin 70 + ''; 71 + 72 + passthru.updateScript = rocmUpdateScript { 73 + name = finalAttrs.pname; 74 + owner = finalAttrs.src.owner; 75 + repo = finalAttrs.src.repo; 76 + }; 77 + 78 + meta = with lib; { 79 + description = "ROCm parallel primitives"; 80 + homepage = "https://github.com/ROCm/rocPRIM"; 81 + license = with licenses; [ mit ]; 82 + maintainers = teams.rocm.members; 83 + platforms = platforms.linux; 84 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 85 + }; 86 + })
+15
pkgs/development/rocm-modules/6/rocprofiler/0000-dont-install-tests-hsaco.patch
···
··· 1 + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt 2 + index 46efbd5..ca2cc3b 100644 3 + --- a/test/CMakeLists.txt 4 + +++ b/test/CMakeLists.txt 5 + @@ -127,10 +127,6 @@ function(generate_hsaco TARGET_ID INPUT_FILE OUTPUT_FILE) 6 + DEPENDS ${INPUT_FILE} clang 7 + COMMENT "Building ${OUTPUT_FILE}..." 8 + VERBATIM) 9 + - install( 10 + - FILES ${PROJECT_BINARY_DIR}/${OUTPUT_FILE} 11 + - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1 12 + - COMPONENT tests) 13 + set(HSACO_TARGET_LIST 14 + ${HSACO_TARGET_LIST} ${PROJECT_BINARY_DIR}/${OUTPUT_FILE} 15 + PARENT_SCOPE)
+109
pkgs/development/rocm-modules/6/rocprofiler/0001-fix-shell-scripts.patch
···
··· 1 + diff --git a/bin/rocprofv2 b/bin/rocprofv2 2 + index d0445e7..6079af8 100755 3 + --- a/bin/rocprofv2 4 + +++ b/bin/rocprofv2 5 + @@ -7,7 +7,8 @@ if [ -n "${ROCP_PRELOAD}" ]; then LD_PRELOAD="${ROCP_PRELOAD}"; fi 6 + 7 + CURRENT_DIR="$( dirname -- "$0"; )"; 8 + ROCPROFV2_DIR=$(dirname -- $(realpath ${BASH_SOURCE[0]})); 9 + -ROCM_DIR=$( dirname -- "$ROCPROFV2_DIR"; ) 10 + +ROCPROFILER_DIR=$( dirname -- "$ROCPROFV2_DIR"; ) 11 + +ROCM_DIR=@rocmtoolkit_merged@ 12 + PLUGIN_LIST=("ctf" "perfetto" "file" "att" "cli") 13 + RUN_FROM_BUILD=0 14 + if [[ $ROCPROFV2_DIR == *"/build"* ]]; then 15 + @@ -15,7 +16,7 @@ if [[ $ROCPROFV2_DIR == *"/build"* ]]; then 16 + ROCM_DIR=$ROCPROFV2_DIR 17 + fi 18 + 19 + -export ROCPROFILER_METRICS_PATH=$ROCM_DIR/libexec/rocprofiler/counters/derived_counters.xml 20 + +export ROCPROFILER_METRICS_PATH=$ROCPROFILER_DIR/libexec/rocprofiler/counters/derived_counters.xml 21 + export LD_LIBRARY_PATH=$ROCM_DIR/lib:$LD_LIBRARY_PATH 22 + 23 + # Define color code 24 + @@ -83,7 +84,7 @@ while [ 1 ]; do 25 + exit 1 26 + fi 27 + elif [[ "$1" == "--list-counters" ]]; then 28 + - export LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so 29 + + export LD_PRELOAD=$LD_PRELOAD:$ROC_DIR/lib/rocprofiler/librocprofiler_tool.so 30 + eval $ROCM_DIR/libexec/rocprofiler/ctrl 31 + exit 1 32 + elif [[ "$1" == "-i" || "$1" == "--input" ]]; then 33 + @@ -221,7 +222,7 @@ while [ 1 ]; do 34 + if [ $RUN_FROM_BUILD == 1 ]; then 35 + ATT_PATH=$ROCM_DIR/plugin/att/att/att.py 36 + else 37 + - ATT_PATH=$ROCM_DIR/libexec/rocprofiler/att/att.py 38 + + ATT_PATH=$ROCPROFILER_DIR/libexec/rocprofiler/att/att.py 39 + export ROCPROFV2_ATT_LIB_PATH=$ROCM_DIR/lib/hsa-amd-aqlprofile/librocprofv2_att.so 40 + fi 41 + ATT_ARGV=$3 42 + @@ -294,13 +295,13 @@ if [ -n "$PMC_LINES" ] && [ ! -n "$ATT_ARGV" ]; then 43 + export OUTPUT_PATH=$FINAL_PATH 44 + fi 45 + let COUNTER=COUNTER+1 46 + - LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so $* 47 + + LD_PRELOAD=$LD_PRELOAD:$ROCPROFILER_DIR/lib/rocprofiler/librocprofiler_tool.so $* 48 + if [ -n "$OUTPUT_PATH" ]; then 49 + echo -e "\nThe output path for the following counters: $OUTPUT_PATH" 50 + fi 51 + done 52 + else 53 + - LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so $* 54 + + LD_PRELOAD=$LD_PRELOAD:$ROCPROFILER_DIR/lib/rocprofiler/librocprofiler_tool.so $* 55 + fi 56 + 57 + get_pmc_results_txt_path() { 58 + diff --git a/bin/rpl_run.sh b/bin/rpl_run.sh 59 + index 6b236ed..a9c233c 100755 60 + --- a/bin/rpl_run.sh 61 + +++ b/bin/rpl_run.sh 62 + @@ -25,16 +25,17 @@ 63 + ROCPROF_ARGS="$*" 64 + time_stamp=`date +%y%m%d_%H%M%S` 65 + BIN_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) 66 + -ROOT_DIR=$(dirname $BIN_DIR) 67 + +ROCPROFILER_DIR=$(dirname $BIN_DIR) 68 + +ROOT_DIR=@rocmtoolkit_merged@ 69 + RUN_DIR=`pwd` 70 + TMP_DIR="/tmp" 71 + DATA_DIR="rpl_data_${time_stamp}_$$" 72 + 73 + -RPL_PATH=$ROOT_DIR/lib 74 + +RPL_PATH=$ROCPROFILER_DIR/lib 75 + TLIB_PATH=$RPL_PATH/rocprofiler 76 + TTLIB_PATH=$ROOT_DIR/lib/roctracer 77 + ROCM_LIB_PATH=$ROOT_DIR/lib 78 + -PROF_BIN_DIR=$ROOT_DIR/libexec/rocprofiler 79 + +PROF_BIN_DIR=$ROCPROFILER_DIR/libexec/rocprofiler 80 + 81 + # check if rocprof is supportd on this gpu arch 82 + V1_SUPPORTED_GPU_ARCHS=("gfx80x","gfx90x","gfx10xx","gfx94x") 83 + @@ -80,7 +81,7 @@ unset ROCP_PROXY_QUEUE 84 + # Disable AQL-profile read API 85 + export AQLPROFILE_READ_API=0 86 + # ROC Profiler package path 87 + -export ROCP_PACKAGE_DIR=$ROOT_DIR 88 + +export ROCP_PACKAGE_DIR=$ROCPROFILER_DIR 89 + # enabled SPM KFD mode 90 + export ROCP_SPM_KFD_MODE=1 91 + 92 + @@ -400,7 +401,7 @@ unset_v1_envs() { 93 + 94 + ################################################################################################ 95 + # main 96 + -echo "RPL: on '$time_stamp' from '$ROOT_DIR' in '$RUN_DIR'" 97 + +echo "RPL: on '$time_stamp' from '$ROCPROFILER_DIR' in '$RUN_DIR'" 98 + # Parsing arguments 99 + if [ -z "$1" ] ; then 100 + usage 101 + @@ -633,7 +634,7 @@ elif [ "$input_type" = "txt" -o "$input_type" = "none" ] ; then 102 + else 103 + echo "<metric></metric>" > $RES_DIR/input.xml 104 + fi 105 + - input_list=`/bin/ls $RES_DIR/input*.xml` 106 + + input_list=`ls $RES_DIR/input*.xml` 107 + export ROCPROFILER_SESS=$RES_DIR 108 + else 109 + fatal "Bad input file type '$INPUT_FILE'"
+12
pkgs/development/rocm-modules/6/rocprofiler/0002-include-stdint-in-version.patch
···
··· 1 + diff --git a/src/tools/versioning/version.cpp b/src/tools/versioning/version.cpp 2 + index 11bdd00..339743c 100644 3 + --- a/src/tools/versioning/version.cpp 4 + +++ b/src/tools/versioning/version.cpp 5 + @@ -1,6 +1,7 @@ 6 + #include <rocm-core/rocm_version.h> 7 + #include <iostream> 8 + #include <sstream> 9 + +#include <stdint.h> 10 + 11 + 12 + int main() {
+140
pkgs/development/rocm-modules/6/rocprofiler/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , symlinkJoin 6 + , substituteAll 7 + , cmake 8 + , clang 9 + , clr 10 + , rocm-core 11 + , rocm-thunk 12 + , rocm-device-libs 13 + , roctracer 14 + , rocdbgapi 15 + , rocm-smi 16 + , hsa-amd-aqlprofile-bin 17 + , numactl 18 + , libpciaccess 19 + , libxml2 20 + , elfutils 21 + , mpi 22 + , systemd 23 + , gtest 24 + , python3Packages 25 + , gpuTargets ? clr.gpuTargets 26 + }: 27 + 28 + let 29 + rocmtoolkit-merged = symlinkJoin { 30 + name = "rocmtoolkit-merged"; 31 + 32 + paths = [ 33 + rocm-core 34 + rocm-thunk 35 + rocm-device-libs 36 + roctracer 37 + rocdbgapi 38 + rocm-smi 39 + hsa-amd-aqlprofile-bin 40 + clr 41 + ]; 42 + 43 + postBuild = '' 44 + rm -rf $out/nix-support 45 + ''; 46 + }; 47 + in stdenv.mkDerivation (finalAttrs: { 48 + pname = "rocprofiler"; 49 + version = "6.0.2"; 50 + 51 + src = fetchFromGitHub { 52 + owner = "ROCm"; 53 + repo = "rocprofiler"; 54 + rev = "rocm-${finalAttrs.version}"; 55 + hash = "sha256-yzgw9g5cHAZpdbU44+1ScZyUcZ2I4GGfjbm9GSqCClk="; 56 + }; 57 + 58 + patches = [ 59 + # These just simply won't build 60 + ./0000-dont-install-tests-hsaco.patch 61 + 62 + # Fix bad paths 63 + (substituteAll { 64 + src = ./0001-fix-shell-scripts.patch; 65 + rocmtoolkit_merged = rocmtoolkit-merged; 66 + }) 67 + 68 + # Fix for missing uint32_t not defined 69 + ./0002-include-stdint-in-version.patch 70 + ]; 71 + 72 + nativeBuildInputs = [ 73 + cmake 74 + clang 75 + clr 76 + python3Packages.lxml 77 + python3Packages.cppheaderparser 78 + python3Packages.pyyaml 79 + python3Packages.barectf 80 + python3Packages.pandas 81 + ]; 82 + 83 + buildInputs = [ 84 + numactl 85 + libpciaccess 86 + libxml2 87 + elfutils 88 + mpi 89 + systemd 90 + gtest 91 + ]; 92 + 93 + propagatedBuildInputs = [ rocmtoolkit-merged ]; 94 + 95 + cmakeFlags = [ 96 + "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip" 97 + "-DHIP_ROOT_DIR=${clr}" 98 + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 99 + # Manually define CMAKE_INSTALL_<DIR> 100 + # See: https://github.com/NixOS/nixpkgs/pull/197838 101 + "-DCMAKE_INSTALL_BINDIR=bin" 102 + "-DCMAKE_INSTALL_LIBDIR=lib" 103 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 104 + ]; 105 + 106 + postPatch = '' 107 + patchShebangs . 108 + 109 + substituteInPlace tests-v2/featuretests/profiler/CMakeLists.txt \ 110 + --replace "--build-id=sha1" "--build-id=sha1 --rocm-path=${clr} --rocm-device-lib-path=${rocm-device-libs}/amdgcn/bitcode" 111 + 112 + substituteInPlace test/CMakeLists.txt \ 113 + --replace "\''${ROCM_ROOT_DIR}/amdgcn/bitcode" "${rocm-device-libs}/amdgcn/bitcode" 114 + ''; 115 + 116 + postInstall = '' 117 + # Why do these not already have the executable bit set? 118 + chmod +x $out/lib/rocprofiler/librocprof-tool.so 119 + chmod +x $out/share/rocprofiler/tests-v1/test/ocl/SimpleConvolution 120 + 121 + # Why do these have the executable bit set? 122 + chmod -x $out/libexec/rocprofiler/counters/basic_counters.xml 123 + chmod -x $out/libexec/rocprofiler/counters/derived_counters.xml 124 + ''; 125 + 126 + passthru.updateScript = rocmUpdateScript { 127 + name = finalAttrs.pname; 128 + owner = finalAttrs.src.owner; 129 + repo = finalAttrs.src.repo; 130 + }; 131 + 132 + meta = with lib; { 133 + description = "Profiling with perf-counters and derived metrics"; 134 + homepage = "https://github.com/ROCm/rocprofiler"; 135 + license = with licenses; [ mit ]; # mitx11 136 + maintainers = teams.rocm.members; 137 + platforms = platforms.linux; 138 + broken = versions.minor finalAttrs.version != versions.minor clr.version || versionAtLeast finalAttrs.version "7.0.0"; 139 + }; 140 + })
+59
pkgs/development/rocm-modules/6/rocr-debug-agent/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , clr 7 + , git 8 + , rocdbgapi 9 + , elfutils 10 + }: 11 + 12 + stdenv.mkDerivation (finalAttrs: { 13 + pname = "rocr-debug-agent"; 14 + version = "6.0.2"; 15 + 16 + src = fetchFromGitHub { 17 + owner = "ROCm"; 18 + repo = "rocr_debug_agent"; 19 + rev = "rocm-${finalAttrs.version}"; 20 + hash = "sha256-8Q800T7mwBy8/rujVNyCQ0ZpZ9uPKKk+Sv9ibpWou/8="; 21 + }; 22 + 23 + nativeBuildInputs = [ 24 + cmake 25 + clr 26 + git 27 + ]; 28 + 29 + buildInputs = [ 30 + rocdbgapi 31 + elfutils 32 + ]; 33 + 34 + cmakeFlags = [ 35 + "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip" 36 + "-DHIP_ROOT_DIR=${clr}" 37 + "-DHIP_PATH=${clr}" 38 + ]; 39 + 40 + # Weird install target 41 + postInstall = '' 42 + rm -rf $out/src 43 + ''; 44 + 45 + passthru.updateScript = rocmUpdateScript { 46 + name = finalAttrs.pname; 47 + owner = finalAttrs.src.owner; 48 + repo = finalAttrs.src.repo; 49 + }; 50 + 51 + meta = with lib; { 52 + description = "Library that provides some debugging functionality for ROCr"; 53 + homepage = "https://github.com/ROCm/rocr_debug_agent"; 54 + license = with licenses; [ ncsa ]; 55 + maintainers = teams.rocm.members; 56 + platforms = platforms.linux; 57 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 58 + }; 59 + })
+88
pkgs/development/rocm-modules/6/rocrand/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , clr 8 + , gtest 9 + , gbenchmark 10 + , buildTests ? false 11 + , buildBenchmarks ? false 12 + , gpuTargets ? [ ] 13 + }: 14 + 15 + stdenv.mkDerivation (finalAttrs: { 16 + pname = "rocrand"; 17 + version = "6.0.2"; 18 + 19 + outputs = [ 20 + "out" 21 + ] ++ lib.optionals buildTests [ 22 + "test" 23 + ] ++ lib.optionals buildBenchmarks [ 24 + "benchmark" 25 + ]; 26 + 27 + src = fetchFromGitHub { 28 + owner = "ROCm"; 29 + repo = "rocRAND"; 30 + rev = "rocm-${finalAttrs.version}"; 31 + hash = "sha256-BBkcYOP+zh3OQTxuSkeiJizwnE9Gr5Jbhx0e8SU/mmU="; 32 + fetchSubmodules = true; # For inline hipRAND 33 + }; 34 + 35 + nativeBuildInputs = [ 36 + cmake 37 + rocm-cmake 38 + clr 39 + ]; 40 + 41 + buildInputs = lib.optionals buildTests [ 42 + gtest 43 + ] ++ lib.optionals buildBenchmarks [ 44 + gbenchmark 45 + ]; 46 + 47 + cmakeFlags = [ 48 + "-DCMAKE_C_COMPILER=hipcc" 49 + "-DCMAKE_CXX_COMPILER=hipcc" 50 + "-DHIP_ROOT_DIR=${clr}" 51 + # Manually define CMAKE_INSTALL_<DIR> 52 + # See: https://github.com/NixOS/nixpkgs/pull/197838 53 + "-DCMAKE_INSTALL_BINDIR=bin" 54 + "-DCMAKE_INSTALL_LIBDIR=lib" 55 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 56 + ] ++ lib.optionals (gpuTargets != [ ]) [ 57 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 58 + ] ++ lib.optionals buildTests [ 59 + "-DBUILD_TEST=ON" 60 + ] ++ lib.optionals buildBenchmarks [ 61 + "-DBUILD_BENCHMARK=ON" 62 + ]; 63 + 64 + postInstall = lib.optionalString buildTests '' 65 + mkdir -p $test/bin 66 + mv $out/bin/test_* $test/bin 67 + '' + lib.optionalString buildBenchmarks '' 68 + mkdir -p $benchmark/bin 69 + mv $out/bin/benchmark_* $benchmark/bin 70 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 71 + rmdir $out/bin 72 + ''; 73 + 74 + passthru.updateScript = rocmUpdateScript { 75 + name = finalAttrs.pname; 76 + owner = finalAttrs.src.owner; 77 + repo = finalAttrs.src.repo; 78 + }; 79 + 80 + meta = with lib; { 81 + description = "Generate pseudo-random and quasi-random numbers"; 82 + homepage = "https://github.com/ROCm/rocRAND"; 83 + license = with licenses; [ mit ]; 84 + maintainers = teams.rocm.members; 85 + platforms = platforms.linux; 86 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 87 + }; 88 + })
+100
pkgs/development/rocm-modules/6/rocsolver/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocblas 8 + , rocsparse 9 + , clr 10 + , fmt 11 + , gtest 12 + , gfortran 13 + , lapack-reference 14 + , buildTests ? false 15 + , buildBenchmarks ? false 16 + , gpuTargets ? [ ] # gpuTargets = [ "gfx803" "gfx900" "gfx906:xnack-" ] 17 + }: 18 + 19 + stdenv.mkDerivation (finalAttrs: { 20 + pname = "rocsolver"; 21 + version = "6.0.2"; 22 + 23 + outputs = [ 24 + "out" 25 + ] ++ lib.optionals buildTests [ 26 + "test" 27 + ] ++ lib.optionals buildBenchmarks [ 28 + "benchmark" 29 + ]; 30 + 31 + src = fetchFromGitHub { 32 + owner = "ROCm"; 33 + repo = "rocSOLVER"; 34 + rev = "rocm-${finalAttrs.version}"; 35 + hash = "sha256-tglQpwCSFABRuEDiJrzQVFIdx9p85E2MiUYN0aoTAXo="; 36 + }; 37 + 38 + nativeBuildInputs = [ 39 + cmake 40 + rocm-cmake 41 + clr 42 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 43 + gfortran 44 + ]; 45 + 46 + buildInputs = [ 47 + rocblas 48 + rocsparse 49 + fmt 50 + ] ++ lib.optionals buildTests [ 51 + gtest 52 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 53 + lapack-reference 54 + ]; 55 + 56 + cmakeFlags = [ 57 + "-DCMAKE_CXX_COMPILER=hipcc" 58 + "-DCMAKE_CXX_FLAGS=-Wno-switch" # Way too many warnings 59 + # Manually define CMAKE_INSTALL_<DIR> 60 + # See: https://github.com/NixOS/nixpkgs/pull/197838 61 + "-DCMAKE_INSTALL_BINDIR=bin" 62 + "-DCMAKE_INSTALL_LIBDIR=lib" 63 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 64 + ] ++ lib.optionals (gpuTargets != [ ]) [ 65 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 66 + ] ++ lib.optionals buildTests [ 67 + "-DBUILD_CLIENTS_TESTS=ON" 68 + ] ++ lib.optionals buildBenchmarks [ 69 + "-DBUILD_CLIENTS_BENCHMARKS=ON" 70 + ]; 71 + 72 + postInstall = lib.optionalString buildTests '' 73 + mkdir -p $test/bin 74 + mv $out/bin/rocsolver-test $test/bin 75 + '' + lib.optionalString buildBenchmarks '' 76 + mkdir -p $benchmark/bin 77 + mv $out/bin/rocsolver-bench $benchmark/bin 78 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 79 + rmdir $out/bin 80 + ''; 81 + 82 + passthru.updateScript = rocmUpdateScript { 83 + name = finalAttrs.pname; 84 + owner = finalAttrs.src.owner; 85 + repo = finalAttrs.src.repo; 86 + }; 87 + 88 + requiredSystemFeatures = [ "big-parallel" ]; 89 + 90 + meta = with lib; { 91 + description = "ROCm LAPACK implementation"; 92 + homepage = "https://github.com/ROCm/rocSOLVER"; 93 + license = with licenses; [ bsd2 ]; 94 + maintainers = teams.rocm.members; 95 + platforms = platforms.linux; 96 + timeout = 14400; # 4 hours 97 + maxSilent = 14400; # 4 hours 98 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 99 + }; 100 + })
+149
pkgs/development/rocm-modules/6/rocsparse/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , fetchzip 5 + , rocmUpdateScript 6 + , cmake 7 + , rocm-cmake 8 + , rocprim 9 + , clr 10 + , gfortran 11 + , git 12 + , gtest 13 + , boost 14 + , python3Packages 15 + , buildTests ? false 16 + , buildBenchmarks ? false # Seems to depend on tests 17 + , gpuTargets ? [ ] 18 + }: 19 + 20 + stdenv.mkDerivation (finalAttrs: { 21 + pname = "rocsparse"; 22 + version = "6.0.2"; 23 + 24 + outputs = [ 25 + "out" 26 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 27 + "test" 28 + ] ++ lib.optionals buildBenchmarks [ 29 + "benchmark" 30 + ]; 31 + 32 + src = fetchFromGitHub { 33 + owner = "ROCm"; 34 + repo = "rocSPARSE"; 35 + rev = "rocm-${finalAttrs.version}"; 36 + hash = "sha256-nTYnEHkTtq0jBeMj4HXpqkJu8LQc+Z6mpjhMP7tJAHQ="; 37 + }; 38 + 39 + nativeBuildInputs = [ 40 + cmake 41 + rocm-cmake 42 + clr 43 + gfortran 44 + ]; 45 + 46 + buildInputs = [ 47 + rocprim 48 + git 49 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 50 + gtest 51 + boost 52 + python3Packages.python 53 + python3Packages.pyyaml 54 + ]; 55 + 56 + cmakeFlags = [ 57 + "-DCMAKE_CXX_COMPILER=hipcc" 58 + # Manually define CMAKE_INSTALL_<DIR> 59 + # See: https://github.com/NixOS/nixpkgs/pull/197838 60 + "-DCMAKE_INSTALL_BINDIR=bin" 61 + "-DCMAKE_INSTALL_LIBDIR=lib" 62 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 63 + ] ++ lib.optionals (gpuTargets != [ ]) [ 64 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 65 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 66 + "-DBUILD_CLIENTS_TESTS=ON" 67 + "-DCMAKE_MATRICES_DIR=/build/source/matrices" 68 + "-Dpython=python3" 69 + ] ++ lib.optionals buildBenchmarks [ 70 + "-DBUILD_CLIENTS_BENCHMARKS=ON" 71 + ]; 72 + 73 + # We have to manually generate the matrices 74 + postPatch = lib.optionalString (buildTests || buildBenchmarks) '' 75 + mkdir -p matrices 76 + 77 + ln -s ${finalAttrs.passthru.matrices.matrix-01}/*.mtx matrices 78 + ln -s ${finalAttrs.passthru.matrices.matrix-02}/*.mtx matrices 79 + ln -s ${finalAttrs.passthru.matrices.matrix-03}/*.mtx matrices 80 + ln -s ${finalAttrs.passthru.matrices.matrix-04}/*.mtx matrices 81 + ln -s ${finalAttrs.passthru.matrices.matrix-05}/*.mtx matrices 82 + ln -s ${finalAttrs.passthru.matrices.matrix-06}/*.mtx matrices 83 + ln -s ${finalAttrs.passthru.matrices.matrix-07}/*.mtx matrices 84 + ln -s ${finalAttrs.passthru.matrices.matrix-08}/*.mtx matrices 85 + ln -s ${finalAttrs.passthru.matrices.matrix-09}/*.mtx matrices 86 + ln -s ${finalAttrs.passthru.matrices.matrix-10}/*.mtx matrices 87 + ln -s ${finalAttrs.passthru.matrices.matrix-11}/*.mtx matrices 88 + ln -s ${finalAttrs.passthru.matrices.matrix-12}/*.mtx matrices 89 + ln -s ${finalAttrs.passthru.matrices.matrix-13}/*.mtx matrices 90 + ln -s ${finalAttrs.passthru.matrices.matrix-14}/*.mtx matrices 91 + ln -s ${finalAttrs.passthru.matrices.matrix-15}/*.mtx matrices 92 + ln -s ${finalAttrs.passthru.matrices.matrix-16}/*.mtx matrices 93 + ln -s ${finalAttrs.passthru.matrices.matrix-17}/*.mtx matrices 94 + ln -s ${finalAttrs.passthru.matrices.matrix-18}/*.mtx matrices 95 + ln -s ${finalAttrs.passthru.matrices.matrix-19}/*.mtx matrices 96 + ln -s ${finalAttrs.passthru.matrices.matrix-20}/*.mtx matrices 97 + ln -s ${finalAttrs.passthru.matrices.matrix-21}/*.mtx matrices 98 + ln -s ${finalAttrs.passthru.matrices.matrix-22}/*.mtx matrices 99 + ln -s ${finalAttrs.passthru.matrices.matrix-23}/*.mtx matrices 100 + ln -s ${finalAttrs.passthru.matrices.matrix-24}/*.mtx matrices 101 + 102 + # Not used by the original cmake, causes an error 103 + rm matrices/*_b.mtx 104 + 105 + echo "deps/convert.cpp -> deps/mtx2csr" 106 + hipcc deps/convert.cpp -O3 -o deps/mtx2csr 107 + 108 + for mat in $(ls -1 matrices | cut -d "." -f 1); do 109 + echo "mtx2csr: $mat.mtx -> $mat.csr" 110 + deps/mtx2csr matrices/$mat.mtx matrices/$mat.csr 111 + unlink matrices/$mat.mtx 112 + done 113 + ''; 114 + 115 + postInstall = lib.optionalString buildBenchmarks '' 116 + mkdir -p $benchmark/bin 117 + cp -a $out/bin/* $benchmark/bin 118 + rm $benchmark/bin/rocsparse-test 119 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 120 + mkdir -p $test/bin 121 + mv $out/bin/* $test/bin 122 + rm $test/bin/rocsparse-bench || true 123 + mv /build/source/matrices $test 124 + rmdir $out/bin 125 + ''; 126 + 127 + passthru = { 128 + matrices = import ./deps.nix { 129 + inherit fetchzip; 130 + mirror1 = "https://sparse.tamu.edu/MM"; 131 + mirror2 = "https://www.cise.ufl.edu/research/sparse/MM"; 132 + }; 133 + 134 + updateScript = rocmUpdateScript { 135 + name = finalAttrs.pname; 136 + owner = finalAttrs.src.owner; 137 + repo = finalAttrs.src.repo; 138 + }; 139 + }; 140 + 141 + meta = with lib; { 142 + description = "ROCm SPARSE implementation"; 143 + homepage = "https://github.com/ROCm/rocSPARSE"; 144 + license = with licenses; [ mit ]; 145 + maintainers = teams.rocm.members; 146 + platforms = platforms.linux; 147 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 148 + }; 149 + })
+222
pkgs/development/rocm-modules/6/rocsparse/deps.nix
···
··· 1 + { fetchzip 2 + , mirror1 3 + , mirror2 4 + }: 5 + 6 + { 7 + matrix-01 = fetchzip { 8 + sha256 = "sha256-AHur5ZIDZTFRrO2GV0ieXrffq4KUiGWiZ59pv0fUtEQ="; 9 + 10 + urls = [ 11 + "${mirror1}/SNAP/amazon0312.tar.gz" 12 + "${mirror2}/SNAP/amazon0312.tar.gz" 13 + ]; 14 + }; 15 + 16 + matrix-02 = fetchzip { 17 + sha256 = "sha256-0rSxaN4lQcdaCLsvlgicG70FXUxXeERPiEmQ4MzbRdE="; 18 + 19 + urls = [ 20 + "${mirror1}/Muite/Chebyshev4.tar.gz" 21 + "${mirror2}/Muite/Chebyshev4.tar.gz" 22 + ]; 23 + }; 24 + 25 + matrix-03 = fetchzip { 26 + sha256 = "sha256-hDzDWDUnHEyFedX/tMNq83ZH8uWyM4xtZYUUAD3rizo="; 27 + 28 + urls = [ 29 + "${mirror1}/FEMLAB/sme3Dc.tar.gz" 30 + "${mirror2}/FEMLAB/sme3Dc.tar.gz" 31 + ]; 32 + }; 33 + 34 + matrix-04 = fetchzip { 35 + sha256 = "sha256-GmN2yOt/MoX01rKe05aTyB3ypUP4YbQGOITZ0BqPmC0="; 36 + 37 + urls = [ 38 + "${mirror1}/Williams/webbase-1M.tar.gz" 39 + "${mirror2}/Williams/webbase-1M.tar.gz" 40 + ]; 41 + }; 42 + 43 + matrix-05 = fetchzip { 44 + sha256 = "sha256-gQNjfVyWzNM9RwImJGhkhahRmZz74LzDs1oijL7mI7k="; 45 + 46 + urls = [ 47 + "${mirror1}/Williams/mac_econ_fwd500.tar.gz" 48 + "${mirror2}/Williams/mac_econ_fwd500.tar.gz" 49 + ]; 50 + }; 51 + 52 + matrix-06 = fetchzip { 53 + sha256 = "sha256-87cdZjntNcTuz5BtO59irhcuRbPllWSbhCEX3Td02qc="; 54 + 55 + urls = [ 56 + "${mirror1}/Williams/mc2depi.tar.gz" 57 + "${mirror2}/Williams/mc2depi.tar.gz" 58 + ]; 59 + }; 60 + 61 + matrix-07 = fetchzip { 62 + sha256 = "sha256-WRamuJX3D8Tm+k0q67RjUDG3DeNAxhKiaPkk5afY5eU="; 63 + 64 + urls = [ 65 + "${mirror1}/Bova/rma10.tar.gz" 66 + "${mirror2}/Bova/rma10.tar.gz" 67 + ]; 68 + }; 69 + 70 + matrix-08 = fetchzip { 71 + sha256 = "sha256-5dhkm293Mc3lzakKxHy5W5XIn4Rw+gihVh7gyrjEHXo="; 72 + 73 + urls = [ 74 + "${mirror1}/JGD_BIBD/bibd_22_8.tar.gz" 75 + "${mirror2}/JGD_BIBD/bibd_22_8.tar.gz" 76 + ]; 77 + }; 78 + 79 + matrix-09 = fetchzip { 80 + sha256 = "sha256-czjLWCjXAjZCk5TGYHaEkwSAzQu3TQ3QyB6eNKR4G88="; 81 + 82 + urls = [ 83 + "${mirror1}/Hamm/scircuit.tar.gz" 84 + "${mirror2}/Hamm/scircuit.tar.gz" 85 + ]; 86 + }; 87 + 88 + matrix-10 = fetchzip { 89 + sha256 = "sha256-bYuLnJViAIcIejAkh69/bsNAVIDU4wfTLtD+nmHd6FM="; 90 + 91 + urls = [ 92 + "${mirror1}/Sandia/ASIC_320k.tar.gz" 93 + "${mirror2}/Sandia/ASIC_320k.tar.gz" 94 + ]; 95 + }; 96 + 97 + matrix-11 = fetchzip { 98 + sha256 = "sha256-aDwn8P1khYjo2Agbq5m9ZBInJUxf/knJNvyptt0fak0="; 99 + 100 + urls = [ 101 + "${mirror1}/GHS_psdef/bmwcra_1.tar.gz" 102 + "${mirror2}/GHS_psdef/bmwcra_1.tar.gz" 103 + ]; 104 + }; 105 + 106 + matrix-12 = fetchzip { 107 + sha256 = "sha256-8OJqA/byhlAZd869TPUzZFdsOiwOoRGfKyhM+RMjXoY="; 108 + 109 + urls = [ 110 + "${mirror1}/HB/nos1.tar.gz" 111 + "${mirror2}/HB/nos1.tar.gz" 112 + ]; 113 + }; 114 + 115 + matrix-13 = fetchzip { 116 + sha256 = "sha256-FS0rKqmg+uHwsM/yGfQLBdd7LH/rUrdutkNGBD/Mh1I="; 117 + 118 + urls = [ 119 + "${mirror1}/HB/nos2.tar.gz" 120 + "${mirror2}/HB/nos2.tar.gz" 121 + ]; 122 + }; 123 + 124 + matrix-14 = fetchzip { 125 + sha256 = "sha256-DANnlrNJikrI7Pst9vRedtbuxepyHmCIu2yhltc4Qcs="; 126 + 127 + urls = [ 128 + "${mirror1}/HB/nos3.tar.gz" 129 + "${mirror2}/HB/nos3.tar.gz" 130 + ]; 131 + }; 132 + 133 + matrix-15 = fetchzip { 134 + sha256 = "sha256-21mUgqjWGUfYgiWwSrKh9vH8Vdt3xzcefmqYNYRpxiY="; 135 + 136 + urls = [ 137 + "${mirror1}/HB/nos4.tar.gz" 138 + "${mirror2}/HB/nos4.tar.gz" 139 + ]; 140 + }; 141 + 142 + matrix-16 = fetchzip { 143 + sha256 = "sha256-FOuXvGqBBFNkVS6cexmkluret54hCfCOdK+DOZllE4c="; 144 + 145 + urls = [ 146 + "${mirror1}/HB/nos5.tar.gz" 147 + "${mirror2}/HB/nos5.tar.gz" 148 + ]; 149 + }; 150 + 151 + matrix-17 = fetchzip { 152 + sha256 = "sha256-+7NI1rA/qQxYPpjXKHvAaCZ+LSaAJ4xuJvMRMBEUYxg="; 153 + 154 + urls = [ 155 + "${mirror1}/HB/nos6.tar.gz" 156 + "${mirror2}/HB/nos6.tar.gz" 157 + ]; 158 + }; 159 + 160 + matrix-18 = fetchzip { 161 + sha256 = "sha256-q3NxJjbwGGcFiQ9nhWfUKgZmdVwCfPmgQoqy0AqOsNc="; 162 + 163 + urls = [ 164 + "${mirror1}/HB/nos7.tar.gz" 165 + "${mirror2}/HB/nos7.tar.gz" 166 + ]; 167 + }; 168 + 169 + matrix-19 = fetchzip { 170 + sha256 = "sha256-0GAN6qmVfD+tprIigzuUUUwm5KVhkN9X65wMEvFltDY="; 171 + 172 + urls = [ 173 + "${mirror1}/DNVS/shipsec1.tar.gz" 174 + "${mirror2}/DNVS/shipsec1.tar.gz" 175 + ]; 176 + }; 177 + 178 + matrix-20 = fetchzip { 179 + sha256 = "sha256-f28Du/Urxsiq5NkRmRO10Zz9vvGRjEchquzHzbZpZ7U="; 180 + 181 + urls = [ 182 + "${mirror1}/Cote/mplate.tar.gz" 183 + "${mirror2}/Cote/mplate.tar.gz" 184 + ]; 185 + }; 186 + 187 + matrix-21 = fetchzip { 188 + sha256 = "sha256-O+Wy0NfCU1hVUOfNR1dJpvDHLBwwa301IRJDrQJnhak="; 189 + 190 + urls = [ 191 + "${mirror1}/Bai/qc2534.tar.gz" 192 + "${mirror2}/Bai/qc2534.tar.gz" 193 + ]; 194 + }; 195 + 196 + matrix-22 = fetchzip { 197 + sha256 = "sha256-oxMnt8U5Cf1ILWcBdU6W9jdSMMm+U6bIVl8nm3n3+OA="; 198 + 199 + urls = [ 200 + "${mirror1}/Chevron/Chevron2.tar.gz" 201 + "${mirror2}/Chevron/Chevron2.tar.gz" 202 + ]; 203 + }; 204 + 205 + matrix-23 = fetchzip { 206 + sha256 = "sha256-MFD9BxFI/3IS7yatW121BAI04fbqrXpgYDT5UKjeKcU="; 207 + 208 + urls = [ 209 + "${mirror1}/Chevron/Chevron3.tar.gz" 210 + "${mirror2}/Chevron/Chevron3.tar.gz" 211 + ]; 212 + }; 213 + 214 + matrix-24 = fetchzip { 215 + sha256 = "sha256-ikS8O51pe1nt3BNyhvfvqCbVL0+bg/da9bqGqeBDkTg="; 216 + 217 + urls = [ 218 + "${mirror1}/Chevron/Chevron4.tar.gz" 219 + "${mirror2}/Chevron/Chevron4.tar.gz" 220 + ]; 221 + }; 222 + }
+87
pkgs/development/rocm-modules/6/rocthrust/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocprim 8 + , clr 9 + , gtest 10 + , buildTests ? false 11 + , buildBenchmarks ? false 12 + , gpuTargets ? [ ] 13 + }: 14 + 15 + stdenv.mkDerivation (finalAttrs: { 16 + pname = "rocthrust"; 17 + version = "6.0.2"; 18 + 19 + outputs = [ 20 + "out" 21 + ] ++ lib.optionals buildTests [ 22 + "test" 23 + ] ++ lib.optionals buildBenchmarks [ 24 + "benchmark" 25 + ]; 26 + 27 + src = fetchFromGitHub { 28 + owner = "ROCm"; 29 + repo = "rocThrust"; 30 + rev = "rocm-${finalAttrs.version}"; 31 + hash = "sha256-Zk7FxcedaDUbx9RCX8aWN0xZO/B5cOs/l5MDqZKQpJo="; 32 + }; 33 + 34 + nativeBuildInputs = [ 35 + cmake 36 + rocm-cmake 37 + rocprim 38 + clr 39 + ]; 40 + 41 + buildInputs = lib.optionals buildTests [ 42 + gtest 43 + ]; 44 + 45 + cmakeFlags = [ 46 + "-DCMAKE_CXX_COMPILER=hipcc" 47 + "-DHIP_ROOT_DIR=${clr}" 48 + # Manually define CMAKE_INSTALL_<DIR> 49 + # See: https://github.com/NixOS/nixpkgs/pull/197838 50 + "-DCMAKE_INSTALL_BINDIR=bin" 51 + "-DCMAKE_INSTALL_LIBDIR=lib" 52 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 53 + ] ++ lib.optionals (gpuTargets != [ ]) [ 54 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 55 + ] ++ lib.optionals buildTests [ 56 + "-DBUILD_TEST=ON" 57 + ] ++ lib.optionals buildBenchmarks [ 58 + "-DBUILD_BENCHMARKS=ON" 59 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 60 + "-DCMAKE_CXX_FLAGS=-Wno-deprecated-builtins" # Too much spam 61 + ]; 62 + 63 + postInstall = lib.optionalString buildTests '' 64 + mkdir -p $test/bin 65 + mv $out/bin/{test_*,*.hip} $test/bin 66 + '' + lib.optionalString buildBenchmarks '' 67 + mkdir -p $benchmark/bin 68 + mv $out/bin/benchmark_* $benchmark/bin 69 + '' + lib.optionalString (buildTests || buildBenchmarks) '' 70 + rm -rf $out/bin 71 + ''; 72 + 73 + passthru.updateScript = rocmUpdateScript { 74 + name = finalAttrs.pname; 75 + owner = finalAttrs.src.owner; 76 + repo = finalAttrs.src.repo; 77 + }; 78 + 79 + meta = with lib; { 80 + description = "ROCm parallel algorithm library"; 81 + homepage = "https://github.com/ROCm/rocThrust"; 82 + license = with licenses; [ asl20 ]; 83 + maintainers = teams.rocm.members; 84 + platforms = platforms.linux; 85 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 86 + }; 87 + })
+103
pkgs/development/rocm-modules/6/roctracer/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , clr 7 + , rocm-device-libs 8 + , libxml2 9 + , doxygen 10 + , graphviz 11 + , gcc-unwrapped 12 + , libbacktrace 13 + , rocm-runtime 14 + , python3Packages 15 + , buildDocs ? false # Nothing seems to be generated, so not making the output 16 + , buildTests ? false 17 + }: 18 + 19 + stdenv.mkDerivation (finalAttrs: { 20 + pname = "roctracer"; 21 + version = "6.0.2"; 22 + 23 + outputs = [ 24 + "out" 25 + ] ++ lib.optionals buildDocs [ 26 + "doc" 27 + ] ++ lib.optionals buildTests [ 28 + "test" 29 + ]; 30 + 31 + src = fetchFromGitHub { 32 + owner = "ROCm"; 33 + repo = "roctracer"; 34 + rev = "rocm-${finalAttrs.version}"; 35 + hash = "sha256-a6/N6W3JXVI0VZRGxlS3cVENC3VTP1w9UFnd0+EWAuo="; 36 + }; 37 + 38 + nativeBuildInputs = [ 39 + cmake 40 + clr 41 + ] ++ lib.optionals buildDocs [ 42 + doxygen 43 + graphviz 44 + ]; 45 + 46 + buildInputs = [ 47 + libxml2 48 + libbacktrace 49 + python3Packages.python 50 + python3Packages.cppheaderparser 51 + ]; 52 + 53 + cmakeFlags = [ 54 + "-DCMAKE_MODULE_PATH=${clr}/hip/cmake" 55 + # Manually define CMAKE_INSTALL_<DIR> 56 + # See: https://github.com/NixOS/nixpkgs/pull/197838 57 + "-DCMAKE_INSTALL_BINDIR=bin" 58 + "-DCMAKE_INSTALL_LIBDIR=lib" 59 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 60 + ]; 61 + 62 + env.NIX_CFLAGS_COMPILE = toString [ 63 + # Needed with GCC 12 64 + "-Wno-error=array-bounds" 65 + ]; 66 + 67 + postPatch = '' 68 + export HIP_DEVICE_LIB_PATH=${rocm-device-libs}/amdgcn/bitcode 69 + '' + lib.optionalString (!buildTests) '' 70 + substituteInPlace CMakeLists.txt \ 71 + --replace "add_subdirectory(test)" "" 72 + ''; 73 + 74 + # Tests always fail, probably need GPU 75 + # doCheck = buildTests; 76 + 77 + postInstall = lib.optionalString buildDocs '' 78 + mkdir -p $doc 79 + '' + lib.optionalString buildTests '' 80 + mkdir -p $test/bin 81 + # Not sure why this is an install target 82 + find $out/test -executable -type f -exec mv {} $test/bin \; 83 + rm $test/bin/{*.sh,*.py} 84 + patchelf --set-rpath $out/lib:${lib.makeLibraryPath ( 85 + finalAttrs.buildInputs ++ [ clr gcc-unwrapped.lib rocm-runtime ])} $test/bin/* 86 + rm -rf $out/test 87 + ''; 88 + 89 + passthru.updateScript = rocmUpdateScript { 90 + name = finalAttrs.pname; 91 + owner = finalAttrs.src.owner; 92 + repo = finalAttrs.src.repo; 93 + }; 94 + 95 + meta = with lib; { 96 + description = "Tracer callback/activity library"; 97 + homepage = "https://github.com/ROCm/roctracer"; 98 + license = with licenses; [ mit ]; # mitx11 99 + maintainers = teams.rocm.members; 100 + platforms = platforms.linux; 101 + broken = versions.minor finalAttrs.version != versions.minor clr.version || versionAtLeast finalAttrs.version "7.0.0"; 102 + }; 103 + })
+35
pkgs/development/rocm-modules/6/rocwmma/0000-dont-fetch-googletest.patch
···
··· 1 + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt 2 + index 0d00883..86ce282 100644 3 + --- a/test/CMakeLists.txt 4 + +++ b/test/CMakeLists.txt 5 + @@ -30,30 +30,6 @@ cmake_dependent_option( ROCWMMA_BUILD_VALIDATION_TESTS "Build validation tests" 6 + cmake_dependent_option( ROCWMMA_BUILD_BENCHMARK_TESTS "Build benchmarking tests" OFF "ROCWMMA_BUILD_TESTS" OFF ) 7 + cmake_dependent_option( ROCWMMA_BUILD_EXTENDED_TESTS "Build extended test parameter coverage" OFF "ROCWMMA_BUILD_TESTS" OFF ) 8 + 9 + -# Test/benchmark requires additional dependencies 10 + -include( FetchContent ) 11 + - 12 + -FetchContent_Declare( 13 + - googletest 14 + - GIT_REPOSITORY https://github.com/google/googletest.git 15 + - GIT_TAG release-1.12.1 16 + -) 17 + -FetchContent_GetProperties(googletest) 18 + -if(NOT googletest_POPULATED) 19 + - 20 + - # Fetch the content using default details 21 + - FetchContent_Populate(googletest) 22 + - # Save the shared libs setting, then force to static libs 23 + - set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS}) 24 + - set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "Build SHARED libraries" FORCE) 25 + - 26 + - # Add gtest targets as static libs 27 + - add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) 28 + - 29 + - # Restore shared libs setting 30 + - set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD} CACHE INTERNAL "Build SHARED libraries" FORCE) 31 + -endif() 32 + - 33 + set(ROCWMMA_TEST_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) 34 + set(ROCWMMA_COMMON_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hip_device.cpp 35 + ${CMAKE_CURRENT_SOURCE_DIR}/rocwmma_gtest_main.cpp)
+105
pkgs/development/rocm-modules/6/rocwmma/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocm-smi 8 + , clr 9 + , openmp 10 + , gtest 11 + , rocblas 12 + , buildTests ? false # Will likely fail building because wavefront shifts are not supported for certain archs 13 + , buildExtendedTests ? false 14 + , buildBenchmarks ? false 15 + , buildSamples ? false 16 + , gpuTargets ? [ ] # gpuTargets = [ "gfx908:xnack-" "gfx90a:xnack-" "gfx90a:xnack+" ... ] 17 + }: 18 + 19 + stdenv.mkDerivation (finalAttrs: { 20 + pname = "rocwmma"; 21 + version = "6.0.2"; 22 + 23 + outputs = [ 24 + "out" 25 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 26 + "test" 27 + ] ++ lib.optionals buildBenchmarks [ 28 + "benchmark" 29 + ] ++ lib.optionals buildSamples [ 30 + "sample" 31 + ]; 32 + 33 + src = fetchFromGitHub { 34 + owner = "ROCm"; 35 + repo = "rocWMMA"; 36 + rev = "rocm-${finalAttrs.version}"; 37 + hash = "sha256-vbC4OuCmEpD38lVq0uXNw86iS4KkL6isOVq6vmlu1oM="; 38 + }; 39 + 40 + patches = lib.optionals (buildTests || buildBenchmarks) [ 41 + ./0000-dont-fetch-googletest.patch 42 + ]; 43 + 44 + nativeBuildInputs = [ 45 + cmake 46 + rocm-cmake 47 + clr 48 + ]; 49 + 50 + buildInputs = [ 51 + openmp 52 + ] ++ lib.optionals (buildTests || buildBenchmarks) [ 53 + rocm-smi 54 + gtest 55 + rocblas 56 + ]; 57 + 58 + cmakeFlags = [ 59 + "-DCMAKE_CXX_COMPILER=hipcc" 60 + "-DROCWMMA_BUILD_TESTS=${if buildTests || buildBenchmarks then "ON" else "OFF"}" 61 + "-DROCWMMA_BUILD_SAMPLES=${if buildSamples then "ON" else "OFF"}" 62 + # Manually define CMAKE_INSTALL_<DIR> 63 + # See: https://github.com/NixOS/nixpkgs/pull/197838 64 + "-DCMAKE_INSTALL_BINDIR=bin" 65 + "-DCMAKE_INSTALL_LIBDIR=lib" 66 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 67 + ] ++ lib.optionals (gpuTargets != [ ]) [ 68 + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 69 + ] ++ lib.optionals buildExtendedTests [ 70 + "-DROCWMMA_BUILD_EXTENDED_TESTS=ON" 71 + ] ++ lib.optionals buildBenchmarks [ 72 + "-DROCWMMA_BUILD_BENCHMARK_TESTS=ON" 73 + "-DROCWMMA_BENCHMARK_WITH_ROCBLAS=ON" 74 + ]; 75 + 76 + postInstall = lib.optionalString (buildTests || buildBenchmarks) '' 77 + mkdir -p $test/bin 78 + mv $out/bin/{*_test,*-validate} $test/bin 79 + '' + lib.optionalString buildBenchmarks '' 80 + mkdir -p $benchmark/bin 81 + mv $out/bin/*-bench $benchmark/bin 82 + '' + lib.optionalString buildSamples '' 83 + mkdir -p $sample/bin 84 + mv $out/bin/sgemmv $sample/bin 85 + mv $out/bin/simple_gemm $sample/bin 86 + mv $out/bin/simple_dlrm $sample/bin 87 + '' + lib.optionalString (buildTests || buildBenchmarks || buildSamples) '' 88 + rm -rf $out/bin 89 + ''; 90 + 91 + passthru.updateScript = rocmUpdateScript { 92 + name = finalAttrs.pname; 93 + owner = finalAttrs.src.owner; 94 + repo = finalAttrs.src.repo; 95 + }; 96 + 97 + meta = with lib; { 98 + description = "Mixed precision matrix multiplication and accumulation"; 99 + homepage = "https://github.com/ROCm/rocWMMA"; 100 + license = with licenses; [ mit ]; 101 + maintainers = teams.rocm.members; 102 + platforms = platforms.linux; 103 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 104 + }; 105 + })
+88
pkgs/development/rocm-modules/6/rpp/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , cmake 6 + , rocm-cmake 7 + , rocm-docs-core 8 + , half 9 + , clr 10 + , openmp 11 + , boost 12 + , python3Packages 13 + , buildDocs ? false # Needs internet 14 + , useOpenCL ? false 15 + , useCPU ? false 16 + , gpuTargets ? [ ] 17 + }: 18 + 19 + stdenv.mkDerivation (finalAttrs: { 20 + pname = "rpp-" + ( 21 + if (!useOpenCL && !useCPU) then "hip" 22 + else if (!useOpenCL && !useCPU) then "opencl" 23 + else "cpu" 24 + ); 25 + 26 + version = "6.0.2"; 27 + 28 + src = fetchFromGitHub { 29 + owner = "ROCm"; 30 + repo = "rpp"; 31 + rev = "rocm-${finalAttrs.version}"; 32 + hash = "sha256-AquAVoEqlsBVxd41hG2sVo9UoSS+255eCQzIfGkC/Tk="; 33 + }; 34 + 35 + nativeBuildInputs = [ 36 + cmake 37 + rocm-cmake 38 + clr 39 + ] ++ lib.optionals buildDocs [ 40 + rocm-docs-core 41 + python3Packages.python 42 + ]; 43 + 44 + buildInputs = [ 45 + half 46 + openmp 47 + boost 48 + ]; 49 + 50 + cmakeFlags = [ 51 + "-DROCM_PATH=${clr}" 52 + ] ++ lib.optionals (gpuTargets != [ ]) [ 53 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 54 + ] ++ lib.optionals (!useOpenCL && !useCPU) [ 55 + "-DCMAKE_C_COMPILER=hipcc" 56 + "-DCMAKE_CXX_COMPILER=hipcc" 57 + "-DBACKEND=HIP" 58 + ] ++ lib.optionals (useOpenCL && !useCPU) [ 59 + "-DBACKEND=OCL" 60 + ] ++ lib.optionals useCPU [ 61 + "-DBACKEND=CPU" 62 + ]; 63 + 64 + postPatch = lib.optionalString (!useOpenCL && !useCPU) '' 65 + # Bad path 66 + substituteInPlace CMakeLists.txt \ 67 + --replace "COMPILER_FOR_HIP \''${ROCM_PATH}/llvm/bin/clang++" "COMPILER_FOR_HIP ${clr}/bin/hipcc" 68 + ''; 69 + 70 + postBuild = lib.optionalString buildDocs '' 71 + python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en ../docs _build/html 72 + ''; 73 + 74 + passthru.updateScript = rocmUpdateScript { 75 + name = finalAttrs.pname; 76 + owner = finalAttrs.src.owner; 77 + repo = finalAttrs.src.repo; 78 + }; 79 + 80 + meta = with lib; { 81 + description = "Comprehensive high-performance computer vision library for AMD processors"; 82 + homepage = "https://github.com/ROCm/rpp"; 83 + license = with licenses; [ mit ]; 84 + maintainers = teams.rocm.members; 85 + platforms = platforms.linux; 86 + broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0"; 87 + }; 88 + })
+65
pkgs/development/rocm-modules/6/tensile/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , rocmUpdateScript 5 + , buildPythonPackage 6 + , pytestCheckHook 7 + , setuptools 8 + , pyyaml 9 + , msgpack 10 + , pandas 11 + , joblib 12 + , filelock 13 + , rocminfo 14 + }: 15 + 16 + buildPythonPackage rec { 17 + pname = "tensile"; 18 + version = "6.0.2"; 19 + format = "pyproject"; 20 + 21 + src = fetchFromGitHub { 22 + owner = "ROCm"; 23 + repo = "Tensile"; 24 + rev = "rocm-${version}"; 25 + hash = "sha256-B9/2Iw1chwDL6it1CKC8W8v4Qac/J2z9nwlpwjnllDc="; 26 + }; 27 + 28 + buildInputs = [ setuptools ]; 29 + 30 + propagatedBuildInputs = [ 31 + pyyaml 32 + msgpack 33 + pandas 34 + joblib 35 + ]; 36 + 37 + doCheck = false; # Too many errors, not sure how to set this up properly 38 + 39 + nativeCheckInputs = [ 40 + pytestCheckHook 41 + filelock 42 + rocminfo 43 + ]; 44 + 45 + preCheck = '' 46 + export ROCM_PATH=${rocminfo} 47 + ''; 48 + 49 + pythonImportsCheck = [ "Tensile" ]; 50 + 51 + passthru.updateScript = rocmUpdateScript { 52 + name = pname; 53 + owner = src.owner; 54 + repo = src.repo; 55 + }; 56 + 57 + meta = with lib; { 58 + description = "GEMMs and tensor contractions"; 59 + homepage = "https://github.com/ROCm/Tensile"; 60 + license = with licenses; [ mit ]; 61 + maintainers = teams.rocm.members; 62 + platforms = platforms.linux; 63 + broken = versions.minor version != versions.minor stdenv.cc.version || versionAtLeast version "7.0.0"; 64 + }; 65 + }
+33
pkgs/development/rocm-modules/6/update.nix
···
··· 1 + { lib 2 + , writeScript 3 + }: 4 + 5 + { name ? "" 6 + , owner ? "" 7 + , repo ? "" 8 + , page ? "releases/latest" 9 + , filter ? ".tag_name | split(\"-\") | .[1]" 10 + }: 11 + 12 + let 13 + pname = 14 + if lib.hasPrefix "rocm-llvm-" name 15 + then "llvm.${lib.removePrefix "rocm-llvm-" name}" 16 + else name; 17 + 18 + updateScript = writeScript "update.sh" '' 19 + #!/usr/bin/env nix-shell 20 + #!nix-shell -i bash -p curl jq common-updater-scripts 21 + version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ 22 + -sL "https://api.github.com/repos/${owner}/${repo}/${page}" | jq '${filter}' --raw-output)" 23 + 24 + IFS='.' read -a version_arr <<< "$version" 25 + 26 + if (( ''${version_arr[0]} > 6 )); then 27 + echo "'rocmPackages_6.${pname}' is already at it's maximum allowed version.''\nAny further upgrades should go into 'rocmPackages_X.${pname}'." 1>&2 28 + exit 1 29 + fi 30 + 31 + update-source-version rocmPackages_6.${pname} "$version" --ignore-same-hash 32 + ''; 33 + in [ updateScript ]
+2 -1
pkgs/top-level/all-packages.nix
··· 7699 7700 rar2fs = callPackage ../tools/filesystems/rar2fs { }; 7701 7702 - rocmPackages = rocmPackages_5; 7703 rocmPackages_5 = recurseIntoAttrs (callPackage ../development/rocm-modules/5 { }); 7704 7705 rune = callPackage ../development/interpreters/rune { }; 7706
··· 7699 7700 rar2fs = callPackage ../tools/filesystems/rar2fs { }; 7701 7702 + rocmPackages = rocmPackages_6; 7703 rocmPackages_5 = recurseIntoAttrs (callPackage ../development/rocm-modules/5 { }); 7704 + rocmPackages_6 = recurseIntoAttrs (callPackage ../development/rocm-modules/6 { }); 7705 7706 rune = callPackage ../development/interpreters/rune { }; 7707