Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix artifact discovery in global project #541

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
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
9 changes: 3 additions & 6 deletions src/discovery/discovery.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module ROCmDiscovery

using ROCmDeviceLibs_jll
using Preferences
using Libdl

Expand Down Expand Up @@ -67,13 +68,9 @@
end
end

function get_device_libs(
from_artifact::Bool;
artifact_library::Symbol = :ROCmDeviceLibs_jll,
artifact_field::Symbol = :bitcode_path,
)
function get_device_libs(from_artifact::Bool)
if from_artifact
get_artifact_library(artifact_library, artifact_field)
ROCmDeviceLibs_jll.bitcode_path

Check warning on line 73 in src/discovery/discovery.jl

View check run for this annotation

Codecov / codecov/patch

src/discovery/discovery.jl#L73

Added line #L73 was not covered by tests
else
find_device_libs()
end
Expand Down
4 changes: 4 additions & 0 deletions src/discovery/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
(;amdgpu_project, current_project, julia_project) = projects
if current_project !== nothing
jl_str = "push!(LOAD_PATH, \"$current_project\");" * jl_str
else
# If Julia is using global project, instantiate `julia_project`.
# Otherwise, we'll fail to discover artifacts.
jl_str = "import Pkg; Pkg.instantiate(;io=devnull); " * jl_str

Check warning on line 31 in src/discovery/utils.jl

View check run for this annotation

Codecov / codecov/patch

src/discovery/utils.jl#L31

Added line #L31 was not covered by tests
end
jl_str = "push!(LOAD_PATH, \"$amdgpu_project\");" * jl_str
append!(cmd.exec, ("-e", jl_str))
Expand Down