Prime offload not working on driver 515 ubuntu server + x11

Prime query works, nvidia settings works, but… no offloading happens. Selecting nvidia mode also causes my splash screen to rapidly flicker between tty1 and tty7 so ondemand is my only option rn. I fixed the flicker by logging in to tty and a lot of ctrl alt f2 spam to type letter by letter and query swap via cli. I also noticed when running

Lspci nnv it says “nvidia” rather than nvidia drm. Some sites said drm is needed for prime. Im vary confused.

Running “NV_PRIME_RENDER_OFFLOAD=1” and pressing enter yeilds nothing.

Running “NV_PRIME_RENDER_OFFLOAD=1 _GLX_VENDOR_LIBREARY_NAME=nvidia glxinfo”

Gets a mesa opengl device string.

This same setup ran fine on ubuntu 21.10 and driver 465.x so i know my system si good.

I tried multiple driver versions of 515, but all give same issue. Card wont offload. Nor install opengl… i dont know how to make my gpu offload. Its super annoying vcause… my igpu freezes a lot when gaming.

Edit: added more to the command. Open gl is there, says prime offload is supported when open nvidia settings from terminal.

Note i technically have 3 gpus in my system. One i want to offload to, one i immou’d in hopes of giving it to a windows vm, and intel one. is there a way to make it work?

i would post a screenshot but due to not having a file manager i cannot.

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

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

i have no file manager or unzipper, and thus no means to view this file myself. if it says my kernel is out of date, it isn’t. i tried to install licorixe for kvm but it destroys my immou when booted into. so the generic kernel is up to date.

i have one kernel immou’d to see if it fixed nvidia mode but made no diffrence. running

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia

seams to of helped if i launch flatpaks from terminal, but how would i do this with things like steam that use vulkan and opengl? also theres screen taring bretty bad.
is it possible to use both gpus for offloading? (one streams, one games, igpu makes desktop?)

The xserver gets confused by your xorg.conf and binds both gpus to the modesetting driver. Please delete /etc/X11/xorg.conf

my xconfig in x11 is blank. my xconfig in /etx/x11/xorg.conf.d has another xorg with
Section “ServerLayout”
Identifier “layout”
Screen 0 “iGPU”
EndSection

Section “Device”
Identifier “iGPU”
Driver “modesetting”
EndSection

Section “Screen”
Identifier “iGPU”
Device “iGPU”
EndSection

prime now works in ondemand mode with 1 gpu by using __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia and an app name, but stuff like vulkan, i haven’t tested.

i get a lot of screen taring. i’m trying to make roblox, which xdg opens, run through nvidia card all the time

Please set kernel parameter nvidia-drm.modeset=1 to mitigate tearing.

By kernel perimiter do you mean add that to the list of commands i put in terminal before rum app command?

No, please see this:
https://wiki.ubuntu.com/Kernel/KernelBootParameters

Oh editong grub permiters. I got it. Will add. Umm the enviroment vareables i use for offload when launching per app, do i add these here too or no? Like glxvendor=nvidia and PRIME_OFFLOAD=1

No, those are environment variables, not kernel/module parameters