From d2d402a6957b888b143240d6e7ce4212d507b776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 10 Jul 2020 17:08:10 +0200 Subject: [PATCH] rocm-runtime: init at 3.5.0 --- .../libraries/rocm-runtime/default.nix | 41 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/libraries/rocm-runtime/default.nix diff --git a/pkgs/development/libraries/rocm-runtime/default.nix b/pkgs/development/libraries/rocm-runtime/default.nix new file mode 100644 index 000000000000..e50557c4b30e --- /dev/null +++ b/pkgs/development/libraries/rocm-runtime/default.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchFromGitHub, cmake, elfutils, rocm-thunk }: + +stdenv.mkDerivation rec { + pname = "rocm-runtime"; + version = "3.5.0"; + + src = fetchFromGitHub { + owner = "RadeonOpenCompute"; + repo = "ROCR-Runtime"; + rev = "rocm-${version}"; + sha256 = "028x1f0if6lw41cpfpysp82ikp6c3fdxxd2a6ixs0vpm4424svb1"; + }; + + sourceRoot = "source/src"; + + buildInputs = [ cmake elfutils ]; + + cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${rocm-thunk}" ]; + + # Use the ROCR_EXT_DIR environment variable to try to find + # binary-only extension libraries. This environment variable is set + # by the `rocr-ext` derivation. If that derivation is not in scope, + # then the extension libraries are not loaded. Without this edit, we + # would have to rely on LD_LIBRARY_PATH to let the HSA runtime + # discover the shared libraries. + patchPhase = '' + sed 's/\(k\(Image\|Finalizer\)Lib\[os_index(os::current_os)\]\)/os::GetEnvVar("ROCR_EXT_DIR") + "\/" + \1/g' -i core/runtime/runtime.cpp + ''; + + fixupPhase = '' + rm -r $out/lib $out/include + mv $out/hsa/lib $out/hsa/include $out + ''; + + meta = with stdenv.lib; { + description = "Platform runtime for ROCm"; + homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime"; + license = with licenses; [ ncsa ]; + maintainers = with maintainers; [ danieldk ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 435d137b7b48..b1423f202b9c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9233,6 +9233,8 @@ in rgbds = callPackage ../development/compilers/rgbds { }; + rocm-runtime = callPackage ../development/libraries/rocm-runtime { }; + rocm-thunk = callPackage ../development/libraries/rocm-thunk { }; rtags = callPackage ../development/tools/rtags {