Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/discovery/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ function check_rocm_path(path::String)
isfile(joinpath(path2, libname)) && @goto success
path2 = joinpath(path, "lib64")
isfile(joinpath(path2, libname)) && @goto success
# Check Debian/Ubuntu multiarch lib paths (e.g. /usr/lib/x86_64-linux-gnu)
if Sys.islinux()
for triplet in ("x86_64-linux-gnu", "aarch64-linux-gnu", "i386-linux-gnu")
path2 = joinpath(path, "lib", triplet)
isfile(joinpath(path2, libname)) && @goto success
end
end
return ""

@label success
Expand Down Expand Up @@ -137,9 +144,9 @@ function find_ld_lld(rocm_path::String)::String
run(pipeline(`$exp_ld_path -v`; stdout=tmpfile))
vstr = read(tmpfile, String)
rm(tmpfile)
vstr = replace(vstr, "AMD " => "")
vstr_splits = split(vstr, ' ')
if VersionNumber(vstr_splits[2]) >= v"6.0.0"
# Match first version number in the output, e.g. "AMD LLD 15.0.0 ..." or "Ubuntu LLD 21.0.0 ..."
m = match(r"(\d+\.\d+(?:\.\d+)?)", vstr)
if m !== nothing && VersionNumber(m.captures[1]) >= v"6.0.0"
return exp_ld_path
end
catch
Expand Down