From e88ccdedec3231b1838f4c7a097c620c64ddf271 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 2 Dec 2026 17:46:28 +0100 Subject: [PATCH] Explain a permission error when initializing oneAPI When the user cannot open the GPU's render node in /dev/dri, zeInit fails with ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS, which was reported as a generic initialization failure with a backtrace. Say instead that the user needs access to the render node, usually by joining its group. Closes #168. --- lib/level-zero/oneL0.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/level-zero/oneL0.jl b/lib/level-zero/oneL0.jl index c5a694d9..e3fa7ad8 100644 --- a/lib/level-zero/oneL0.jl +++ b/lib/level-zero/oneL0.jl @@ -221,6 +221,15 @@ function initialize(; quiet::Bool=false) functional[] = false return end + # The driver could not open the GPU's render node: point at the usual fix rather + # than printing a backtrace. + if err isa ZeError && err.code == RESULT_ERROR_INSUFFICIENT_PERMISSIONS + quiet || @error """Failed to initialize oneAPI: no permission to access the GPU. + Make sure your user can read and write the GPU's render node in /dev/dri, + usually by joining the group that owns it (`render` on most systems).""" + functional[] = false + return + end # For other errors, still report them as errors quiet || @error "Failed to initialize oneAPI" exception=(err,catch_backtrace()) functional[] = false