PRIME render offload not working

Hi,

I try to get PRIME render offload working, but I can’t see my nvidia GPU in xrandr or the X log. I patched the xserver and also followed the README instructions. Weird is: I see two providers with xrandr, but both are named modesetting. Any help is greatly appreciated.

Bug Report:
https://gist.githubusercontent.com/Zeroneca/6d07a95d3d505ec636d33a0b42d2d260/raw/1ac717d988148523768f1d7d1142b5d3d8051f91/nvidia-bug-report.log.gz

Make sure you’re not running the nvidia driver in modesetting. Then, you’re likely missing a Device section in your Xorg config with “Driver nvidia”. Check my Xorg config here: https://devtalk.nvidia.com/default/topic/1061293/linux/-435-17-am-i-observing-the-proper-results-with-the-new-prime-/post/5374426/#5374426

Thank you very much, the card is now recognized and shows up in xrandr and the X log!

Now I just need to get libglvnd working, one disadvantage with Gentoo…

EDIT: after getting libglvnd working, everything works now flawlessly! But there is one big problem: the kernel module nvidia_drm is in use even when not running programs with the nvidia card so linux-pm can’t shut down the card. Is this a bug or a feature?