diff --git a/src/discovery/utils.jl b/src/discovery/utils.jl index 12b64911a..25df92c60 100644 --- a/src/discovery/utils.jl +++ b/src/discovery/utils.jl @@ -63,6 +63,7 @@ function find_rocm_library(lib::String, dirs::Vector{String}, ext::String = dlex isempty(path) || return Libdl.dlpath(path) for dir in dirs + dir = joinpath(dir, Sys.islinux() ? "lib" : "bin") files = readdir(dir) for file in files matched = startswith(basename(file), lib * ".$ext") @@ -96,20 +97,22 @@ end function find_ld_lld(rocm_paths::Vector{String}) lld_name = "ld.lld" * (Sys.iswindows() ? ".exe" : "") for path in rocm_paths - exp_ld_path = joinpath(path, lld_name) - if ispath(exp_ld_path) - try - tmpfile = tempname(;cleanup=false) - 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" - return exp_ld_path + for subdir in (joinpath("llvm", "bin"), "bin") + exp_ld_path = joinpath(path, subdir, lld_name) + if ispath(exp_ld_path) + try + tmpfile = tempname(;cleanup=false) + 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" + return exp_ld_path + end + catch + @debug "bindeps: Failed running ld.lld in $exp_ld_path" end - catch - @debug "bindeps: Failed running ld.lld in $exp_ld_path" end end end