Chances are you're reading this because you were directed to it; in which case, welcome!
There have been (too) many occasions where a setup has broken due to installing the NVidia drivers on a system with NVidia Optimus. This can be either because the option was selected in Cnchi (although it has been removed when Optimus is detected) or when installing the drivers according to the NVidia page on the Arch Linux wiki.
The reason this breaks is the
nvidia-xconfig script. What this script does is create a configuration file for X to use, but this is intended to be used on desktop-grade GPUs only. When run on an Optimus system, therefore, it expects to be writing a configuration file for a desktop GPU and does not take into account that this is not a valid setup for a notebook.
The fix is simple: Remove the configuration file
- A live USB stick or installation DVD of any distro.
- Basic knowledge of the coretools commands, like
- The ability to chroot. Documented below.
Step 1: Chroot into the installed system
First, we will be installing into the installed system. Boot up your live USB or installation DVD. Open a terminal (or switch to a TTY, up to you).
Mount the filesystem of your installed system to /mnt. In this example, we'll use /dev/sda1.
# mount /dev/sda1 /mnt
If using an Arch Linux installation USB, use
# arch-chroot /mnt # Optionally append /bin/bash to use Bash as shell, but this doesn't matter.
If using a different kind of distro, use the regular
# chroot /mnt # Optionally append /bin/bash to use Bash as shell, but this doesn't matter.
It's not needed to mount the API filesystems like
Step 2: Remove the generated configuration file
When in the chroot, we can either delete or move the file. It is most likely generated
To delete the file:
# rm /etc/X11/xorg.conf
To move the file (e.g. as backup):
# mv /etc/X11/xorg.conf /new/destination # e.g. /etc/X11/xorg.conf.nvidia-broken
Copying the file isn't enough, it needs to be gone from that location.
Step 3: Install Bumblebee, or use nouveau PRIME
From within the live system, you can proceed with installation of Bumblebee according to the Antergos wiki:
The other option is to deinstall the NVidia drivers and use nouveau with its PRIME capabilities. Do note that this approach will be considerably slower. Assuming you have installed the generic
# pacman -Rns nvidia
Make sure there isn't a file in
/etc/modprobe.d/ which blacklists the
nouveau kernel module. From now on, nouveau should work with your GPU.
Step 4: Reboot
Exit the chroot with the
exit command, unmount the filesystem with
umount /mnt, and then reboot with the
reboot command. You're done!