Setting up the Nvidia Driver and Optimus Manager
Published:
Step 1: Installing the Nvidia Driver and Optimus Manager Packages
Before we begin, be sure to check if the desktop manager (or DM) you use is supported. This information can be found here.
Install the proper nvidia driver and utilities with the following command:
$ sudo pacman -S nvidia nvidia-utils lib32-nvidia-utils lib32-nvidia-libgl
If you are unable to install lib32-nvidia-utils
or lib32-nvidia-libgl
, don’t worry as these may not be required unless you plan on using Steam.
Once the driver packages are done installing, you can install the optimus-manager
package from the AUR. To do this, you can use an AUR helper. If you don’t have one already, I would recommend yay. So, I install the package with this command:
$ yay -S optimus-manager
Step 2: Configuring the Driver
Be sure to remove any previous Xorg configurations, you may have stored in /etc/X11
as these may interfere with Optimus Manager.
Copy the default configuration file to /etc/optimus-manager/optimus-manager.conf
with this command:
$ sudo cp /usr/share/optimus-manager.conf /etc/optimus-manager/optimus-manager.conf
Then open the new file in your favorite text editor:
$ sudo vim /etc/optimus-manager/optimus-manager.conf
You can set whatever options you would like here, just make sure to set startup_mode=nvidia
or startup_mode=auto
if you plan on using GPU switching.
If you are not using a DM, be sure to put the following line into your ~/.xinitrc
file near the top:
xrandr --setprovideroutputsource modesetting NVIDIA-0
If you did not set the DPI option in optimus-manager.conf
, then add the following line after the previous one in the same file:
xrandr --dpi 96
Step 3: Starting Optimus Manager
Now that you have the drivers installed and Optimus Manager configured, you need to enable the Optimus Manager service and start it. You can do this with the following commands:
$ sudo systemctl enable optimus-manager.service
$ sudo systemctl start optimus-manager.service
Now that the service is running and set to run on startup, the driver should be setup and ready to go. If you are in a graphical session, you may have to reboot.
Once you have rebooted, you can check if the driver is running with the command:
$ sudo lspci -v | grep -i "nvidia"
You should see the following in the output:
Kernel driver in use: nvidia
If you do not see this, then be sure to checkout the links below to troubleshoot the problems.
Conclusion
Your system should now be using your Nvidia GPU. You will likely notice a major increase in performance upon rebooting. I hope this post was helpful.