diff --git a/src/discovery/utils.jl b/src/discovery/utils.jl index cd85d0bc3..11d1f6d0e 100644 --- a/src/discovery/utils.jl +++ b/src/discovery/utils.jl @@ -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 @@ -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