Merge pull request #95489 from danieldk/rocm-3.7.0

Update ROCm to 3.7.0

authored by danieldk.tngl.sh and committed by

GitHub 280147c5 1a6f2e66

+56 -152
+1 -24
nixos/doc/manual/configuration/gpu-accel.xml
··· 70 70 Core Next</link> (GCN) GPUs are supported through the 71 71 <package>rocm-opencl-icd</package> package. Adding this package to 72 72 <xref linkend="opt-hardware.opengl.extraPackages"/> enables OpenCL 73 - support. However, OpenCL Image support is provided through the 74 - non-free <package>rocm-runtime-ext</package> package. This package can 75 - be added to the same configuration option, but requires that 76 - <varname>allowUnfree</varname> option is is enabled for nixpkgs. Full 77 - OpenCL support on supported AMD GPUs is thus enabled as follows: 73 + support: 78 74 79 75 <programlisting><xref linkend="opt-hardware.opengl.extraPackages"/> = [ 80 76 rocm-opencl-icd 81 - rocm-runtime-ext 82 77 ];</programlisting> 83 - </para> 84 - 85 - <para> 86 - It is also possible to use the OpenCL Image extension without a 87 - system-wide installation of the <package>rocm-runtime-ext</package> 88 - package by setting the <varname>ROCR_EXT_DIR</varname> environment 89 - variable to the directory that contains the extension: 90 - 91 - <screen><prompt>$</prompt> export \ 92 - ROCR_EXT_DIR=`nix-build '&lt;nixpkgs&gt;' --no-out-link -A rocm-runtime-ext`/lib/rocm-runtime-ext</screen> 93 - </para> 94 - 95 - <para> 96 - With either approach, you can verify that OpenCL Image support 97 - is indeed working with the <command>clinfo</command> command: 98 - 99 - <screen><prompt>$</prompt> clinfo | grep Image 100 - Image support Yes</screen> 101 78 </para> 102 79 </section> 103 80
+1 -2
pkgs/development/compilers/llvm/rocm/clang.nix
··· 4 4 , python 5 5 , llvm 6 6 , clang-tools-extra_src ? null 7 - , rocm-runtime 8 7 , lld 9 8 10 9 , version ··· 18 17 19 18 nativeBuildInputs = [ cmake python ]; 20 19 21 - buildInputs = [ llvm rocm-runtime ]; 20 + buildInputs = [ llvm ]; 22 21 23 22 hardeningDisable = [ "all" ]; 24 23
+2 -2
pkgs/development/compilers/llvm/rocm/default.nix
··· 1 1 { stdenv, fetchFromGitHub, callPackage, wrapCCWith }: 2 2 3 3 let 4 - version = "3.5.1"; 4 + version = "3.7.0"; 5 5 src = fetchFromGitHub { 6 6 owner = "RadeonOpenCompute"; 7 7 repo = "llvm-project"; 8 8 rev = "rocm-${version}"; 9 - sha256 = "03k2xp8wf4awf1zcjc2hb3kf9bqp567c3s569gp1q3q1zjg6r2ib"; 9 + sha256 = "02p0s041wwsi4q0dhs1sj5l6059y02s31az505h0f22agz3jnpfn"; 10 10 }; 11 11 in rec { 12 12 clang = wrapCCWith rec {
+7 -7
pkgs/development/libraries/rocclr/default.nix
··· 10 10 , libelf 11 11 , libglvnd 12 12 , libX11 13 + , numactl 13 14 }: 14 15 15 16 stdenv.mkDerivation rec { 16 17 pname = "rocclr"; 17 - version = "3.5.0"; 18 + version = "3.7.0"; 18 19 19 20 src = fetchFromGitHub { 20 21 owner = "ROCm-Developer-Tools"; 21 22 repo = "ROCclr"; 22 - rev = "roc-${version}"; 23 - sha256 = "0j70lxpwrdrb1v4lbcyzk7kilw62ip4py9fj149d8k3x5x6wkji1"; 23 + rev = "rocm-${version}"; 24 + sha256 = "0sx4irbmjgs5bm8dc8jc9fl1jmfdnrp3ar14hdhrsmbani7gqah3"; 24 25 }; 25 26 26 27 nativeBuildInputs = [ cmake rocm-cmake ]; 27 28 28 29 buildInputs = [ clang rocm-comgr rocm-runtime rocm-thunk ]; 29 30 30 - propagatedBuildInputs = [ libelf libglvnd libX11 ]; 31 + propagatedBuildInputs = [ libelf libglvnd libX11 numactl ]; 31 32 32 33 prePatch = '' 33 34 substituteInPlace CMakeLists.txt \ ··· 45 46 ]; 46 47 47 48 preFixup = '' 48 - mv $out/include/include/* $out/include 49 - ln -s $out/include/compiler/lib/include/* $out/include/include 50 49 ln -s $out/include/compiler/lib/include/* $out/include 51 - sed "s|^\([[:space:]]*IMPORTED_LOCATION_RELEASE \).*|\1 \"$out/lib/libamdrocclr_static.a\"|" -i $out/lib/cmake/amdrocclr_staticTargets.cmake 50 + substituteInPlace $out/lib/cmake/rocclr/ROCclrConfig.cmake \ 51 + --replace "/build/source/build" "$out" 52 52 ''; 53 53 54 54 meta = with stdenv.lib; {
+2 -2
pkgs/development/libraries/rocm-comgr/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "rocm-comgr"; 5 - version = "3.5.0"; 5 + version = "3.7.0"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "RadeonOpenCompute"; 9 9 repo = "ROCm-CompilerSupport"; 10 10 rev = "rocm-${version}"; 11 - sha256 = "0h9bxz98sskgzc3xpnp469iq1wi59nbijbqprlylha91y10hqb88"; 11 + sha256 = "1r7arfdqfh6pfvjza6x2dzd5gjmkndngrp688d3n2ab92n5ijiqf"; 12 12 }; 13 13 14 14 sourceRoot = "source/lib/comgr";
+3 -4
pkgs/development/libraries/rocm-device-libs/default.nix
··· 5 5 , clang-unwrapped 6 6 , lld 7 7 , llvm 8 - , rocm-runtime 9 8 }: 10 9 11 10 stdenv.mkDerivation rec { 12 11 pname = "rocm-device-libs"; 13 - version = "3.5.1"; 12 + version = "3.7.0"; 14 13 15 14 src = fetchFromGitHub { 16 15 owner = "RadeonOpenCompute"; 17 16 repo = "ROCm-Device-Libs"; 18 17 rev = "rocm-${version}"; 19 - sha256 = "180bx05l293hrhzk2ymx41j5lhskysywvx33igbbsngzailwsc22"; 18 + sha256 = "1sg7wzj2mi5vhba53cp52gnya7c799f0p325ig262vi70r7mr7n2"; 20 19 }; 21 20 22 21 nativeBuildInputs = [ cmake ]; 23 22 24 - buildInputs = [ clang lld llvm rocm-runtime ]; 23 + buildInputs = [ clang lld llvm ]; 25 24 26 25 cmakeBuildType = "Release"; 27 26
+1 -1
pkgs/development/libraries/rocm-opencl-icd/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "rocm-opencl-icd"; 5 - version = "3.5.0"; 5 + version = rocm-opencl-runtime.version; 6 6 7 7 dontUnpack = true; 8 8
+14 -15
pkgs/development/libraries/rocm-opencl-runtime/default.nix
··· 5 5 , rocm-cmake 6 6 , clang 7 7 , clang-unwrapped 8 - , libGLU 8 + , glew 9 + , libglvnd 9 10 , libX11 10 11 , lld 11 12 , llvm ··· 18 19 , rocm-thunk 19 20 }: 20 21 21 - let 22 - version = "3.5.0"; 23 - tag = "roc-${version}"; 24 - in stdenv.mkDerivation rec { 25 - inherit version; 26 - 22 + stdenv.mkDerivation rec { 27 23 pname = "rocm-opencl-runtime"; 24 + version = "3.7.0"; 28 25 29 26 src = fetchFromGitHub { 30 27 owner = "RadeonOpenCompute"; 31 28 repo = "ROCm-OpenCL-Runtime"; 32 - rev = tag; 33 - sha256 = "1wrr6mmn4gf6i0vxp4yqk0ny2wglvj1jfj50il8czjwy0cwmhykk"; 34 - name = "ROCm-OpenCL-Runtime-${tag}-src"; 29 + rev = "rocm-${version}"; 30 + sha256 = "15rz11a8qwvxmd0kkaikj04q1glfg9sgqqblcqp3iahr3by8z0wd"; 35 31 }; 36 32 37 33 nativeBuildInputs = [ cmake rocm-cmake ]; ··· 39 35 buildInputs = [ 40 36 clang 41 37 clang-unwrapped 42 - libGLU 38 + glew 39 + libglvnd 43 40 libX11 44 41 lld 45 42 llvm ··· 63 60 64 61 dontStrip = true; 65 62 63 + # Remove clinfo, which is already provided through the 64 + # `clinfo` package. 65 + postInstall = '' 66 + rm -rf $out/bin 67 + ''; 68 + 66 69 # Fix the ICD installation path for NixOS 67 70 postPatch = '' 68 71 substituteInPlace khronos/icd/loader/linux/icd_linux.c \ 69 72 --replace 'ICD_VENDOR_PATH' '"${addOpenGLRunpath.driverLink}/etc/OpenCL/vendors/"' 70 73 echo 'add_dependencies(amdocl64 OpenCL)' >> amdocl/CMakeLists.txt 71 - ''; 72 - 73 - preFixup = '' 74 - patchelf --set-rpath "$out/lib" $out/bin/clinfo 75 74 ''; 76 75 77 76 meta = with stdenv.lib; {
-42
pkgs/development/libraries/rocm-runtime-ext/default.nix
··· 1 - { stdenv, fetchurl, autoPatchelfHook, rpmextract, rocm-runtime }: 2 - 3 - stdenv.mkDerivation rec { 4 - pname = "rocm-runtime-ext"; 5 - version = "3.5.1"; 6 - 7 - src = fetchurl { 8 - url = "https://repo.radeon.com/rocm/yum/3.5.1/hsa-ext-rocr-dev-1.1.30501.0-rocm-rel-3.5-34-def83d8a-Linux.rpm"; 9 - sha256 = "0r7lrmnplr10hs6wrji55i3dnczfzlmp8jahm1g3mhq2x12zmly0"; 10 - }; 11 - 12 - nativeBuildInputs = [ autoPatchelfHook rpmextract ]; 13 - 14 - buildInputs = [ rocm-runtime stdenv.cc.cc ]; 15 - 16 - unpackPhase = "rpmextract ${src}"; 17 - 18 - installPhase = '' 19 - mkdir -p $out/lib 20 - cp -R opt/rocm-${version}/hsa/lib $out/lib/rocm-runtime-ext 21 - ''; 22 - 23 - setupHook = ./setup-hook.sh; 24 - 25 - meta = with stdenv.lib; { 26 - description = "Platform runtime for ROCm (closed-source extensions)"; 27 - longDescription = '' 28 - This package provides closed-source extensions to the ROCm 29 - runtime. Currently this adds support for OpenCL image 30 - processing. 31 - 32 - In order for the ROCm runtime to pick up the extension, you 33 - should either set the ROCR_EXT_DIR environment variable should 34 - be set to ''${rocm-runtime-ext}/lib/rocm-runtime-ext or this 35 - package should be added to the hardware.opengl.extraPackages 36 - NixOS configuration option. 37 - ''; 38 - homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime"; 39 - license = with licenses; [ unfreeRedistributable ]; 40 - maintainers = with maintainers; [ danieldk ]; 41 - }; 42 - }
-7
pkgs/development/libraries/rocm-runtime-ext/setup-hook.sh
··· 1 - addRocmRuntimeExtDir () { 2 - if [[ -z "${ROCR_EXT_DIR-}" ]]; then 3 - export ROCR_EXT_DIR="@out@/lib/rocm-runtime-ext" 4 - fi 5 - } 6 - 7 - addEnvHooks "$hostOffset" addRocmRuntimeExtDir
+16 -15
pkgs/development/libraries/rocm-runtime/default.nix
··· 1 1 { stdenv 2 2 , fetchFromGitHub 3 3 , addOpenGLRunpath 4 + , clang-unwrapped 4 5 , cmake 6 + , xxd 5 7 , elfutils 8 + , llvm 9 + , rocm-device-libs 6 10 , rocm-thunk }: 7 11 8 12 stdenv.mkDerivation rec { 9 13 pname = "rocm-runtime"; 10 - version = "3.5.0"; 14 + version = "3.7.0"; 11 15 12 16 src = fetchFromGitHub { 13 17 owner = "RadeonOpenCompute"; 14 18 repo = "ROCR-Runtime"; 15 19 rev = "rocm-${version}"; 16 - sha256 = "028x1f0if6lw41cpfpysp82ikp6c3fdxxd2a6ixs0vpm4424svb1"; 20 + sha256 = "1lm4cbx1d727zll85vjc1kykc72mk82nfhyyhjljv82gd4mnz00c"; 17 21 }; 18 22 19 23 sourceRoot = "source/src"; 20 24 21 - buildInputs = [ cmake elfutils ]; 25 + nativeBuildInputs = [ cmake xxd ]; 26 + 27 + buildInputs = [ clang-unwrapped elfutils llvm ]; 22 28 23 - cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${rocm-thunk}" ]; 29 + cmakeFlags = [ 30 + "-DBITCODE_DIR=${rocm-device-libs}/lib" 31 + "-DCMAKE_PREFIX_PATH=${rocm-thunk}" 32 + ]; 24 33 25 - # Use the ROCR_EXT_DIR environment variable and/or OpenGL driver 26 - # link path to try to find binary-only ROCm runtime extension 27 - # libraries. Without this change, we would have to rely on 28 - # LD_LIBRARY_PATH to let the HSA runtime discover the shared 29 - # libraries. 30 - patchPhase = '' 31 - substitute '${./rocr-ext-dir.diff}' ./rocr-ext-dir.diff \ 32 - --subst-var-by rocrExtDir "${addOpenGLRunpath.driverLink}/lib/rocm-runtime-ext" 33 - patch -p2 < ./rocr-ext-dir.diff 34 + postPatch = '' 35 + patchShebangs image/blit_src/create_hsaco_ascii_file.sh 34 36 ''; 35 37 36 38 fixupPhase = '' 37 - rm -r $out/lib $out/include 38 - mv $out/hsa/lib $out/hsa/include $out 39 + rm -rf $out/hsa 39 40 ''; 40 41 41 42 meta = with stdenv.lib; {
-23
pkgs/development/libraries/rocm-runtime/rocr-ext-dir.diff
··· 1 - diff --git a/src/core/runtime/runtime.cpp b/src/core/runtime/runtime.cpp 2 - index dd6a15c..fb6de49 100644 3 - --- a/src/core/runtime/runtime.cpp 4 - +++ b/src/core/runtime/runtime.cpp 5 - @@ -1358,7 +1358,17 @@ void Runtime::LoadExtensions() { 6 - core::HsaApiTable::HSA_EXT_FINALIZER_API_TABLE_ID); 7 - 8 - // Update Hsa Api Table with handle of Image extension Apis 9 - - extensions_.LoadImage(kImageLib[os_index(os::current_os)]); 10 - + // 11 - + // Use ROCR_EXT_DIR when it is non-empty. Otherwise, try to load the 12 - + // library from the OpenGL driver path. 13 - + std::string extDirVar = os::GetEnvVar("ROCR_EXT_DIR"); 14 - + if (!extDirVar.empty()) { 15 - + extensions_.LoadImage(extDirVar + "/" + kImageLib[os_index(os::current_os)]); 16 - + } else { 17 - + std::string globalDriverDir("@rocrExtDir@"); 18 - + extensions_.LoadImage(globalDriverDir + "/" + kImageLib[os_index(os::current_os)]); 19 - + } 20 - + 21 - hsa_api_table_.LinkExts(&extensions_.image_api, 22 - core::HsaApiTable::HSA_EXT_IMAGE_API_TABLE_ID); 23 - }
+2 -2
pkgs/development/libraries/rocm-thunk/default.nix
··· 7 7 8 8 stdenv.mkDerivation rec { 9 9 pname = "rocm-thunk"; 10 - version = "3.5.0"; 10 + version = "3.7.0"; 11 11 12 12 src = fetchFromGitHub { 13 13 owner = "RadeonOpenCompute"; 14 14 repo = "ROCT-Thunk-Interface"; 15 15 rev = "rocm-${version}"; 16 - sha256 = "0xn1z0xc3phjc9vabwxgph5any4ffhc8wgs5yb15m5wpg87l8x1z"; 16 + sha256 = "05963lxip3175g4b7k45r94yayp9gcwl3fpma9g5mdkbrlbvwlvz"; 17 17 }; 18 18 19 19 preConfigure = ''
+1 -1
pkgs/development/tools/build-managers/rocm-cmake/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "rocm-cmake"; 5 - version = "3.5.0"; 5 + version = "3.7.0"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "RadeonOpenCompute";
+2 -2
pkgs/tools/system/rocm-smi/default.nix
··· 2 2 3 3 buildPythonApplication rec { 4 4 pname = "rocm-smi"; 5 - version = "3.5.0"; 5 + version = "3.7.0"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "RadeonOpenCompute"; 9 9 repo = "ROC-smi"; 10 10 rev = "rocm-${version}"; 11 - sha256 = "189mpvmcv46nfwshyc1wla6k71kbraldik5an20g4v9s13ycrpx9"; 11 + sha256 = "00g9cbni73x9da05lx7hiffp303mdkj1wpxiavfylr4q4z84yhrz"; 12 12 }; 13 13 14 14 format = "other";
+1
pkgs/top-level/aliases.nix
··· 465 465 rhc = throw "deprecated in 2019-04-09: abandoned by upstream."; 466 466 rng_tools = rng-tools; # added 2018-10-24 467 467 robomongo = robo3t; #added 2017-09-28 468 + rocm-runtime-ext = throw "rocm-runtime-ext has been removed, since its functionality was added to rocm-runtime"; #added 2020-08-21 468 469 rssglx = rss-glx; #added 2015-03-25 469 470 recordmydesktop = throw "recordmydesktop has been removed from nixpkgs, as it's unmaintained and uses deprecated libraries"; # added 2019-12-10 470 471 gtk-recordmydesktop = throw "gtk-recordmydesktop has been removed from nixpkgs, as it's unmaintained and uses deprecated libraries"; # added 2019-12-10
+3 -3
pkgs/top-level/all-packages.nix
··· 9411 9411 inherit (llvmPackages_rocm) clang clang-unwrapped lld llvm; 9412 9412 }; 9413 9413 9414 - rocm-runtime = callPackage ../development/libraries/rocm-runtime { }; 9415 - 9416 - rocm-runtime-ext = callPackage ../development/libraries/rocm-runtime-ext { }; 9414 + rocm-runtime = callPackage ../development/libraries/rocm-runtime { 9415 + inherit (llvmPackages_rocm) clang-unwrapped llvm; 9416 + }; 9417 9417 9418 9418 # Python >= 3.8 still gives a bunch of warnings. 9419 9419 rocm-smi = python37.pkgs.callPackage ../tools/system/rocm-smi { };