Skip to content

Mention device-node permissions when no oneAPI device is found - #765

Open
ShauryaAttreya37 wants to merge 2 commits into
JuliaGPU:mainfrom
ShauryaAttreya37:device-access-hint
Open

ShauryaAttreya37 wants to merge 2 commits into
JuliaGPU:mainfrom
ShauryaAttreya37:device-access-hint

Conversation

@ShauryaAttreya37

Copy link
Copy Markdown

Closes #168.

As discussed in #168, a common reason oneAPI.jl is not functional on a machine with a supported Intel GPU is that the user cannot open the GPU's device node in /dev/dri (not in the render/video group). The driver then finds no device, zeInit fails with RESULT_ERROR_UNINITIALIZED, and initialize returns without saying anything, so there is no clue to the cause.

Change

oneL0.device_access_hint() looks for Intel render nodes (/dev/dri/renderD* whose /sys/class/drm/<node>/device/vendor is 0x8086). If there are some and none can be opened for reading and writing (access(2) with R_OK|W_OK), it returns a sentence naming the nodes and how to fix it:

┌ Warning: oneAPI found no usable device. You do not have read and write access to the Intel GPU's device node (/dev/dri/renderD128). Add your user to the group that owns it (usually `render`, or `video` on older systems), for example with `sudo usermod -aG render $USER`, then log out and back in.

Otherwise it returns nothing. That includes machines without an Intel GPU and non-Linux systems, so the RESULT_ERROR_UNINITIALIZED case stays silent there as before. The hint is also appended to the "Failed to initialize oneAPI" error and the "no drivers found" message. quiet = true still suppresses everything.

Testing

New device access hint testset in test/level-zero.jl, using a fake dri/sysfs tree: an accessible Intel node (no hint), an inaccessible one (hint naming the node; skipped as root), an inaccessible node of another vendor (no hint), no nodes, and missing folders.

I ran that testset against this branch's oneL0.jl definitions on Julia 1.13.1 (Linux): 5/5 pass. On this machine, which has an Intel GPU with an accessible renderD128, device_access_hint() returns nothing. I did not run the full GPU suite locally, and the warning path inside initialize itself is only exercised when zeInit fails, which I could not trigger without changing the real device permissions.

This change was written with AI assistance and reviewed before submitting.

ShauryaAttreya37 and others added 2 commits November 11, 2026 21:37
When the user cannot open the Intel GPU's render node, the driver finds
no device and zeInit fails with RESULT_ERROR_UNINITIALIZED, which
oneAPI.jl handled silently. Look for Intel render nodes under /dev/dri
(vendor 0x8086 in sysfs) and, if none can be opened for reading and
writing, warn with how to join the owning group. Machines without an
Intel GPU stay quiet. The hint is also added to the other
initialization failures.

Closes JuliaGPU#168.
Only append the hint when there is one, so messages no longer end in a
dangling ". "; skip probing the device nodes when quiet; and suggest
joining the group that actually owns the render node (falling back to
render/video when it can't be determined or is root).
@michel2323 michel2323 added the alcf-ci Run ALCF Aurora CI (GitLab) on this fork PR label Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.33333% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.71%. Comparing base (ebbaa28) to head (b264f63).

Files with missing lines Patch % Lines
lib/level-zero/oneL0.jl 63.33% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #765      +/-   ##
==========================================
- Coverage   86.94%   86.71%   -0.24%     
==========================================
  Files          55       55              
  Lines        5195     5163      -32     
==========================================
- Hits         4517     4477      -40     
- Misses        678      686       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alcf-ci Run ALCF Aurora CI (GitLab) on this fork PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check/mention permissions in initialization error message

2 participants