RHEL and CentOS 8 nvidia-prime setup
For RHEL 7 and CentOS 7 see the other blog Articlele
Quote from the other article:
In Some rare cases software (including Autodesk Maya of course!) use direct Nvidia drivers calls that bumblebee currently has no bridge for (instead of the system libs), so Maya for ie: thinks the video card has 0MB of memory and crashes.
This setup uses xrandr (insteand of VirtualGL) to render the buffer on the nvidia gpu (set up as headless) and copying it to the intel one that has the screen.
This setup works well with 3d software like The Foundry Nuke, Autodesk Maya, Autodesk Mudbox, etc, at the expense of the battery life.Word of advice:
After the clean install, get a partition cloning software like Acronis True Image or such.
I found xrandr to be a little temperamental, and adding custom modes, wrong modes, modifying defaults one might leave your system without a gui for good (or at least i couldn’t figure out how to revert my changes)
Make a partition clone before the process, and after if all works as expected.See this page for some info, where i got the setup working.
https://devtalk.nvidia.com/default/topic/957814/linux/prime-and-prime-synchronization/
RHEL 8 or CentOS 8:
Wayland does not support offloading with the NVIDIA proprietary drivers. You will need to disable it.
There are forum posts of people using DRI_PRIME with wayland, but they are extremely undocumented.
I was not successful, so i disable it by uncommenting this line in /etc/gdm/custom.conf
WaylandEnable=false
Download the latest drivers from nvidia
Blacklist Nouveau (the usual drill as in a nvidia only system)
systemctl set-default multi-user.target (this will make the system boot into the console)
lspci |grep VGA, take note of the PCI Bus ID of the Nvidia card (for ie mine is: 01:00:00)
You need to set up your /etc/X11/xorg.conf, here is mine, if you use it remember to change the BusIDs!!
# nvidia-xconfig: X configuration file generated by nvidia-xconfig # nvidia-xconfig: version 440.82 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 # Inactive "intel" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" EndSection Section "Module" Load "modesetting" Load "glx" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/input/mice" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "Unknown" Option "DPMS" EndSection Section "Device" Identifier "intel" Driver "modesetting" BusID "PCI:0:2:0" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BusID "PCI:1:0:0" EndSection Section "Screen" Identifier "intel" Device "intel" Monitor "Monitor0" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "AllowEmptyInitialConfiguration" SubSection "Display" Depth 24 Modes "nvidia-auto-select" EndSubSection EndSection
NOTE: AllowEmptyInitialConfiguration, this is required so the nvidia drivers won’t use the HDMI output as default, leaving you with a headless system if the screen is not present!
copy /etc/X11/xinit/xinitrc to ~./.xinitrc
Add the following lines to ~./.xinitrc
xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto startx
systemctl isolate multi-user.target
from the command line Install Nvidia drivers, when asked to setup a xorg.conf for you, press no! we want to keep our own xorg.conf we just did
Reboot the system, it will go into the console
at this stage, xrandr wont see any devices! as the x server is not loaded, you wont be able to change any config in randr at this point except to add or remove modes
dmesg |grep nvidia, check the module is loaded
dmesg |grep nouveau, check the module is not loaded! if it is, try another method to blacklist it until it doesnt show here after booting
now do startx
if everything worked correctly, run systemctl set-default graphical.target to boot into the gui
if you have any issue, check your /var/log/Xorg.0.log to see what happened
Now you should be able to use the Displays application in gnome to set up your monitors, and resolutions.
If you need to add custom modes to xrandr, you can do so in the ~/.xinitrc file, this other articles contain information on how to rhel and centos 7 nvidia-prime setup , and xrandr cvt how to add custom screen resolutions
Enjoy your NVIDIA in your laptop 🙂