Problem with libdrm and amdgpu-pro

I have the same problem

I have a Radeon Vega card and I’m currently using AMDGPU drivers (mesa), but I can give AMDGPU-Pro a try. Which snap should I install?

You need to install driver from here https://www.amd.com/en/support/graphics/radeon-rx-vega-series/radeon-rx-vega-series/radeon-rx-vega-64 or 56 if u have.

And u can for test use this project https://github.com/QuasarApp/Console-QtDeployer.git

Or I’ll come home in the evening and send you my package, which just doesn’t work.

I grabbed qml-hello-world from the store. Can you check that it fails for you?

The problem must also be reproduced on this package.
install and run on PC with AMDGPU-PRO drivers
the name of programm : cqtdeployerexample

This is my QML app managetime
You can install it and get that error result about what I wrote.

I tried to install and run this application. It also does not work.
Here is the error log

libGL error: unable to load driver: amdgpu_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: amdgpu
libGL error: unable to load driver: amdgpu_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: amdgpu
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed:
“”
QOpenGLShaderProgram::uniformLocation( matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( opacity ): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed:
“”
QOpenGLShaderProgram::uniformLocation( matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( textureScale ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( color ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( alphaMin ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( alphaMax ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( fontScale ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( vecDelta ): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed:

i belive that amdgpu driver linked above installs somewhere in /opt or /var/opt … i assume thats not part of the opengl interface

I’ve spent some time debugging this today and observed the problem you indicated.

I suspect the thing comes down to the fact that OpenGL stack shipped by AMDGPU-PRO is not available inside the snap mount namespace and the proprietary amdgpu kernel driver is incompatible with Mesa.

We have some workarounds to deal with identical problem in NVIDIA proprietary stack. There is some work on improving OpenGL story of snaps scheduled already, so hopefully will have a proper solution rather than an ugly nvidia-like hack. I’ve poked at different things and collected some data in the process. The userspace bits seem a bit lacking compared to what NVIDIA ships (eg, lack of glvnd), though it’s unclear if that will affect us.

If I understand you correctly, need to wait for some additions in the snapcraft so that this problem is resolved?
How soon can this be fixed?
And one more question is, will this decision require some additional parameters in snapcraft?

The whole package you download from amd.com actually ships 2 drivers.

There is the open source amdgpu driver (under /opt/amdgpu), which AFAICT does not require extra kernel bits. It’s basically a rebuild of 18.2 mesa with llvm 7.0. On Ubuntu 18.04, the driver version is newer than what shipped with the distro. Given how new functionality is landing in the

And then there is amdgpu-pro proprietary driver (under /opt/amdgpu-pro). This one uses a kernel module named amdgpu (named identically to the mainline driver) and ships the userspace bits (libGL, libEGL, libGLESv2). However it lack support for glvnd, so it will not work without tricks when there is more than one GPU involved. On the bright side of things, the kernel module has /sys/module/kernel/version which we can use for probing if the driver is in use. I do not know how close the kernel module is to the mainline. I read it supports FreeSync and stuff, which has landed in mainline only recently. The lack of glvnd, hopefully makes supporting the userspace stack similar to the old NVIDIA driver releases (pre 400.x ones).

Vulkan story seems to be interesting. The pro driver ships amdvlk with corresponding ICD files.

Finally, both drivers end up being added under /etc/ld.so.conf.d, with the proprietary one taking priority.

The user can install just the open source driver. In fact, the open source driver is recommended for consumer products (at least according to release notes).

I don’t know about changes on the snapcraft side (maybe none are needed?). However, we will be addressing the problem on snapd side.

well, what i meant is that the snap opengl interface typically forwards /usr/lib/$ARCH_TRIPLET/dri/ into the snap environment so the dri modules of the host are available … if the drivers live in /opt this wont happen …

one option to (grossly) hack around that issue could be to actually ship the driver inside the snap by putting it into some valid library search path under $SNAP (though this will likely break the first time there are newer symbols on one of the sides (driver vs host versions))

If amdgpu-pro put in a snap package, could it simplify its work in the system?

I tried to install and run this application without a amdgpu-pro. Here is a log

qml-hello-world
libGL error: unable to load driver: amdgpu_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: amdgpu
libGL error: unable to load driver: amdgpu_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: amdgpu

This is the log after running my application.
managetime
/usr/share/libdrm/amdgpu.ids: No such file or directory

@ogra any update on this?

i neither have that hardware nor do i work on that interface, thats a thing for @mborzecki or someone from his team i guess …

The snap ogre seems to properly handle the issue:

I get the errors about amdgpu.ids:no such file or directory when using the opensource amd drivers on retroarch.

See https://github.com/libretro/retroarch-snap/issues/32