Skip to content

This package provide similar functionality to nvidia-prime for Ubuntu, just for Fedora, provide a shell script that will change to NVIDIA GPU and vice versa for Intel GPU

License

Notifications You must be signed in to change notification settings

mvoropaiev/FedoraPrime

 
 

Repository files navigation

Fedora Prime

A collection of shell scripts that makes it possible to use the NVIDIA GPU on a Optimus Laptop. The switching is similar to the feature provided by the nvidia-prime package in Ubuntu. However, no such package has been made for other distributions. This is exactly the functionality this package provide.

Background

In 2012, Linus Torvalds gave his famous talk at the University of Helsinki where he gave NVIDIA the middle finger due to lack of support of, in particular, device drivers for the optimus laptops. Not long after NVIDIA provided both documentation for developers of the nouveau project (an open-source implementation of the NVIDIA drivers) and partially support for switching between the Intel and NVIDIA drivers. Canonical then began working on their nvidia-prime package that should make the switching simple, basically just providing one command prime-select for switching, taking either nvidia or intel as parameter. The downside is that you need to logout for the switching to happen. The same limitations are there for this package.

Installation

Supported operating systems: Fedora 22, Fedora 23.

  • Fedora 23 only, due to a bug in recent Xorg package (which results in broken system menus and resolution detection), it is advised to temporary downgrade a package by running the following commands:

    # downgrade package(s):
    dnf --allowerasing --releasever=22 downgrade xorg-x11-server-Xorg
    # prevent upgrade for xorg-x11* stack:
    dnf install python3-dnf-plugins-extras-versionlock
    dnf versionlock add xorg-x11*

    When the fix will be available in Fedora's repositories, you can revert back and do a system upgrade:

    sudo dnf versionlock clear
    sudo dnf check-update --refresh
    sudo dnf upgrade
  • Install NVIDIA drivers from RPM Fusion repository (you need to enable it first, if you haven't already, follow instruction on the site):

    sudo dnf install kernel-devel akmod-nvidia
  • Make sure that nouveau (an open source NVIDIA driver) is blacklisted:

    sudo mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
    sudo dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
  • Install FedoraPrime:

    git clone https://github.com/mvoropaiev/FedoraPrime.git
    cd FedoraPrime
    sudo make install
    # to uninstall, simply run:
    # sudo make uninstall

Usage

To switch a graphic card, you need to run the followng command:

# switch to nvidia
sudo fedora-prime-select nvidia
# switch to intel
sudo fedora-prime-select intel

Now all you have to do is logout and then login back and you should be using a desired graphic card. You can verify it by running glxinfo | 'OpenGL renderer string' for example.

Known bugs

  • If you are in Intel mode and your system has been suspended, changing to NVIDIA may result in blank screen. Therefore you may need to reboot your machine. This is due to limitations of gdm (Ubuntu has patched gdm to run a script similar to xinitrc.nvidia, but these changes are not available upstream, thanks Ubuntu). We set the intel card active during reboot, so we should always be able to recover from the blackscreen by rebooting.

Author

About

This package provide similar functionality to nvidia-prime for Ubuntu, just for Fedora, provide a shell script that will change to NVIDIA GPU and vice versa for Intel GPU

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 73.6%
  • Makefile 26.4%