Nvidia driver 440.59 doesn't work with PRIME offload

On Dell 7572 with Fedora 31, I received an update for Nvidia drivers today from the negativo repo. After installing them, GL doesn’t work anymore. I have since reinstalled the drivers from both Negativo and rpmfusion, and the problem remains.

Other people with the same GPU seem to be having problems with this driver: one, two, etc.

$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo
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:  39
  Current serial number in output stream:  40
$ uname -a
Linux fedora 5.5.6-201.fc31.x86_64 #1 SMP Mon Feb 24 20:24:13 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia nvidia-smi
Mon Mar  2 20:00:26 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59       Driver Version: 440.59       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce MX150       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   47C    P8    N/A /  N/A |      0MiB /  4042MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
$ lsmod | grep ^nvidia
nvidia_drm             57344  0
nvidia_modeset       1118208  1 nvidia_drm
nvidia_uvm           1081344  0
nvidia              20467712  2 nvidia_uvm,nvidia_modeset
$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia nvidia-settings

ERROR: Unable to load info from any available system

Adding logs:

$ sudo dmesg | grep nvidia
[    0.000000] Command line: BOOT_IMAGE=(hd1,gpt1)/boot/vmlinuz-5.5.6-201.fc31.x86_64 root=UUID=45965cdd-b34b-4add-9a33-c92f9e5bb85b ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1
[    0.152441] Kernel command line: BOOT_IMAGE=(hd1,gpt1)/boot/vmlinuz-5.5.6-201.fc31.x86_64 root=UUID=45965cdd-b34b-4add-9a33-c92f9e5bb85b ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1
[    4.725326] nvidia: loading out-of-tree module taints kernel.
[    4.726248] nvidia: module license 'NVIDIA' taints kernel.
[    4.741088] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    4.752734] nvidia-nvlink: Nvlink Core is being initialized, major device number 237
[    4.758354] nvidia 0000:01:00.0: enabling device (0006 -> 0007)
[    5.062929] nvidia-uvm: Loaded the UVM driver, major device number 235.
[    5.095498] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  440.59  Thu Jan 30 00:59:18 UTC 2020
[    5.101205] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[    6.294330] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
[    7.888133] Modules linked in: cmac bnep sunrpc snd_hda_codec_hdmi snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp nvidia_drm(POE) snd_hda_ext_core nvidia_modeset(POE) snd_soc_acpi_intel_match snd_soc_acpi nvidia_uvm(OE) snd_soc_core snd_hda_codec_realtek ath10k_pci x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_generic coretemp snd_compress vfat ath10k_core ac97_bus fat snd_pcm_dmaengine kvm_intel snd_hda_intel snd_intel_dspcfg snd_hda_codec kvm mac80211 irqbypass uvcvideo snd_hda_core iTCO_wdt snd_hwdep videobuf2_vmalloc dell_laptop mei_hdcp iTCO_vendor_support videobuf2_memops nvidia(POE) ledtrig_audio crct10dif_pclmul intel_rapl_msr snd_seq crc32_pclmul ath videobuf2_v4l2 snd_seq_device ghash_clmulni_intel btusb dell_smm_hwmon intel_cstate btrtl dell_wmi intel_uncore btbcm snd_pcm btintel dell_smbios cfg80211 intel_rapl_perf snd_timer videobuf2_common pcspkr ipmi_devintf dcdbas bluetooth snd dell_wmi_descriptor ipmi_msghandler libarc4 wmi_bmof i2c_i801 soundcore rtsx_usb_ms r8169
[    7.922902]  nv_drm_atomic_helper_disable_all+0xec/0x290 [nvidia_drm]
[    7.924088]  nv_drm_master_drop+0x22/0x60 [nvidia_drm]

I think this config snippet to use the intel driver instead of the modesetting driver is also preventing the X server from auto-configuring an NVIDIA GPU screen:

*** /etc/X11/xorg.conf.d/20-intel.conf
*** ls: -rw-r--r-- 1 root root 104 2020-02-25 06:18:58.435134306 +0530 /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "1"
EndSection

Please try removing that config snippet.

Thanks. I remember putting this a while back to create a particular VNC setup. It didn’t seem to interfere with the Nvidia driver before, but removing it now did work.