diff options
author | Daniël de Kok <me@danieldk.eu> | 2020-08-21 08:40:30 +0200 |
---|---|---|
committer | Daniël de Kok <me@danieldk.eu> | 2020-08-21 08:50:51 +0200 |
commit | d4e40af5898539faec5f65d47a67fd603733a5aa (patch) | |
tree | 95587a4d6d4ab9e43c1672e273b40df8109df084 /pkgs/development/libraries/rocm-runtime | |
parent | acc68bba6a2d846572a4019b9c33e2c1810b7599 (diff) |
rocm-runtime: 3.5.0 -> 3.7.0
Diffstat (limited to 'pkgs/development/libraries/rocm-runtime')
-rw-r--r-- | pkgs/development/libraries/rocm-runtime/default.nix | 31 | ||||
-rw-r--r-- | pkgs/development/libraries/rocm-runtime/rocr-ext-dir.diff | 23 |
2 files changed, 16 insertions, 38 deletions
diff --git a/pkgs/development/libraries/rocm-runtime/default.nix b/pkgs/development/libraries/rocm-runtime/default.nix index 7470784d4896..6f573adabe13 100644 --- a/pkgs/development/libraries/rocm-runtime/default.nix +++ b/pkgs/development/libraries/rocm-runtime/default.nix @@ -1,41 +1,42 @@ { stdenv , fetchFromGitHub , addOpenGLRunpath +, clang-unwrapped , cmake +, xxd , elfutils +, llvm +, rocm-device-libs , rocm-thunk }: stdenv.mkDerivation rec { pname = "rocm-runtime"; - version = "3.5.0"; + version = "3.7.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; repo = "ROCR-Runtime"; rev = "rocm-${version}"; - sha256 = "028x1f0if6lw41cpfpysp82ikp6c3fdxxd2a6ixs0vpm4424svb1"; + sha256 = "1lm4cbx1d727zll85vjc1kykc72mk82nfhyyhjljv82gd4mnz00c"; }; sourceRoot = "source/src"; - buildInputs = [ cmake elfutils ]; + nativeBuildInputs = [ cmake xxd ]; - cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${rocm-thunk}" ]; + buildInputs = [ clang-unwrapped elfutils llvm ]; - # Use the ROCR_EXT_DIR environment variable and/or OpenGL driver - # link path to try to find binary-only ROCm runtime extension - # libraries. Without this change, we would have to rely on - # LD_LIBRARY_PATH to let the HSA runtime discover the shared - # libraries. - patchPhase = '' - substitute '${./rocr-ext-dir.diff}' ./rocr-ext-dir.diff \ - --subst-var-by rocrExtDir "${addOpenGLRunpath.driverLink}/lib/rocm-runtime-ext" - patch -p2 < ./rocr-ext-dir.diff + cmakeFlags = [ + "-DBITCODE_DIR=${rocm-device-libs}/lib" + "-DCMAKE_PREFIX_PATH=${rocm-thunk}" + ]; + + postPatch = '' + patchShebangs image/blit_src/create_hsaco_ascii_file.sh ''; fixupPhase = '' - rm -r $out/lib $out/include - mv $out/hsa/lib $out/hsa/include $out + rm -rf $out/hsa ''; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/rocm-runtime/rocr-ext-dir.diff b/pkgs/development/libraries/rocm-runtime/rocr-ext-dir.diff deleted file mode 100644 index 21ffe7d8c34a..000000000000 --- a/pkgs/development/libraries/rocm-runtime/rocr-ext-dir.diff +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/src/core/runtime/runtime.cpp b/src/core/runtime/runtime.cpp -index dd6a15c..fb6de49 100644 ---- a/src/core/runtime/runtime.cpp -+++ b/src/core/runtime/runtime.cpp -@@ -1358,7 +1358,17 @@ void Runtime::LoadExtensions() { - core::HsaApiTable::HSA_EXT_FINALIZER_API_TABLE_ID); - - // Update Hsa Api Table with handle of Image extension Apis -- extensions_.LoadImage(kImageLib[os_index(os::current_os)]); -+ // -+ // Use ROCR_EXT_DIR when it is non-empty. Otherwise, try to load the -+ // library from the OpenGL driver path. -+ std::string extDirVar = os::GetEnvVar("ROCR_EXT_DIR"); -+ if (!extDirVar.empty()) { -+ extensions_.LoadImage(extDirVar + "/" + kImageLib[os_index(os::current_os)]); -+ } else { -+ std::string globalDriverDir("@rocrExtDir@"); -+ extensions_.LoadImage(globalDriverDir + "/" + kImageLib[os_index(os::current_os)]); -+ } -+ - hsa_api_table_.LinkExts(&extensions_.image_api, - core::HsaApiTable::HSA_EXT_IMAGE_API_TABLE_ID); - } |