Prime offload configuration change from 396.24 and up

Greetings,
I have been using the Prime offload for quite awhile and it stopped working with my current settings and the only thing I now can get working is Prime Sync which I don’t want.

I have the following Setup.
Latest openSUSE Tumbleweed
using NVIDIA 410.57 Beta (Same result with 396.54)

When i would run dGPU with Prime offload i used the following settings:

← Xorg.conf →
Section “Module”
Load “modesetting”
EndSection

Section “Device”
Identifier “nvidia”
Driver “nvidia”
BusID “PCI:1:0:0”
Option “AllowEmptyInitialConfiguration”
EndSection

Section “Device”
Identifier “Intel”
Driver “modesetting”
BusID “PCI:0:2:0”
Option “AccelMethod” “sna”
EndSection
← xorg.conf →

Jumping on a flight. will add more soon…

The above configuration would work fine with 396.24 driver, but now it takes me to a black screen since the last few driver releases and does not load the displaymanager.

The only way I can now get it working is with Prime Sync and passing the boot param nvidia-drm.modeset=1 and with no xorg.conf file. This gets poor performance when driving 3 monitors or 3D games.

Any ideas on the above configuration in the first post to get Prime offload working again?

Happy to post more information if needed.

You’ve been using prime output, prime offload is not supported by the proprietary driver, just nouveau. Prime sync is a feature on top of prime output, eliminating tearing. Now you’re using probably just the igpu on wayland.
What DM/DE are you using?
You should modify your xorg.conf like this:

Section "Device"
  Identifier "Intel"
  Driver "modesetting"
  BusID "PCI:0:2:0"
  Option "AccelMethod" "none"
EndSection

Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BusID "PCI:1:0:0"
  Option "AllowEmptyInitialConfiguration"
EndSection

If you’re still getting just a black screen, maybe the xrandr commands to enable prime output that have to be run by your login manager (DM) are missing

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

Please run nvidia-bug-report.sh as root and attach the resulting .gz file to your post. Hovering the mouse over an existing post will reveal a paperclip icon.
Edit: swapped the sections

Swapping those sections got it working, but with some strange things going on. Why? What changed?

I’m using KDE

Attached the bug report so you can have a look.

my xrandr output is weird now.

xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x4a; cap: 0x2 (Sink Output); crtcs: 3; outputs: 8; associated providers: 0; name: modesetting
    output eDP-1
    output DP-1
    output HDMI-1
    output DP-2
    output HDMI-2
    output DP-2-1
    output DP-2-2
    output DP-2-3

If I change to prime sync I have 2 providers
If I run Nouveau I can see 2 providers

nvidia-bug-report.log.gz (1020 KB)

You still have that ‘Load Module’ section in your xorg.conf. Use the xorg.conf from here:
[url]https://devtalk.nvidia.com/default/topic/1022670/linux/official-driver-384-59-with-geforce-1050m-doesn-t-work-on-opensuse-tumbleweed-kde/post/5203910/#5203910[/url]

OK. I removed the Load Module section and it works fine without that part.

I am currently running with. the following.

~/.xinitrc

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

/etc/X11/xorg.conf

cat /etc/X11/xorg.conf
Section "Device"
    Identifier "Intel"
    Driver "modesetting"
    BusID "PCI:0:2:0"
    Option "AccelMethod" "none"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
    Option "AllowEmptyInitialConfiguration"
EndSection

nvidia-drm.modeset=1 has been set

cat /sys/module/nvidia_drm/parameters/modeset 
Y

my xrandr --listproviders is still weird

xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x4a; cap: 0x2 (Sink Output); crtcs: 3; outputs: 8; associated providers: 0; name: modesetting
    output eDP-1
    output DP-1
    output HDMI-1
    output DP-2
    output HDMI-2
    output DP-2-1
    output DP-2-2
    output DP-2-3

Everything seems to be working though.

I can’t run nvidia-settings or glxgears though… hmmm

# nvidia-settings 

ERROR: Unable to load info from any available system
# glxgears 
Xlib:  extension "GLX" missing on display ":0".
Error: couldn't get an RGB, Double-buffered visual

I’ll attach another nvidia bug report.

nvidia-bug-report.log.gz (112 KB)

Please use the complete xorg.conf from the mentioned thread. The ‘ServerLayout’ section is important.
The old style xorg.conf with the Load Module section doesn’t work anymore with Prime sync.
For shorter config, you would need to use OutputClass snippets.

I have 3 monitors that I’m driving. How is that ServerLayout going to help me. Seems it would cause me to be limited to one monitor? Am i wrong?

It’s not limited to one monitor. It just sets a minimal X layout, everything else is autodetected. The important part is that it’s setting the Nvidia gpu as main and the Intel one to secondary (inactive).

For a most-minimal config, remove your xorg.conf, then create a file
/etc/X11/xorg.conf.d/01-nvidia-prime.conf

Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "IgnoreDisplayDevices" "CRT"
    Option "PrimaryGPU" "Yes"
EndSection

This isn’t working… I suspect the modeline. Its not right for my setup I don’t think. Not sure what it would have to be. I’ll try your newer post.

See this where to put the xrandr commands for the different DMs:
[url]NVIDIA Optimus - ArchWiki

This didn’t work either. I’m going to try booting without any monitors attached and see where it gets. See attached for the bug report.
nvidia-bug-report.log.gz (968 KB)

ok… so this worked if I remove all monitors attached and then attach them afterwards. However its not speedy. my FPS are low with glxgears that actually works again now. Need a setup for discreet nvidia GPU

GPU-wise it’s working but mesa glx is still used, so you only got software rendering.
The config snippet has to be extended by a ModulePath that points to the nvidia glx. How did you install the driver?

OK I think I have it in the best case scenario here. and GLX isn’t loading at all and glxgears won’t work so… I can tell i’m running in discreet GPU mode because the video response is very fast now. Very nice.

Errrm…according to your logs, everything is set up perfectly now.
glxgears probably now displays 60FPS, which is the expected value since your display is vsync’d now.
You can force it to run unsynced
__GL_SYNC_TO_VBLANK=0 glxgears

Closeing thread and opening a new one as I want to focus this thread on PRIME output using dGPU. Thanks for your replies.