You are not logged in.

#1 2020-01-12 21:17:34

zaxmyth
Member
From: Seattle / San Francisco
Registered: 2019-03-25
Posts: 25
Website

X Error of failed request: BadValue with NVIDIA drivers installed

I have a Lenovo Thinkpad X1 Extreme (Gen 2) and I'm trying to get nvidia drivers working. Ultimately, I'm hoping to setup optimus-manager to toggle between nvidia and intel cards but at the moment, I'm just trying to get GLX working with the nvidia driver because glxinfo is required for optimus-manager to switch.

I have the following nvidia packages installed:

local/libvdpau 1.3-1
    Nvidia VDPAU library
local/nvidia 440.44-10
    NVIDIA drivers for linux
local/nvidia-utils 440.44-2
    NVIDIA drivers utilities

Output of lspci -k | grep -A 2 -E "(VGA|3D)"

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile) (rev 02)
	Subsystem: Lenovo UHD Graphics 630 (Mobile)
	Kernel driver in use: i915
--
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f91 (rev a1)
	Subsystem: Lenovo Device 229f
	Kernel driver in use: nvidia

With the nvidia drivers installed, running glxinfo results in

name of display: :1
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  39
  Current serial number in output stream:  40

Output from ls -l /usr/lib/lib{gl,GL}*:

lrwxrwxrwx 1 root root      13 Jan 11 07:55 /usr/lib/libglapi.so -> libglapi.so.0
lrwxrwxrwx 1 root root      17 Jan 11 07:55 /usr/lib/libglapi.so.0 -> libglapi.so.0.0.0
-rwxr-xr-x 1 root root  218952 Jan 11 07:55 /usr/lib/libglapi.so.0.0.0
lrwxrwxrwx 1 root root      18 Jan  6 06:41 /usr/lib/libGLdispatch.so -> libGLdispatch.so.0
lrwxrwxrwx 1 root root      22 Jan  6 06:41 /usr/lib/libGLdispatch.so.0 -> libGLdispatch.so.0.0.0
-rwxr-xr-x 1 root root  710472 Jan  6 06:41 /usr/lib/libGLdispatch.so.0.0.0
lrwxrwxrwx 1 root root      24 Jan  1 06:38 /usr/lib/libGLESv1_CM_nvidia.so -> libGLESv1_CM_nvidia.so.1
lrwxrwxrwx 1 root root      29 Jan  1 06:38 /usr/lib/libGLESv1_CM_nvidia.so.1 -> libGLESv1_CM_nvidia.so.440.44
-rwxr-xr-x 1 root root   63696 Jan  1 06:38 /usr/lib/libGLESv1_CM_nvidia.so.440.44
lrwxrwxrwx 1 root root      21 Jan  1 06:38 /usr/lib/libGLESv2_nvidia.so -> libGLESv2_nvidia.so.2
lrwxrwxrwx 1 root root      26 Jan  1 06:38 /usr/lib/libGLESv2_nvidia.so.2 -> libGLESv2_nvidia.so.440.44
-rwxr-xr-x 1 root root  111416 Jan  1 06:38 /usr/lib/libGLESv2_nvidia.so.440.44
lrwxrwxrwx 1 root root      14 Jan  6 06:41 /usr/lib/libGLESv2.so -> libGLESv2.so.2
lrwxrwxrwx 1 root root      18 Jan  6 06:41 /usr/lib/libGLESv2.so.2 -> libGLESv2.so.2.1.0
-rwxr-xr-x 1 root root   71424 Jan  6 06:41 /usr/lib/libGLESv2.so.2.1.0
lrwxrwxrwx 1 root root      16 Aug  3  2017 /usr/lib/libGLEW.so -> libGLEW.so.2.1.0
lrwxrwxrwx 1 root root      16 Aug  3  2017 /usr/lib/libGLEW.so.2.1 -> libGLEW.so.2.1.0
-rw-r--r-- 1 root root  665608 Aug  3  2017 /usr/lib/libGLEW.so.2.1.0
lrwxrwxrwx 1 root root      16 Dec 19 08:54 /usr/lib/libglib-2.0.so -> libglib-2.0.so.0
lrwxrwxrwx 1 root root      23 Dec 19 08:54 /usr/lib/libglib-2.0.so.0 -> libglib-2.0.so.0.6200.4
-rwxr-xr-x 1 root root 1191192 Dec 19 08:54 /usr/lib/libglib-2.0.so.0.6200.4
lrwxrwxrwx 1 root root      22 Sep 18 14:42 /usr/lib/libglibmm-2.4.so -> libglibmm-2.4.so.1.3.0
lrwxrwxrwx 1 root root      22 Sep 18 14:42 /usr/lib/libglibmm-2.4.so.1 -> libglibmm-2.4.so.1.3.0
-rwxr-xr-x 1 root root  563000 Sep 18 14:42 /usr/lib/libglibmm-2.4.so.1.3.0
lrwxrwxrwx 1 root root      42 Sep 18 14:42 /usr/lib/libglibmm_generate_extra_defs-2.4.so -> libglibmm_generate_extra_defs-2.4.so.1.3.0
lrwxrwxrwx 1 root root      42 Sep 18 14:42 /usr/lib/libglibmm_generate_extra_defs-2.4.so.1 -> libglibmm_generate_extra_defs-2.4.so.1.3.0
-rwxr-xr-x 1 root root  191272 Sep 18 14:42 /usr/lib/libglibmm_generate_extra_defs-2.4.so.1.3.0
lrwxrwxrwx 1 root root      10 Jan  6 06:41 /usr/lib/libGL.so -> libGL.so.1
lrwxrwxrwx 1 root root      14 Jan  6 06:41 /usr/lib/libGL.so.1 -> libGL.so.1.7.0
-rwxr-xr-x 1 root root  538368 Jan  6 06:41 /usr/lib/libGL.so.1.7.0
lrwxrwxrwx 1 root root      15 Jul 24 11:54 /usr/lib/libGLU.so -> libGLU.so.1.3.1
lrwxrwxrwx 1 root root      15 Jul 24 11:54 /usr/lib/libGLU.so.1 -> libGLU.so.1.3.1
-rwxr-xr-x 1 root root  456464 Jul 24 11:54 /usr/lib/libGLU.so.1.3.1
lrwxrwxrwx 1 root root      21 Nov  1 06:25 /usr/lib/libglusterfs.so -> libglusterfs.so.0.0.1
lrwxrwxrwx 1 root root      21 Nov  1 06:25 /usr/lib/libglusterfs.so.0 -> libglusterfs.so.0.0.1
-rwxr-xr-x 1 root root 1156624 Nov  1 06:25 /usr/lib/libglusterfs.so.0.0.1
lrwxrwxrwx 1 root root      12 Sep 30 10:22 /usr/lib/libglut.so -> libglut.so.3
lrwxrwxrwx 1 root root      17 Sep 30 10:22 /usr/lib/libglut.so.3 -> libglut.so.3.11.0
-rwxr-xr-x 1 root root  351448 Sep 30 10:22 /usr/lib/libglut.so.3.11.0
lrwxrwxrwx 1 root root      25 Jan 11 07:55 /usr/lib/libGLX_indirect.so.0 -> /usr/lib/libGLX_mesa.so.0
lrwxrwxrwx 1 root root      16 Jan 11 07:55 /usr/lib/libGLX_mesa.so -> libGLX_mesa.so.0
lrwxrwxrwx 1 root root      20 Jan 11 07:55 /usr/lib/libGLX_mesa.so.0 -> libGLX_mesa.so.0.0.0
-rwxr-xr-x 1 root root  486248 Jan 11 07:55 /usr/lib/libGLX_mesa.so.0.0.0
lrwxrwxrwx 1 root root      18 Jan  1 06:38 /usr/lib/libGLX_nvidia.so -> libGLX_nvidia.so.0
lrwxrwxrwx 1 root root      23 Jan  1 06:38 /usr/lib/libGLX_nvidia.so.0 -> libGLX_nvidia.so.440.44
-rwxr-xr-x 1 root root 1114784 Jan  1 06:38 /usr/lib/libGLX_nvidia.so.440.44
lrwxrwxrwx 1 root root      11 Jan  6 06:41 /usr/lib/libGLX.so -> libGLX.so.0
lrwxrwxrwx 1 root root      15 Jan  6 06:41 /usr/lib/libGLX.so.0 -> libGLX.so.0.0.0
-rwxr-xr-x 1 root root  136888 Jan  6 06:41 /usr/lib/libGLX.so.0.0.0

Output of strace glxinfo 2>&1 | grep open | grep -i gl

openat(AT_FDCWD, "/usr/lib/libGL.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libGLdispatch.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libGLX.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libGLX_nvidia.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libnvidia-glcore.so.440.44", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/zach/.nv/nvidia-application-profile-globals-rc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/glxinfo", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libGL.so.1.7.0", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libGLdispatch.so.0.0.0", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libGLX.so.0.0.0", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libGLX_nvidia.so.440.44", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libnvidia-glcore.so.440.44", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libGLX_nvidia.so.440.44", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libnvidia-glcore.so.440.44", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libGL.so.1.7.0", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/libnvidia-glcore.so.440.44", O_RDONLY) = 3
openat(AT_FDCWD, "/home/zach/.nv/nvidia-application-profile-globals-rc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/bin/glxinfo", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/libGL.so.1.7.0", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/libGLdispatch.so.0.0.0", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/libGLX.so.0.0.0", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/libGLX_nvidia.so.440.44", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/libnvidia-glcore.so.440.44", O_RDONLY) = 4

If I remove the nvidia-utils, glxinfo works correctly with the mesa libraries.

No custom xorg.conf or files in /etc/X11/xorg.conf.d.

Output of ls -l /usr/share/X11/xorg.conf.d

-rw-r--r-- 1 root root  227 Jan  1 06:38 10-nvidia-drm-outputclass.conf
-rw-r--r-- 1 root root 1350 Jan  4 02:10 10-quirks.conf
-rw-r--r-- 1 root root 1429 Aug 12 11:26 40-libinput.conf

I have nvidia-drm.modeset=1 set on the kernel command line.

I have tried adding the nvidia drivers to the initramfs but same result from glxinfo.

I'm using gnome and gdm.

Xorg log: https://pastebin.com/E5Z2YMxw

pacman.log: https://pastebin.com/ysGV98i6

The above information as well as a similar issue from another user can be found here: https://bbs.archlinux.org/viewtopic.php?id=242085

Last edited by zaxmyth (2020-01-12 21:41:46)

Offline

#2 2020-01-12 22:02:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,413

Re: X Error of failed request: BadValue with NVIDIA drivers installed

Thanks for opening a new thread.

Why are you not already installing optimus-manager? It will change your xorg configs and the logics for how this works anyway. If you want to test this without it installed first regardless, follow https://wiki.archlinux.org/index.php/NV … phics_only read the info about the file you have to create and the additional addendum regarding GDM. However you'd probably be better off by simply setting up optimus-manager instead, read it's readme for details .

Online

#3 2020-01-12 22:16:26

zaxmyth
Member
From: Seattle / San Francisco
Registered: 2019-03-25
Posts: 25
Website

Re: X Error of failed request: BadValue with NVIDIA drivers installed

I have tried all of this with optimus-manager installed and the optimus-manager.service does create the xorg configs however, optimus-manager --status throws an exception and logs the following (see the same glxinfo error as I posted above):

Optimus Manager (Client) version 1.2.2

Error reading current mode : Cannot run glxinfo : Failed to execute 'glxinfo' : X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  39
  Current serial number in output stream:  40
Traceback (most recent call last):
  File "/usr/bin/optimus-manager", line 11, in <module>
    load_entry_point('optimus-manager==1.2.2', 'console_scripts', 'optimus-manager')()
  File "/usr/lib/python3.8/site-packages/optimus_manager/optimus_manager_client.py", line 75, in main
    _print_status()
  File "/usr/lib/python3.8/site-packages/optimus_manager/optimus_manager_client.py", line 205, in _print_status
    _print_current_mode()
  File "/usr/lib/python3.8/site-packages/optimus_manager/optimus_manager_client.py", line 164, in _print_current_mode
    print("Current GPU mode : %s" % mode)
UnboundLocalError: local variable 'mode' referenced before assignment

Which is why I'm trying to get glxinfo working without optimus-manager.

Offline

#4 2020-01-12 22:24:49

zaxmyth
Member
From: Seattle / San Francisco
Registered: 2019-03-25
Posts: 25
Website

Re: X Error of failed request: BadValue with NVIDIA drivers installed

If I configure the NVIDIA card as the PrimaryGPU, glxinfo works.

I tried installing optimus-manager after this was working but the glxinfo error returns.

Offline

#5 2020-01-12 23:18:38

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,413

Re: X Error of failed request: BadValue with NVIDIA drivers installed

Try using the git version, there's an explicit commit mentioning glxinfo issues. And make sure you've read: https://github.com/Askannz/optimus-mana … /README.md

Last edited by V1del (2020-01-12 23:19:21)

Online

#6 2020-01-13 00:00:06

zaxmyth
Member
From: Seattle / San Francisco
Registered: 2019-03-25
Posts: 25
Website

Re: X Error of failed request: BadValue with NVIDIA drivers installed

Great tip. Looks like there are some recent changes around the glxinfo call as you say but they don't quite solve my problem.

If it is expected for glxinfo (and related mesa-demo programs) to not work when nvidia-utils are installed but Xorg is currently running on the intel card, I'll look into opening a bug for optimus-manager.

Thanks for your help.

Last edited by zaxmyth (2020-01-13 00:00:52)

Offline

Board footer

Powered by FluxBB