Skip to content
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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "oneAPI"
uuid = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b"
version = "2.5.0"
authors = ["Tim Besard <[email protected]>"]
version = "2.5.1"
authors = ["Tim Besard <[email protected]>", "Alexis Montoison", "Michel Schanen <[email protected]>"]

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
24 changes: 23 additions & 1 deletion lib/level-zero/oneL0.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,35 @@ function __init__()

try
zeInit(0)
functional[] = true
catch err
# Handle the specific case where no oneAPI device is available
if err isa ZeError && err.code == RESULT_ERROR_UNINITIALIZED
functional[] = false
return
end
# For other errors, still report them as errors
@error "Failed to initialize oneAPI" exception=(err,catch_backtrace())
functional[] = false
return
end

# Check if there are actually any drivers/devices available
try
drv_count = Ref{UInt32}(0)
zeDriverGet(drv_count, C_NULL)
if drv_count[] == 0
@info "oneAPI initialized but no drivers found. oneAPI.jl will not be functional."
functional[] = false
return
end
catch err
@error "Failed to enumerate oneAPI drivers" exception = (err, catch_backtrace())
functional[] = false
return
end

functional[] = true

validation_layer[] = parse(Bool, get(ENV, "ZE_ENABLE_VALIDATION_LAYER", "false"))
parameter_validation[] = parse(Bool, get(ENV, "ZE_ENABLE_PARAMETER_VALIDATION", "false"))
end
Expand Down