File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,18 +81,28 @@ include("residency.jl")
8181const functional = Ref {Bool} (false )
8282
8383function __init__ ()
84- res = unsafe_zeInit (0 )
85- if res == RESULT_ERROR_UNINITIALIZED
86- @error """ No compatible oneAPI driver implementation found.
87- Your hardware probably is not supported by any oneAPI driver.
88-
89- oneAPI.jl currently only supports the Intel Compute runtime,
90- consult their README for a list of compatible hardware:
91- https://github.com/intel/compute-runtime#supported-platforms"""
92- elseif res != = RESULT_SUCCESS
93- throw_api_error (res)
94- else
84+ precompiling = ccall (:jl_generating_output , Cint, ()) != 0
85+ precompiling && return
86+
87+ if ! oneAPI_Level_Zero_Loader_jll. is_available ()
88+ @error """ No oneAPI Level Zero loader found for your platform. Currently, only Linux x86 is supported.
89+ If you have a local oneAPI toolchain, you can use that; refer to the documentation for more details."""
90+ return
91+ end
92+
93+ if ! NEO_jll. is_available ()
94+ @error """ No oneAPI driver found for your platform. Currently, only Linux x86_64 is supported.
95+ If you have a local oneAPI toolchain, you can use that; refer to the documentation for more details."""
96+ return
97+ end
98+
99+ try
100+ zeInit (0 )
95101 functional[] = true
102+ catch err
103+ @error " Failed to initialize oneAPI" exception= (err,catch_backtrace ())
104+ functional[] = false
105+ return
96106 end
97107end
98108
Original file line number Diff line number Diff line change @@ -68,11 +68,11 @@ include("utils.jl")
6868
6969function __init__ ()
7070 precompiling = ccall (:jl_generating_output , Cint, ()) != 0
71- if ! precompiling
72- eval (overrides)
73- end
71+ precompiling && return
7472
75- # ensure that libopencl.so
73+ eval (overrides)
74+
75+ # ensure that the OpenCL runtime dispatcher finds the ICD files from our artifacts
7676 ENV [" OCL_ICD_VENDORS" ] = oneL0. NEO_jll. libigdrcl
7777end
7878
You can’t perform that action at this time.
0 commit comments