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
33 changes: 16 additions & 17 deletions src/utilities/preference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,23 @@ const DEPS_MAP = Dict(
"CUDA_DRIVER" => "libcuda",
"CUDA_RUNTIME" => "libcudart",
)
function find_dependency_paths(::Type{LegatePreferences.JLL})
results = Dict{String,String}()

paths_to_search = copy(legate_jll.LIBPATH_list)
# If we have CUDA support try to find some other paths
if isdefined(legate_jll, :NCCL_jll)
append!(paths_to_search, legate_jll.NCCL_jll.CUDA_Runtime_jll.LIBPATH_list)
push!(
paths_to_search,
joinpath(legate_jll.NCCL_jll.CUDA_Runtime_jll.CUDA_Driver_jll.artifact_dir, "lib"),
)
end
function _legate_lib_search_paths(base::Vector{String})
paths = copy(base)
isdefined(legate_jll, :NCCL_jll) || return paths
nccl = legate_jll.NCCL_jll
append!(paths, nccl.CUDA_Runtime_jll.LIBPATH_list)
push!(paths, joinpath(nccl.CUDA_Runtime_jll.CUDA_Driver_jll.artifact_dir, "lib"))
return paths
end

for (name, lib) in DEPS_MAP
results[name] = dirname(Libdl.find_library(lib, paths_to_search))
end
return results
function find_dependency_paths(::Type{LegatePreferences.JLL})
paths = _legate_lib_search_paths(legate_jll.LIBPATH_list)
return Dict(name => dirname(Libdl.find_library(lib, paths)) for (name, lib) in DEPS_MAP)
end

find_dependency_paths(::Type{LegatePreferences.Developer}) = Dict{String,String}()
function find_dependency_paths(::Type{LegatePreferences.Developer})
isdefined(@__MODULE__, :legate_jll) || return Dict{String,String}()
paths = _legate_lib_search_paths(legate_jll.LIBPATH_list)
return Dict(name => dirname(Libdl.find_library(lib, paths)) for (name, lib) in DEPS_MAP)
end
find_dependency_paths(::Type{LegatePreferences.Conda}) = Dict{String,String}()
Loading