Skip to content

Commit c0ceec1

Browse files
committed
revert to using separate artifact for device libs
1 parent 6aefe48 commit c0ceec1

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
2626
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
2727
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
2828
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
29+
ROCmDeviceLibs_jll = "873c0968-716b-5aa7-bb8d-d1e2e2aeff2d"
2930
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3031
Random123 = "74087812-796a-5b5d-8853-05524746bad3"
3132
RandomNumbers = "e6cf234a-135c-5ec9-84dd-332b85af5143"
@@ -65,6 +66,7 @@ LazyArtifacts = "1.10"
6566
Libdl = "1.10"
6667
Preferences = "1"
6768
PrettyTables = "3"
69+
ROCmDeviceLibs_jll = "=5.6.1, =6.2.1, =7.0.2"
6870
Random123 = "1.6"
6971
RandomNumbers = "1.5"
7072
SpecialFunctions = "2"

src/discovery/discovery.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export librocblas, librocsparse, librocsolver
55
export librocrand, librocfft, libMIOpen_path
66

77
using LLD_jll
8+
using ROCmDeviceLibs_jll
89
using LazyArtifacts
910
using Preferences
1011
using Libdl
@@ -26,6 +27,14 @@ function get_ld_lld(rocm_path::String)::Tuple{String, Bool}
2627
return (LLD_jll.lld_path, true)
2728
end
2829

30+
function get_device_libs(from_artifact::Bool; rocm_path::String)
31+
if from_artifact && ROCmDeviceLibs_jll.is_available()
32+
ROCmDeviceLibs_jll.bitcode_path
33+
else
34+
find_device_libs(rocm_path)
35+
end
36+
end
37+
2938
function _hip_runtime_version()
3039
v_ref = Ref{Cint}()
3140
res = ccall((:hipRuntimeGetVersion, libhip), UInt32, (Ptr{Cint},), v_ref)
@@ -80,7 +89,9 @@ function __init__()
8089
global lld_artifact = lld_artifact
8190
global libhip = find_rocm_library(Sys.islinux() ? "libamdhip64" : "amdhip64"; rocm_path)
8291

83-
global libdevice_libs = find_device_libs(rocm_path)
92+
# Always load artifact device libraries.
93+
from_artifact = true
94+
global libdevice_libs = get_device_libs(from_artifact; rocm_path)
8495

8596
# HIP-based libraries.
8697
global librocblas = find_rocm_library(lib_prefix * "rocblas"; rocm_path)

0 commit comments

Comments
 (0)