<div dir="auto">It’s been a while for me, but you might check if you have an issue with permissions. A quick check would be to see if glxgears works when run as root.</div><div dir="auto"><br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" dir="auto">
Hi all!<br>
<br>
The last days I've been struggling with mesa3d to get GPU acceleration <br>
on X, on my Raspberry Pi 4 Model B. Maybe someone knows how to deal with it.<br>
<br>
Using Buildroot I've compiled a system with mesa3d, using KMSRO, V3D and <br>
VC4 Gallium drivers. X11 is starting up, stating that DRI is initialised <br>
and everything seems to work. But when I run glxinfo or glxgears, it is <br>
stating 'Failed to open bo 1: Permission denied'. glxgears opens a <br>
window which simply stays black. So I started to track it down and ended <br>
up in drivers/drm/drm_ioctl.c.<br>
<br>
The specific function that returns EACCES (-13) is drm_ioctl_permit(). <br>
To identify the failing condition I've added some DRM_DEBUG() for each <br>
one of the four condition there. After enabling drm.debug with<br>
<br>
# echo 0xf > /sys/module/drm/parameters/debug<br>
<br>
I see that it fails on the DRM_RENDER_ALLOW condition. I don't know how <br>
this all works together and what it means, in detail. So I'm lost now. I <br>
assume that X11 is occupying the exclusive access to the render node <br>
/dev/dri/renderD128. But how does glxgears should work now? What I'm <br>
trying to archive is to run chromium with GPU acceleration, but the GPU <br>
process is crashing and reverts to software rendering.<br>
<br>
When running glxinfo it is showing all the renderer information, which <br>
looks good, though it shows that permission denied too. All programs are <br>
running as root at the moment and the filesystem permissions look good.<br>
<br>
As I said, I'm lost and don't know that much about all this to go any <br>
further, so I'm stuck at it now. I hope someone here got the missing <br>
piece for me to get it working, though I'm not sure wether it is the <br>
right place for this question. May be it's related to kernel <br>
configuration, to the Raspberry firmware, or what so ever. But I even <br>
don't know that.<br>
<br>
Software used:<br>
<br>
Mesa3D 20.3.4<br>
Linux 5.10.y (branch at <a href="http://github.com/raspberrypi/linux" rel="noreferrer" target="_blank">github.com/raspberrypi/linux</a>)<br>
Firmware stable (branch at <a href="http://github.com/raspberrypi/firmware" rel="noreferrer" target="_blank">github.com/raspberrypi/firmware</a>)<br>
<br>
Thank you in advance. Further down you will find some output from strace <br>
and drm.debug.<br>
<br>
Best regards,<br>
<br>
Michael<br>
<br>
==== strace of glxgears<br>
openat(AT_FDCWD, "/dev/dri/renderD128", O_RDWR|O_LARGEFILE|O_CLOEXEC) = 6<br>
ioctl(6, DRM_IOCTL_VERSION, 0x15084e0) = 0<br>
ioctl(6, DRM_IOCTL_VERSION, 0x15084e0) = 0<br>
ioctl(6, DRM_IOCTL_GET_UNIQUE, 0xbedebcd0) = -1 EACCES (Permission denied)<br>
ioctl(6, DRM_IOCTL_EXYNOS_GEM_GET or DRM_IOCTL_PANFROST_GET_PARAM or DRM_IOCTL_QXL_GETPARAM or DRM_IOCTL_SIS_FB_ALLOC or DRM_IOCTL_TEGRA_SYNCPT_WAIT or DRM_IOCTL_V3D_GET_PARAM or DRM_IOCTL_VC4_MMAP_BO, 0xbedebf00) = 0<br>
ioctl(6, DRM_IOCTL_EXYNOS_GEM_GET or DRM_IOCTL_PANFROST_GET_PARAM or DRM_IOCTL_QXL_GETPARAM or DRM_IOCTL_SIS_FB_ALLOC or DRM_IOCTL_TEGRA_SYNCPT_WAIT or DRM_IOCTL_V3D_GET_PARAM or DRM_IOCTL_VC4_MMAP_BO, 0xbedebf10) = 0<br>
ioctl(6, DRM_IOCTL_EXYNOS_GEM_GET or DRM_IOCTL_PANFROST_GET_PARAM or DRM_IOCTL_QXL_GETPARAM or DRM_IOCTL_SIS_FB_ALLOC or DRM_IOCTL_TEGRA_SYNCPT_WAIT or DRM_IOCTL_V3D_GET_PARAM or DRM_IOCTL_VC4_MMAP_BO, 0xbedebf28) = 0<br>
ioctl(6, DRM_IOCTL_EXYNOS_GEM_GET or DRM_IOCTL_PANFROST_GET_PARAM or DRM_IOCTL_QXL_GETPARAM or DRM_IOCTL_SIS_FB_ALLOC or DRM_IOCTL_TEGRA_SYNCPT_WAIT or DRM_IOCTL_V3D_GET_PARAM or DRM_IOCTL_VC4_MMAP_BO, 0xbedebf28) = 0<br>
ioctl(4, DRM_IOCTL_GET_CAP, 0xbedebf90) = 0<br>
ioctl(6, DRM_IOCTL_SYNCOBJ_CREATE, 0xbedec770) = 0<br>
ioctl(6, DRM_IOCTL_AMDGPU_CTX or DRM_IOCTL_ETNAVIV_GEM_NEW or DRM_IOCTL_LIMA_GEM_INFO or DRM_IOCTL_MSM_GEM_NEW or DRM_IOCTL_V3D_CREATE_BO or DRM_IOCTL_VC4_WAIT_BO, 0xbedec460) = 0<br>
ioctl(6, DRM_IOCTL_ETNAVIV_GEM_INFO or DRM_IOCTL_OMAP_GEM_NEW or DRM_IOCTL_PANFROST_MMAP_BO or DRM_IOCTL_V3D_MMAP_BO or DRM_IOCTL_VC4_CREATE_BO or DRM_IOCTL_VIRTGPU_GETPARAM, 0xbedec410) = 0<br>
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 7<br>
ioctl(6, DRM_IOCTL_AMDGPU_CTX or DRM_IOCTL_ETNAVIV_GEM_NEW or DRM_IOCTL_LIMA_GEM_INFO or DRM_IOCTL_MSM_GEM_NEW or DRM_IOCTL_V3D_CREATE_BO or DRM_IOCTL_VC4_WAIT_BO, 0xbedec240) = 0<br>
ioctl(6, DRM_IOCTL_ETNAVIV_GEM_INFO or DRM_IOCTL_OMAP_GEM_NEW or DRM_IOCTL_PANFROST_MMAP_BO or DRM_IOCTL_V3D_MMAP_BO or DRM_IOCTL_VC4_CREATE_BO or DRM_IOCTL_VIRTGPU_GETPARAM, 0xbedec210) = 0<br>
ioctl(6, DRM_IOCTL_GEM_OPEN, 0xbedec818) = -1 EACCES (Permission denied)<br>
write(2, "V3D:-1:: Failed to open bo 2: Pe"..., 48V3D:-1:: Failed to open bo 2: Permission denied<br>
ioctl(6, DRM_IOCTL_SYNCOBJ_CREATE, 0xbedec6d8) = 0<br>
ioctl(6, DRM_IOCTL_AMDGPU_CTX or DRM_IOCTL_ETNAVIV_GEM_NEW or DRM_IOCTL_LIMA_GEM_INFO or DRM_IOCTL_MSM_GEM_NEW or DRM_IOCTL_V3D_CREATE_BO or DRM_IOCTL_VC4_WAIT_BO, 0xbedec3c8) = 0<br>
ioctl(6, DRM_IOCTL_ETNAVIV_GEM_INFO or DRM_IOCTL_OMAP_GEM_NEW or DRM_IOCTL_PANFROST_MMAP_BO or DRM_IOCTL_V3D_MMAP_BO or DRM_IOCTL_VC4_CREATE_BO or DRM_IOCTL_VIRTGPU_GETPARAM, 0xbedec378) = 0<br>
ioctl(6, DRM_IOCTL_AMDGPU_CTX or DRM_IOCTL_ETNAVIV_GEM_NEW or DRM_IOCTL_LIMA_GEM_INFO or DRM_IOCTL_MSM_GEM_NEW or DRM_IOCTL_V3D_CREATE_BO or DRM_IOCTL_VC4_WAIT_BO, 0xbedec1a8) = 0<br>
ioctl(6, DRM_IOCTL_ETNAVIV_GEM_INFO or DRM_IOCTL_OMAP_GEM_NEW or DRM_IOCTL_PANFROST_MMAP_BO or DRM_IOCTL_V3D_MMAP_BO or DRM_IOCTL_VC4_CREATE_BO or DRM_IOCTL_VIRTGPU_GETPARAM, 0xbedec178) = 0<br>
ioctl(6, DRM_IOCTL_GEM_OPEN, 0xbedec818) = -1 EACCES (Permission denied)<br>
write(2, "V3D:-1:: Failed to open bo 2: Pe"..., 48V3D:-1:: Failed to open bo 2: Permission denied<br>
<br>
<br>
<br>
<br>
====== drm.debug<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.920528] [drm:drm_stub_open [drm]]<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.920751] [drm:drm_open [drm]] comm="glxgears", pid=448, minor=1<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.920995] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_GET_MAGIC<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.921207] [drm:drm_getmagic [drm]] 1<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.921520] [drm:drm_ioctl [drm]] comm="Xorg" pid=237, dev=0xe201, auth=1, DRM_IOCTL_AUTH_MAGIC<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.921733] [drm:drm_authmagic [drm]] 1<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.922042] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.922257] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.929723] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.929942] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.944279] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.944500] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.950969] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.951187] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.956154] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe201, auth=1, VC4_GET_PARAM<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.956367] [drm:drm_ioctl [drm]] comm="glxgears", pid=448, ret=-19<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.956652] [drm:drm_stub_open [drm]]<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.956870] [drm:drm_open [drm]] comm="glxgears", pid=448, minor=128<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.957103] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe280, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.957317] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe280, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.957548] [drm:drm_release [drm]] open_count = 3<br>
Mar 14 18:55:47 buildroot user.debug kernel: [35999.957754] [drm:drm_file_free.part.0 [drm]] comm="glxgears", pid=448, dev=0xe280, open_count=3<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.050627] [drm:drm_stub_open [drm]]<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.050844] [drm:drm_open [drm]] comm="glxgears", pid=448, minor=128<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.051068] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe280, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.051279] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe280, auth=1, DRM_IOCTL_VERSION<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.051502] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe280, auth=1, DRM_IOCTL_GET_UNIQUE<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.051704] [drm:drm_ioctl_permit [drm]] DRM_RENDER_ALLOW<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.051905] [drm:drm_ioctl [drm]] comm="glxgears", pid=448, ret=-13<br>
...snip...<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.121036] [drm:drm_ioctl [drm]] comm="glxgears" pid=448, dev=0xe280, auth=1, DRM_IOCTL_GEM_OPEN<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.121241] [drm:drm_ioctl_permit [drm]] DRM_RENDER_ALLOW<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.121433] [drm:drm_ioctl [drm]] comm="Xorg" pid=237, dev=0xe280, auth=1, V3D_MMAP_BO<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.121635] [drm:drm_ioctl [drm]] comm="glxgears", pid=448, ret=-13<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.121825] [drm:drm_ioctl [drm]] comm="Xorg" pid=237, dev=0xe280, auth=1, V3D_WAIT_BO<br>
Mar 14 18:55:47 buildroot user.debug kernel: [36000.122071] [drm:drm_ioctl [drm]] comm="Xorg" pid=237, dev=0xe280, auth=1, V3D_SUBMIT_CL<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://lists.freedesktop.org/archives/mesa-users/attachments/20210314/4dc3eead/attachment-0001.htm" rel="noreferrer" target="_blank">https://lists.freedesktop.org/archives/mesa-users/attachments/20210314/4dc3eead/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
mesa-users mailing list<br>
<a href="mailto:mesa-users@lists.freedesktop.org" target="_blank">mesa-users@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-users" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-users</a><br>
<br>
<br>
------------------------------<br>
<br>
End of mesa-users Digest, Vol 130, Issue 3<br>
******************************************<br>
</blockquote></div></div>