No Nvidia Screen Provider on Reverse PRIME

So i’ve been configuring my Nvidia Reverse PRIME on my Nvidia Optimus Laptop. I have been following the setup from here and also added a display setup script for lightdm for nvidia output sink. I realized to utilize the Nvidia Prime-run while using REVERSE PRIME setup is actually to have a “virtual screen” running on Nvidia or having an Xorg running on Nvidia.

So here’s the problem, when the computer first boot there’s only one provider that’s available which is the modesetting and there is no Nvidia GPU Screen 0 or NVIDIA-G0 provider and i ran xrandr to check listproviders and there’s only one provider, but everytime i restart lightdm.service that provider or Nvidia GPU Screen 0/NVIDIA-G0 miraculously shows up. So is there any extra steps that i need to take to make it work? Like adding some kernel parameter or loading module on early KMS? or it can be something else
Note :

  • Using Proprietary driver for Nvidia and modesetting for Intel
  • I tested Nvidia PRIME render and it’s working but i wanted to use Reverse PRIME

lspci

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
01:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX150] (rev a1)

First Boot

  • 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
  • Nvidia-smi
Wed Dec  9 11:58:26 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.45.01    Driver Version: 455.45.01    CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce MX150       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   44C    P0    N/A /  N/A |      0MiB /  2002MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Lightdm Restarted after the first boot

  • xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 3 associated providers: 0 name:modesetting
Provider 1: id: 0x241 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0
  • Nvidia-smi
Wed Dec  9 12:16:20 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.45.01    Driver Version: 455.45.01    CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce MX150       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   46C    P8    N/A /  N/A |      4MiB /  2002MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      5045      G   /usr/lib/Xorg                       4MiB |
+-----------------------------------------------------------------------------+

Config that i use

  • xorg.conf
Section "ServerLayout"
  Identifier "layout"
  Screen 0 "intel"
  Inactive "nvidia"
  Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

Section "Device"
  Identifier "intel"
  Driver "modesetting"
  BusID "PCI:0:2:0"
EndSection

Section "Screen"
  Identifier "intel"
  Device "intel"
EndSection
  • lightdm display setup script
#!/bin/sh
xrandr --setprovideroutputsource NVIDIA-G0 modesetting
xrandr --auto

is not recommended anymore on archlinux… you should use snippets under /etc/X11/xorg.conf.d/
wiki.archlinux.org#Reverse_PRIME

haven’t use that one yet since i’m using proprietary driver for Nvidia, so i tested with that code snippet and modify it a little bit so that it could be used on my device and that config is going to create PRIME render not Reverse PRIME. And the modified config nearly looks like what Nvidia told me to do (there’s a note in that wiki page that redirects me to a nvidia website if you wanted to configure Reverse PRIME with proprietary driver installed).
I was thinking of adding prime-run startx into the lightdm display setup since i usually go to tty2 and just type that and just leave it there, the result is that reverse PRIME is working edit : this was a mistake

It’s seems like the driver does not load or just not in time for Xorg to pick it up. So i deciced to add Nvidia as one of the modules to load early, everythings seems working and everytime i boot to the system there’s actually two screen provider and NVIDIA Reverse Prime working.

How to :
Edit /etc/mkinitcpio.conf and add nvidia to MODULES section, After that generate the new initramfs

1 Like