Skip to content

Prevent crash when libraries are unavailable during __init__#673

Merged
pxl-th merged 1 commit intoJuliaGPU:masterfrom
AntonReinhard:fix-error-handling
Sep 20, 2024
Merged

Prevent crash when libraries are unavailable during __init__#673
pxl-th merged 1 commit intoJuliaGPU:masterfrom
AntonReinhard:fix-error-handling

Conversation

@AntonReinhard
Copy link
Copy Markdown
Contributor

Changes the ENV[string] lookups to a get() with a default of "0". This prevents the ERROR: InitError: KeyError: key "JULIA_AMDGPU_CORE_MUST_LOAD" not found when running outside of the CI.

For example, previously I was getting

julia> using AMDGPU
┌ Warning: HSA runtime is unavailable, compilation and runtime functionality will be disabled.
└ @ AMDGPU ~/.julia/packages/AMDGPU/a1v0k/src/AMDGPU.jl:205
ERROR: InitError: KeyError: key "JULIA_AMDGPU_CORE_MUST_LOAD" not found
Stacktrace: ...

With this PR, I'm getting

julia> using AMDGPU
┌ Warning: HSA runtime is unavailable, compilation and runtime functionality will be disabled.
└ @ AMDGPU ~/.julia/packages/AMDGPU/zQy5G/src/AMDGPU.jl:205
...

julia> AMDGPU.functional()
false

as I would have expected for this case.

@pxl-th pxl-th merged commit 72e0aee into JuliaGPU:master Sep 20, 2024
@AntonReinhard AntonReinhard deleted the fix-error-handling branch November 15, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants