I have been trying to enable nvidia DRM so that I can use autorandr. I’m pretty sure it used to be enabled by default, but now it isn’t anymore. I used mhwd to install the nvidia drivers and use nvidia PRIME (prime-run) to switch between my intel iGPU und my Nvidia-3060.
I have tried enabling it by editing my /etc/modprobe.d/mhwd-gpu.conf
##
## Generated by mhwd - Manjaro Hardware Detection
##
blacklist nouveau
blacklist ttm
#blacklist drm_kms_helper
#blacklist drm
options nvidia "NVreg_DynamicPowerManagement=0x02"
blacklist nvidiafb
blacklist rivafb
options nvidia_drm modeset=1
But that just leads the following cryptic X11 error:
screen 0 deleted because of no matching config section
I was at some point able to get it running using this:
Step 2: change /etc/X11/xorg.conf.d/90-mhwd.conf to:
Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "AllowEmptyInitialConfiguration"
EndSection
Step 3 change /etc/modprobe.d/mhwd-gpu.conf to
##
## Generated by mhwd - Manjaro Hardware Detection
##
blacklist nouveau
#blacklist ttm
#blacklist drm_kms_helper
#blacklist drm
options nvidia "NVreg_DynamicPowerManagement=0x02"
blacklist nvidiafb
blacklist rivafb
options nvidia_drm modeset=1
Step 4
create this file (/usr/local/bin/optimus.sh)
#!/bin/sh
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
make it executable
chmod a+rx /usr/local/bin/optimus.sh
Edit /etc/lightdm/lightdm.conf and set (if you are using another dm check the article)
display-setup-script=/usr/local/bin/optimus
But now the whole system runs entirely on the NVIDIA GPU and therefore burns through the battery in minutes.
Isn’t there a way to both preserve nvidia prime and enable nvidia drm?