Problem with AMD integrated gpu on new Lenovo laptop

I recently bought a new Lenovo Ideapad Slim 3 laptop and I am having problems getting the amdgpu driver working properly in Arch Linux. The GPU seems to work fine straight away with a Mint live USB (glxgears plays, etc.); however, in the Arch system I am trying to install to the SSD, I get this error with glxinfo -B:

$ glxinfo -B
name of display: :0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  37
  Current serial number in output stream:  38

I can’t see any errors in the dmesg log relating to [drm] and amdgpu – the messages in Arch seem very similar to those in Mint. However, in Arch I see the following error in my Xorg.0.log file:

[    42.568] (II) Loading sub module "glamoregl"
[    42.568] (II) LoadModule: "glamoregl"
[    42.568] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[    42.572] (II) Module glamoregl: vendor="X.Org Foundation"
[    42.572]    compiled for 1.21.1.8, module version = 1.0.1
[    42.572]    ABI class: X.Org ANSI C Emulation, version 0.4
[    42.577] (EE) AMDGPU(0): eglGetDisplay() failed
[    42.577] (EE) AMDGPU(0): glamor detected, failed to initialize EGL.
[    42.577] (WW) AMDGPU(0): amdgpu_glamor_pre_init returned FALSE, using ShadowFB

The Xorg.0.log file for the Mint live USB doesn’t show this error:

[    17.992] (II) Loading sub module "glamoregl"
[    17.992] (II) LoadModule: "glamoregl"
[    17.992] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[    17.995] (II) Module glamoregl: vendor="X.Org Foundation"
[    17.995]    compiled for 1.21.1.3, module version = 1.0.1
[    17.995]    ABI class: X.Org ANSI C Emulation, version 0.4
[    18.028] (II) AMDGPU(0): glamor X acceleration enabled on AMD RENOIR (LLVM 13.0.1, DRM 3.42, 5.15.0-56-generic)
[    18.028] (II) AMDGPU(0): glamor detected, initialising EGL layer.

It seems likely this error is related to what is causing the problem. Does anyone know what might be causing this issue between amdgpu and glamor in Arch?

It’s a brand new laptop, with an AMD Ryzen 5 7530U CPU, with integrated Radeon graphics.

Asked By: Time4Tea

||

I have managed to resolve the issue myself. The Arch system was copied over from a previous machine that had an NVidia GPU, and there were some graphics packages still installed relating to NVidia. I removed those and now the 3D acceleration seems to be working properly (both glxinfo and glxgears work). The old NVidia packages were:

nvidia-340xx-dkms
nvidia-340xx-utils
opencl-nvidia-340xx
xf86-video-nouveau
ffnvcodec-headers

Hopefully this info might help, if someone else has a similar problem in future.

Answered By: Time4Tea
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.