tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
rocm-runtime: 3.5.0 -> 3.7.0
danieldk.tngl.sh
5 years ago
d4e40af5
acc68bba
+19
-39
3 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
rocm-runtime
default.nix
rocr-ext-dir.diff
top-level
all-packages.nix
+16
-15
pkgs/development/libraries/rocm-runtime/default.nix
···
1
1
{ stdenv
2
2
, fetchFromGitHub
3
3
, addOpenGLRunpath
4
4
+
, clang-unwrapped
4
5
, cmake
6
6
+
, xxd
5
7
, elfutils
8
8
+
, llvm
9
9
+
, rocm-device-libs
6
10
, rocm-thunk }:
7
11
8
12
stdenv.mkDerivation rec {
9
13
pname = "rocm-runtime";
10
10
-
version = "3.5.0";
14
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
16
-
sha256 = "028x1f0if6lw41cpfpysp82ikp6c3fdxxd2a6ixs0vpm4424svb1";
20
20
+
sha256 = "1lm4cbx1d727zll85vjc1kykc72mk82nfhyyhjljv82gd4mnz00c";
17
21
};
18
22
19
23
sourceRoot = "source/src";
20
24
21
21
-
buildInputs = [ cmake elfutils ];
25
25
+
nativeBuildInputs = [ cmake xxd ];
26
26
+
27
27
+
buildInputs = [ clang-unwrapped elfutils llvm ];
22
28
23
23
-
cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${rocm-thunk}" ];
29
29
+
cmakeFlags = [
30
30
+
"-DBITCODE_DIR=${rocm-device-libs}/lib"
31
31
+
"-DCMAKE_PREFIX_PATH=${rocm-thunk}"
32
32
+
];
24
33
25
25
-
# Use the ROCR_EXT_DIR environment variable and/or OpenGL driver
26
26
-
# link path to try to find binary-only ROCm runtime extension
27
27
-
# libraries. Without this change, we would have to rely on
28
28
-
# LD_LIBRARY_PATH to let the HSA runtime discover the shared
29
29
-
# libraries.
30
30
-
patchPhase = ''
31
31
-
substitute '${./rocr-ext-dir.diff}' ./rocr-ext-dir.diff \
32
32
-
--subst-var-by rocrExtDir "${addOpenGLRunpath.driverLink}/lib/rocm-runtime-ext"
33
33
-
patch -p2 < ./rocr-ext-dir.diff
34
34
+
postPatch = ''
35
35
+
patchShebangs image/blit_src/create_hsaco_ascii_file.sh
34
36
'';
35
37
36
38
fixupPhase = ''
37
37
-
rm -r $out/lib $out/include
38
38
-
mv $out/hsa/lib $out/hsa/include $out
39
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
1
-
diff --git a/src/core/runtime/runtime.cpp b/src/core/runtime/runtime.cpp
2
2
-
index dd6a15c..fb6de49 100644
3
3
-
--- a/src/core/runtime/runtime.cpp
4
4
-
+++ b/src/core/runtime/runtime.cpp
5
5
-
@@ -1358,7 +1358,17 @@ void Runtime::LoadExtensions() {
6
6
-
core::HsaApiTable::HSA_EXT_FINALIZER_API_TABLE_ID);
7
7
-
8
8
-
// Update Hsa Api Table with handle of Image extension Apis
9
9
-
- extensions_.LoadImage(kImageLib[os_index(os::current_os)]);
10
10
-
+ //
11
11
-
+ // Use ROCR_EXT_DIR when it is non-empty. Otherwise, try to load the
12
12
-
+ // library from the OpenGL driver path.
13
13
-
+ std::string extDirVar = os::GetEnvVar("ROCR_EXT_DIR");
14
14
-
+ if (!extDirVar.empty()) {
15
15
-
+ extensions_.LoadImage(extDirVar + "/" + kImageLib[os_index(os::current_os)]);
16
16
-
+ } else {
17
17
-
+ std::string globalDriverDir("@rocrExtDir@");
18
18
-
+ extensions_.LoadImage(globalDriverDir + "/" + kImageLib[os_index(os::current_os)]);
19
19
-
+ }
20
20
-
+
21
21
-
hsa_api_table_.LinkExts(&extensions_.image_api,
22
22
-
core::HsaApiTable::HSA_EXT_IMAGE_API_TABLE_ID);
23
23
-
}
+3
-1
pkgs/top-level/all-packages.nix
···
9354
9354
inherit (llvmPackages_rocm) clang clang-unwrapped lld llvm;
9355
9355
};
9356
9356
9357
9357
-
rocm-runtime = callPackage ../development/libraries/rocm-runtime { };
9357
9357
+
rocm-runtime = callPackage ../development/libraries/rocm-runtime {
9358
9358
+
inherit (llvmPackages_rocm) clang-unwrapped llvm;
9359
9359
+
};
9358
9360
9359
9361
rocm-runtime-ext = callPackage ../development/libraries/rocm-runtime-ext { };
9360
9362