amdgpu_query_info fails with Permission denied
Issue description
I'm not sure yet if this is a bug in an application, mesa, libdrm or the even kernel: since the error at the top of the stack comes from libdrm I'm reporting it here. Sorry, If it's not the right place.
I'm seeing this error when an application tries to detect available displays/GPUs:
amdgpu_device_initialize: amdgpu_query_info(ACCEL_WORKING) failed (-13)
amdgpu: amdgpu_device_initialize failed.
Setting LIBGL_DEBUG
doesn't reveal more but it's clear it comes from this line:
amdgpu_query_info(dev, AMDGPU_INFO_ACCEL_WORKING, 4, &accel_working);
which results in the following system call:
ioctl(10, DRM_IOCTL_AMDGPU_INFO or DRM_IOCTL_SIS_FB_FREE, 0x7ffe9c9aeb00) = -1 EACCES (Permission denied)
Now, I'm not sure how strace works, but it detected the ioctl number is either DRM_IOCTL_AMDGPU_INFO
or DRM_IOCTL_SIS_FB_FREE
, which I confirmed is correct by looking it up in the sources: it's 0x05.
The full ioctl number is 0x40206445, obtained by printing the raw arguments. I checked that this number is the same you can see in a strace when glxgears (which works normally) is starting up, so it must be that this call is querying different informations resulting in an error, but I can't easily see which for a trace.
It would probably help me debugging the issue if you could tell me what ACCEL_WORKING exactly means.
Note: After seeing the DRM_IOCTL_SIS_FB_FREE
in the trace I thought that maybe it was checking
whether the framebuffer was free (it's not: this is a GTK application running under X.org).
Strangely enough, if I quickly switch to a free tty just before the call, it succeeds!
ioctl(10, DRM_IOCTL_AMDGPU_INFO or DRM_IOCTL_SIS_FB_FREE, 0x7fffe9ed86a0) = 0
How is this possible?
Version Information
mesa: 19.3.5
libdrm: 2.4.100
linux: 5.7.18