Skip to content

konstantingoretzki/AntergosPrime

 
 

Repository files navigation

AntergosPrime

Read before use

AntergosPrime is currently unmaintained. There haven't been huge changes since the fork of emanuellopes's archLinuxPrime. Currently it is recommended to use optimus-manager because this tool can do more than just switching configs like power management.

This collection of scripts wants to provide GPU-switching for Hybrid-GPUs like in *buntu-distributions for Antergos.

This branch is a fork of emanuellopes's archLinuxPrime which got optimized for the Antergos distribution. Emanuellopes forked for his repo the prime application that comes on Linux Mint.

The main work of this script goes to Emanuellopes and the Linux-Mint-team, I just optimized on some paths, updated package names, added how to fix the tearing for the Nvidia-GPU and put everything well described together, so that even people with less bash skills can (hopefully) easily follow on how to install and use AntergosPrime.

Even if this branch is made for Antergos, the installation-instructions are mostly system-independent and should therefore work with any Arch-distribution.

Status

Currently this script only works with the display manager SDDM and NOT with Antergos's default display manager LightDM. However switching is easy, so it should be not a big deal to switch your display manager. The prime-indicator does also not work so it has been removed. Even after fixing the installation script it did not work well enough wit KDE so it got removed. If you still want to use the prime-indicator you can find more information here.

Why not solution XYZ?

You might ask why to use this config and not something like Bumblebee. It's simple: if your laptop has the HDMI-output hardwired to your Nvidia GPU and you can not disable any GPU inside your BIOS/UEFI, then you won't be able to switch GPUs.

If you can not switch GPUs you have to let your Nvidia-GPU activated the whole time, so that you can use the HDMI-output and do graphical stuff like Gaming. In terms of battery run-time you will see that you can not really use your laptop to go this way since the battery will drain very fast.

With AntergosPrime you can switch GPUs easily, similar to *buntu-distributions. It's of course not perfect, e.g. you have to logout for GPU switching, but at least you can use both GPUs. Other solutions for this type of setup have serveral drawbacks, as mentioned below.

Bumblebee

With Bumblebee you can only use the tool "intel-virtual-output", if your HDMI-output is hardwired to the Nvidia-GPU, however it works rather bad and has bad performance (especially if you want to game on a second screen). More Information to intel-virtual-output and Bumblebee can be found here.

nvidia-xrun

There are solutions like nvidia-xrun, the problem with nvidia-xrun is that you have to switch to an unused TTY and also Steam does not work. You can found more information about nvidia-xrun here.

Installation

Antergos repo

Install antergos-prime using the repo of Antergos

The easiest way to install AntergosPrime is by using the package of the Antergos repo. You can easily install it with one command with pacman, however you may want to continue reading the instructions for installing it manually since there are some "heavy" system changes like changing your Display Manager, which you should be aware of.

sudo pacman -S antergos-prime

Alternative/ install manually

Install bbswitch and SDDM (if not installed)

sudo pacman -S bbswitch sddm

Download all needed files manually or with the command "git clone"

git clone https://github.com/konstantingoretzki/AntergosPrime

Switch to the folder "AntergosPrime" and run the install.sh

cd AntergosPrime
./install.sh

If you can not run the install.sh then check out, that you have execute-permissions.

chmod +x install.sh

Note: The process is the same if you want to remove AntergosPrime. This time just run remove.sh.

If everything worked we have now to disable or delete the old display manager (LightDM) and activate our new installed display manager SDDM. Be careful while doing, if your forget to enable SDDM you won't be able to use your desktop environment.

Disable LightDM

sudo systemctl disable lightdm

Enable SDDM

sudo systemctl enable sddm

Usage

Now you can switch GPU-configs with "prime-select". It's a good idea to try both configs, so that everything is installed.

Intel

sudo prime-select intel

Nvidia

sudo prime-select nvidia

Note: You can check if you are using the right GPU with glxgears. To do so type glxinfo | grep Intel or glxinfo | grep NVIDIA. If you get an output, it works.

Warning: If there's an update e.g. for Nvidia or nvidia-utils, you have to switch to both GPUs once with prime-select so that all the Xorg-files are in place and overwrite the new generated files by the update.

Fix tearing while using the Nvidia-GPU

Even if Emanuellopes fixed the tearing while using the Intel-GPU, while using the Nvidia-GPU you still experience tearing.

The solution I found was to use PRIME Synchronization.

The setup with AntergosPrime is rather simple, since the script do provide almost everything needed (all needed modules are loaded).

The only thing that has to be done manually is to add the kernel-parameter nvidia-drm.modeset=1 to GRUB (if you don't use GRUB, look your needed setup up in the ArchWiki.

GRUB

Edit /etc/default/grub

sudo nano /ect/default/grub

Append the kernel options to the GRUB_CMDLINE_LINUX_DEFAULT line

GRUB_CMDLINE_LINUX_DEFAULT="quiet nvidia-drm.modeset=1"

Re-generate the grub.cfg file

sudo grub-mkconfig -o /boot/grub/grub.cfg

You should now be able to switch on and off PRIME Synchronization. You can do this with xrandr --output [your-screen-name] --set "PRIME Synchronization" 1

Disabeling is the same, just use "0" instead of "1". If you're using KDE, you can easily get your screen-name by KDE's display setup menu.

Inside the folder "tearing" of this repo are the two files kill_vsync.sh and start_vsync.sh, with these files you can easily turn PRIME Synchronization on and off - just execute them.

Troubleshooting

After an update it does not work anymore!

Solution: Try to switch to both GPUs with prime-select once, so that all the Xorg-files are in place and overwrite the new generated files by the update.

All fonts are very small!

Solution: Add xrandr --dpi [wished DPI] to your files nvidia-optimus.sh and Xsetup. If you want to use my dpi-settings, then just uncomment the line xrandr --dpi 96 in both files. After that you have to switch to both GPUs with prime-select once, so that all the new files (with the changes) are in place.

I get the error bash: ./install.sh: Permission denied!

Solution: Just make the file executable with chmod +x install.sh.

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%