Skip to content

[SYCL] Check access to /dev/dri/renderD* in sycl-ls #19520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

againull
Copy link
Contributor

This patch adds a check in sycl-ls to verify that the user has permission to access /dev/dri/renderD* device nodes, if they are present. If a device node exists but cannot be opened due to insufficient permissions (typically because the user is not in the render group), a clear warning is printed.

This helps users quickly identify missing group membership as the cause of device enumeration failures, instead of silently failing and requiring time-consuming troubleshooting.

This patch adds a check in sycl-ls to verify that the user has
permission to access /dev/dri/renderD* device nodes, if they are
present. If a device node exists but cannot be opened due to
insufficient permissions (typically because the user is not in
the render group), a clear warning is printed.

This helps users quickly identify missing group membership as the
cause of device enumeration failures, instead of silently failing
and requiring time-consuming troubleshooting.
@againull againull requested a review from a team as a code owner July 18, 2025 19:52
@againull againull requested a review from maarquitos14 July 18, 2025 19:52
@againull againull merged commit 2e736fb into intel:sycl Jul 18, 2025
26 checks passed
Comment on lines +356 to +358
// Check for /dev/dri/render* devices
for (int i = 128; i < 256; ++i) {
std::string path = std::string("/dev/dri/renderD") + std::to_string(i);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know for sure that renderD directory name will have a suffix in the range 128 - 255? Any doc?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is /dev/dri/renderD[128-255] directory only used by Intel GPUs?

Copy link
Contributor Author

@againull againull Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to find official documentation regardin number of render nodes, but according to this comment it used to be limited to 64 (starting with D128, ..) but that condition was relaxed:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpu/drm/drm_drv.c#n131
So I think better to just use globbing to find existing nodes, here is the follow-up patch:
#19538

According to my understanding, /dev/dri/renderD* is used not only by intel gpu graphics driver but also, for example, for ROCM (https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/docker.html#restricting-gpu-access).
in this case we generate general warning in verbose mode indicating that some permissions are missing which are necessary for gpgpu offloading on some backends (intel, rocm and probably something else).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. That makes sense.

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.

3 participants