PRIME Render Offload setup, but X Server only listing one provider (modesetting)

Hi there,

I recently discovered NVIDIA’s Prime Render Offload for Optimus-based laptops on the arch wiki (https://wiki.archlinux.org/index.php/PRIME) and wanted to set it up on my machine. For reference, I am using a MSI GS65 Stealth Thin, which has a GTX 1070 Max-Q paired with the onboard Intel Graphics chip (a UHD Graphics 630).

I am running on archlinux, with kernel version 5.5.2, and running on Xorg Server version 1.20.7-1, with the latest drivers (as of writing this, the latest stable drivers are version 440.59-3, built just yesterday). Now my assumption is that the few patches needed to make PRIME render offload work have been put in the release version of xorg-server, since those patches were done nearly 6 months ago (I’m talking about the patches listed here : http://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/primerenderoffload.html).

Here is my xorg.conf file : https://pastebin.com/VwwZMTpG

Now here comes the problem : my X server only lists one provider as the output of xrandr --listproviders : the intel GPU, using the modesetting driver. It is unable to register the NVIDIA card for some reason. See here :

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 3 associated providers: 0 name:modesetting

My dmesg output also seems weird, since it detects the NVIDIA card, but doesn’t actually initialize it ? See here :

$ dmesg | grep nvidia
[    3.016512] nvidia: loading out-of-tree module taints kernel.
[    3.016518] nvidia: module license 'NVIDIA' taints kernel.
[    3.056606] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    3.110214] nvidia-nvlink: Nvlink Core is being initialized, major device number 239
[    3.110526] nvidia 0000:01:00.0: enabling device (0006 -> 0007)
[    3.110645] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[    3.253352] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  440.59  Thu Jan 30 00:59:18 UTC 2020
[    3.255897] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[    3.255899] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1

I’m at a loss of what to do here, it seems like every forum post or tutorial makes the assumption that by using the nvidia driver the card should automatically be available, but it is not my case here, and a few hours of google searches yesterday have not returned anything valuable for my particular problem.

Can you please try removing all of the device-related stuff from xorg.conf, leaving just this?

Section "ServerLayout"
	Identifier	"default_layout_laptop"
	Option		"AllowNVIDIAGPUScreens"
EndSection

# Config file for kb/m input
Section "InputClass"
	Identifier	"builtin_touchpad"
	Driver		"libinput"
	MatchIsTouchpad	"on"
	Option		"Tapping"		"on"
	Option		"TappingButtonMap"	"lrm"
	Option		"TappingDrag"		"false"
	Option		"DisableWhileTyping"	"true"
	Option		"HorizontalScrolling"	"true"
	Option		"NaturalScrolling"	"true"
EndSection

If it still doesn’t work after that, please run “sudo nvidia-bug-report.sh” and attach the resulting nvidia-bug-report.log.gz file. You can attach files by hovering the mouse over your post and then clicking on the paperclip icon that appears.