Install an NVIDIA GPU on almost any machine

Whether for research or recreation, installing a new GPU can bolster your computer’s performance and enable new functionality across the board. This installation guide uses Fedora 28’s brand-new third-party repositories to install NVIDIA drivers. It walks you through the installation of both software and hardware, and covers everything you need to get your NVIDIA card up and running. This process works for any UEFI-enabled computer, and any modern NVIDIA GPU.

Preparation

This guide relies on the following materials:

  • A machine that is UEFI capable. If you’re uncertain whether your machine has this firmware, run sudo dmidecode -t 0.  If “UEFI is supported” appears anywhere in the output, you are all set to continue. Otherwise, while it’s technically possible to update some computers to support UEFI, the process is often finicky and generally not recommended.
  • A modern, UEFI-enabled NVIDIA card
  • A power source that meets the wattage and wiring requirements for your NVIDIA card (see the Hardware & Modifications section for details)
  • Internet connection
  • Fedora 28

NOTE: This guide only covers hardware installation for desktop computers, although the NVIDIA driver installation will be relevant for laptops as well.

Example setup

This example installation uses:

Hardware and modifications

PSU

Open up your desktop case and check the maximum power output printed on your power supply. Next, check the documentation on your NVIDIA GPU and determine the minimum recommended power (in watts). Further, take a look at your GPU and see if it requires additional wiring, such as a 6-pin connector. Most entry-level GPUs only draw power directly from the motherboard, but some require extra juice. You’ll need to upgrade your PSU if:

  1. Your power supply’s max power output is below the GPU’s suggested minimum power. Note: According to some NVIDIA card manufacturers, pre-built systems may require more or less power than recommended, depending on the system’s configuration. Use your discretion to determine your requirements if you’re using a particularly power-efficient or power-hungry setup.
  2. Your power supply does not provide the necessary wiring to power your card.

PSUs are straightforward to replace, but make sure to take note of the wiring layout before detaching your current power supply. Additionally, make sure to select a PSU that fits your desktop case.

CPU

Although installing a high-quality NVIDIA GPU is possible in many old machines, a slow or damaged CPU can “bottleneck” the performance of the GPU. To calculate the impact of the bottlenecking effect for your machine, click here. It’s important to know your CPU’s performance to avoid pairing a high-powered GPU with a CPU that can’t keep up. Upgrading your CPU is a potential consideration.

Motherboard

Before proceeding, ensure your motherboard is compatible with your GPU of choice. Your graphics card should be inserted into the PCI-E x16 slot closest to the heat-sink. Ensure that your setup contains enough space for the GPU. In addition, note that most GPUs today employ PCI-E 3.0 technology. Though these GPUs will run best if mounted on a PCI-E 3.0 x16 slot,  performance should not suffer significantly with an older version slot.

Installation

1. First, open up a terminal, and update your package-manager (if you have not done so already), by running:

sudo dnf update

2. Next, reboot with the simple command:

reboot

3. After reboot, install the Fedora 28 workstation repositories:

sudo dnf install fedora-workstation-repositories

4. Next, enable the NVIDIA driver repository:

sudo dnf config-manager --set-enabled rpmfusion-nonfree-nvidia-driver

5. Then, reboot again.

6. After the reboot, verify the addition of the repository via the following command:

sudo dnf repository-packages rpmfusion-nonfree-nvidia-driver info

If several NVIDIA tools and their respective specs are loaded, then proceed to the next step. If not, you may have encountered an error when adding the new repository and you should give it another shot.

7. Login, connect to the internet, and open the software app. Click Add-ons> Hardware Drivers> NVIDIA Linux Graphics Driver> Install.

If you’re using an older GPU or plan to use multiple GPUs, check the RPMFusion guide for further instructions. Finally, to ensure a successful reboot, set “WaylandEnable=false” in /etc/gdm/custom.conf, and make sure to avoid using secure boot.

8. Once this process is complete, close all applications and shut down the computer. Unplug the power supply to your machine. Then, press the power button once to drain any residual power to protect yourself from electric shock. If your PSU has a power switch, switch it off.

9. Finally, install the graphics card. Remove the old GPU and insert your new NVIDIA graphics card into the proper PCI-E x16 slot. When you have successfully installed the new GPU, close your case, plug in the PSU, and turn the computer on. It should successfully boot up.

NOTE: To disable the NVIDIA driver repository used in this installation, or to disable all Fedora workstation repositories, consult The Fedora Wiki Page.

Verification

1. If your newly installed NVIDIA graphics card is connected to your monitor and displaying correctly, then your NVIDIA driver has successfully established a connection to the GPU.

If you’d like to view your settings, or verify the driver is working (in the case that you have two GPUs installed on the motherboard), open up the NVIDIA X Server Settings app again. This time, you should not be prompted with an error message, and information on the X configuration file and your NVIDIA GPU should be available (see screenshot below).

NVIDIA X Server Settings

Through this app, you may alter your X configuration file should you please, and may monitor the GPU’s performance, clock speed, and thermal information.

2. To ensure the new card is working at capacity, a GPU performance test is needed. GL Mark 2, a benchmarking tool that provides information on buffering, building, lighting, texturing, etc, offers an excellent solution. GL Mark 2 records frame rates for a variety of different graphical tests, and outputs an overall performance score (called the glmark2 score).

Note: glxgears will only test the performance of your screen or monitor, not the graphics card itself. Use GL Mark 2 instead.

To run GLMark2:

  1. Open up a terminal and close all other applications
  2. sudo dnf install glmark2
  3. glmark2
  4. Allow the test to run to completion for best results. Check to see if the frame rates match your expectation for your NVIDA card. If you’d like additional verification, consult the web to determine if a glmark2 benchmark has been previously conducted on your NVIDA card model and published to the web. Compare scores to assess your GPUs performance.
  5. If your framerates and/or glmark2 score are below expected, consider potential causes. CPU-induced bottlenecking? Other issues?

Assuming the diagnostics look good, enjoy using your new GPU.

References:

Editor’s note: This article was co-authored by Matthew Kenney and Justice del Castillo.

Fedora Project community New in Fedora Using Hardware Using Software

61 Comments

  1. Amitosh Swain Mahapatra

    Sometimes, especially in laptops having Optimus power saving, the nouveau driver will fail to load and cause kernel panic. It is required to blacklist the driver from grub and disable the services that load the nouveau driver to enable GPU switching.

  2. daimen

    ok so today i sused this guide to install my nvidia driver https://fedoramag.wpengine.com/install-nvidia-gpu/ and once i got to the part that asks me to go to my software center and install my drivers via a gui i couldent find it in the kde version of fedora so i dident know what to do and so i went ahead and i=used this command from terminal “sudo dnf install xorg-x11-drv-nvidia akmod-nvidia” and it installed fine but then once i reboot i run the nvidia controller gui like the guide from fedora says but whenever i run the command “sudo nvidia-xconfig” i get command not found? why is this and how can i fix it?

    • Hi Damien,
      Unfortunately, I have not performed this installation using the kde version of fedora, but I’ll get back to you as soon as I can if I find any information on this.

    • Night Romantic

      daimen, it looks like corresponding package wasn’t installed. Install it from terminal with “sudo dnf install nvidia-xconfig” command, and you should be good to go.

  3. Mike Lothian

    Alternatively get an AMD graphics card and use the open drivers built into the OS

    • ILMostro

      Indeed,
      The authors of the article might want to consider changing the title to something that does NOT suggest that their recommendation is to install nvidia GPUs on any machine a user owns.

    • Rene Reichenbach

      Exactly … all that effort for non OSS policy by Nvidia

      • Seems like some people prefer non-Free drivers. Bit sad to see Fedora Magazine promoting something that is contrary to one of the tenets of the Fedora distribution.

    • York

      Definitely agree with this one. Lubricating people’s usage of crutches such as the proprietary driver is not how you encourage manufacturers to get with the times. It is an unfortunate reality that nVidia has hardware which is slightly more power efficient, but what we pay for in efficiency is more than made up by AMDs willingness to support greater extensibility and compatibility through openness.

  4. nonamedotc

    Do these steps work with secure boot enabled?

  5. Lee Nader

    Not to beat a dead horse, but I’m assuming this does NOT work with Wayland?

    • Hi Lee,
      Yup, sadly NVIDIA is a little behind the curve with the whole wayland movement.

    • wallyk

      When I installed Fedora 27 I think I saw a note that suggesting Wayland is (at least partially) configured from the X configuration files. So maybe the guide will work with Wayland, or maybe not.

    • Nvidia proprietary drivers work fine with Gnome and Wayland in current Fedora release. Problem is that not everyone wants to support it – Sway for example, but that is more of Nvidia fault not Sway programmers – Nvidia, as always, invented they own “thing” to screw everyone else.

  6. Zelda

    Great guide! Thanks. But please, this should probably be removed. I’m not sure if this was ever possible. Cards only fit one way.

    “there is no space for the fans to ventilate in this position, place the graphics card face up instead, if possible”

    • wallyk

      Agreed. Even if it were possible to reorient the card, which way is “face up”? Both sides look like the face to me….

    • This suggestion was based on another guide that was probably a bit outdated or uninformed. We will be adjusting the article to remove this portion. Thank you for the input!

  7. Don’t ever use nvidia-xconfig on fedora ! It will produce a broken and uneeded configuration files.
    This documentation was obviously NOT tested!
    Please look at the official RPM Fusion howto related to the packaged driver.
    (that’s the one included in Fedora workstation repositories).
    https://rpmfusion.org/Howto/NVIDIA

  8. Dave Sherratt

    You need to replace “almost any machine” in the heading with “almost any desktop”.

  9. Denys

    ??????????????????????????????????????????????????
    Bottleneck detected: Your CPU is too weak for this graphic card.

    Intel Core i9-7980XE @ 2.60GHz with GeForce GTX 1080 Ti (x4) will produce 21% of bottleneck. Everything over 10% is considered as bottleneck. We recommend you to replace Intel Core i9-7980XE @ 2.60GHz with Intel Core i9-7980XE @ 2.60GHz.

    ??????????????????????????????????????????????????

  10. Please post a guide for laptops which have dual GPU, intel and Nvidia. I think they are called Optimus. It would be very kind of you if we can get some sort of guide to install Nvidia drivers for such laptops.

  11. Night Romantic

    I’m quite sure reboot on step 5 is unnecessary. It’s a good idea however to update dnf package list to include packages from newly enabled repo with “sudo dnf check-update” command.

  12. Sergio

    I have a machine with two NVIDIA GPUs and I have always wondered if its is possible to use the nvidia drivers in one of them, to use CUDA, and noveau driver in the other one.

    I don’t want to taint my kernel more than necessary

  13. wkjeji

    install tensorflow to verify all working ok

    but admin still delete my post ;( therefore i dont send how

  14. Thanks for writing this. I have a laptop with an nvidia card that I’ve been afraid to try to install the nvidia drivers on, given past experiences. With this I may be able to get it to work. But, looks like you need one more prereq: the X Server. Fedora defaults to Wayland.

  15. Tim Hesketh

    “7. Login, connect to the internet, and open the software app.” I’m probably slow, but it’s not clear what software app you refer to, or where it is.

    • Night Romantic

      Tim, author means application literary called “Software” in default (Gnome) Fedora version. As other people mentioned above, you wouldn’t find it in other desktop environments / Fedora Spins (KDE, XFCE, etc).

  16. Dave Sherratt

    The heading of this article is misleading, it should end with “almost any desktop”, rather than “almost any machine”.

    • We will be adjusting the article to address this. The installation of the drivers is pertinent to any machine… but you are correct, our discussion on hardware is really only relevant to desktop computers.

  17. Well; I prefer the Negativo17 drivers; It works ever for me and my friends…
    https://negativo17.org/nvidia-driver/

    • Dan

      I was wondering: didn’t Fedora announce at one point that they were going to use the N17 drivers because the packaging is closer to how they build packages themselves?

      • @Dan: My understanding is the maintainer of those packages worked with the rpmfusion folks to unify forces.

  18. It is sad for one of the most open source distro out there with regards to free software to write an article on how to use proprietary drivers for the world worse company that deals with Linux. I would prefer an article on why you should prefer use AMD or Intel graphics rather than “how to install proprietary nvidia driver”. Open source is more important than graphics.

    • Night Romantic

      David,

      on the other hand people should be free to use hardware they own in their linux distribution of choice. Also, there are new Linux adepts, who already own that hardware before coming to Linux.

    • We 100% agree in our support of open source, and believe it should be used wherever possible. Unfortunately, NVIDIA provides many services that are simply indispensable for many researchers. Services such as nvidia-docker (GPU accelerated containers), the nvidia gpu cloud, NVIDIA’s high-powered-computing apps, and optimized deep learning software (TensorFlow, PyTorch, MXNet, TensorRT, etc.) are very valuable to many researchers, and it is difficult to find comparable services to these with open source software. Our guide is especially geared towards those who cannot go without these resources.

      • The article should then at the very least start with a paragraph that notes that Nvidia are completely hostile to Free Software and are probably the worst choice if you want a trouble-free Linux installation with easy long-term support.

        I am not knocking your article, or your efforts in sharing what you know of the troublesome, irritating, crash-prone Nvidia hardware which will hamper your upgrade efforts in the future and lead to a steady flow of confused bugzilla entries. Rather, I am questioning the poor messaging that this sends out about Fedora. An issue for the editorial team. Fedora Magazine is supposed to be communicating the core values of the project. If those have changed then perhaps Free should be dropped from the branding which so much time was spent on building.

        • To quote a previous reply on this topic: “The Fedora Magazine’s policy is to include topics of popular, licit software we know users are interested in. We concentrate on free and open source software but not exclusively, although we are always focused on Fedora users specifically, and how to enable them in their preferred choices.”

          • Oisin Feeley

            Sure. But that does not exclude having an editorial policy that explicitly notes the practical and pragmatic problems over that long-term that result from installing a GPU over which the user has very little if any control.

            As it stands the article’s first paragraphs nearly read like an enticement or advertorial for installing something that will be difficult to upgrade at times and may cause instability to the OS. The article could be an opportunity to educate the hypothetical population of naive users that might be attracted by third-party repositories, or even computational scientists who plan on carrying out non-reproducible research on unverifiable platforms.

            Again, these are matters of editorial tone and appear quite divergent from the idea of Freedom of which Fedora could quite rightly be proud.

  19. Shadders.

    Hi,
    I installed on a Fedora 28, KDE, desktop motherboard (Gigabyte) with NVidia GTX1050, and it failed to boot.
    I had to disable the Intel Graphics from BIOS to allow it to boot, and it boots using text boot sequence for the LUKS password rather than a graphics based screen as per Intel graphics.
    Maybe provide an article to show you how to disable the NVidia driver and revert back to Intel ?
    Regards,
    Shadders.

  20. Guys,

    Since many of the comments have pointed out the issue regarding the proprietary software and the Fedora philosophy. Would you be kind to add a big disclaimer at the beginning of the article to say that Fedora does not endorse, support or encourage proprietary software and recommend to use AMD / Intel GPU instead?

    Thanks.

  21. for optimus (Intel/Nvidia) and kde sddm you need to add this lines to /etc/sddm/Xsetup .

    xrandr –setprovideroutputsource modesetting NVIDIA-0
    xrandr –auto

  22. Vinicius

    Using this tutorial my machine works well. I have a notebook Asus Nitro 5 with a GeForce GTX 1050m

  23. straycat

    I’ve been using Fedora along time with Nvidia cards and using the rpmfusion drivers.I’d like to add before installing the driver install kernel-devel & kernel-headers so when theres a kernel update akmod can build the driver with the new kernel after reboot.I also agree with david I’ve been using the negativo17 repo for awhile now and the driver with dkms seems to be more stable but they only support newer cards where rpmfusion supports older cards as well.

  24. Liviy

    Interesting article…I’ve been using nvidia with Fedora since probably around Core 12 and my current system has is UEFI enabled and my GTX970 is also compatible however I’ve never used the official drivers and I don’t boot via UEFI either… What’s the benefit of switching to that combination?
    Although…I suspect I’d also need to work out how to get my FC28 desktop to use Wayland (as it’s 100% not) since I disabled Wayland a little too proficiently quite a few Cores ago when it wasn’t playing nice with Nvidia and multiple displays and after quite a few attempts to re-enable it have failed (it’s not disabled in /etc/gdm/custom.conf and I’ve tried re-installing the Wayland related packages with forcing overwriting of configs & even messing with the /usr/share files but I seem to always lose interested before succeeding). I know it works with my system as the FC28 live image boots with it but I can’t bring myself to scratch my system just for Wayland…

    • Night Romantic

      Liviy, as far as I know, you don’t need to boot with UEFI to use NVIDIA proprietary drivers.

      As for benefits — I don’t think you’ll get any ) I think that if you’d needed proprietary drivers in your Fedora — for gaming, CUDA GPU computations, accelerated video decoding or something else — you’d know for sure you need them )

      Open source Nouveau driver works quite well at this point for desktop usage — at least in my experience. It supports KMS, Wayland, and other features Fedora uses by default. I use it in Fedora. I use proprietary driver in other Linux distribution on the same box fro when I want some 3D gaming under Linux.

      As for reenabling Wayland — well, consider maybe fresh install of Fedora 29 this fall? I have a quite simple procedure for fresh install of next Fedora release, which keeps intact most of my settings and packages, but in the same time doesn’t get stuck with settings I don’t want to keep. It’s no magic bullet, it requires quite a few manual steps/actions — though it can be automated further, I’m just too lazy to do it) Still I like a kind of balance it gives me.

      • Liviy

        Thanks for your reply…I was just curious if there was some benefits as it would explain the procedure being detailed in the article.

        Fresh install…in theory that’s usually a good option but I have quite a bit of laziness too, especially when I remember how long the road was for this desktop to where it is now. I have pondered doing a fresh fc28 install into a vm and doing s comparison between that and my main system to see if anything jumps out.

  25. jalf86

    This article is very misleading. I specifically bought an NVidia graphics card because many articles still say it will work flawlessly with Fedora. After many trials, I’ve got it to work, but I have to stay in Fedora 27-LXQt, only 3 updates from base installation. I have to stay there because there are no articles that can recommend a comparable alternative. With the seeming movement away from X-Server, NVidia is probably the worst graphics card to go with. I’m not a power user. I just use my computer for email, web purchases, and Runescape (can’t find another game to play with my tastes and the NVidia card I have). If, like Windows dominating the desktop, NVidia dominates the graphics card arena, more people will have reason to migrate away from Fedora. I only stay with Fedora because I’ve been using it for years and I like to dabble in science and engineering and Fedora repositories seem to have the best for that. I’ve tried Mint, Umbuntu, and several others. I’ve stayed away from Arch and Gentoo because I want my computer experience to be simpler. I would hate to see Fedora fade away because of a graphics card.

  26. jalf86

    This article is a bit misleading. I purposely bought an NVidia graphics card because many web sites still declare NVidia as the best the graphics card to get for Fedora. Its articles like this that perpetuate that myth. I have the prerequisite hardware, but I have to stay at Fedora 27- LXQt (3 updates from base install) or my computer freezes. Because of NVidia, I’ve tried to migrate away from Fedora (tried out Mint, Umbuntu, and various other distos). I don’t have the budget to change graphics cards and there haven’t been much talk of a comparable alternative outside of “if you don’t care about graphics go with Intel”.

    • Night Romantic

      jalf86,
      my general experiences with Fedora and NVidia drivers are quite in line with the article. It’s quite easy to install them on Fedora — at least it was for two NVidia cards I have/had for the last 10 years or so. There are nuances after installation, maybe quite a few — and yes, the article definitely should at least name them, as you and other commenters pointed out.

      Fedora with NVidia on XOrg (not on Wayland) worked ok for me (F26, 25 and earlier). But for now I decided to have Fedora with open source nouveau driver as my primary workhorse distribution, and dual-boot to Ubuntu or SolusOS with proprietary NVidia drivers for Steam and maybe some other 3D games. Solus — they’ve done quite a few optimizations for Steam Runtime, have it use updated libraries and such.

      And so I have best of both worlds, so to say: “clean” Fedora on Wayland, and other distro with proprietary graphics (without Wayland as of now) just for games and not so mission critical as Fedora.

  27. ernesto

    Does intalling the nvidia propietary drivers still cause the fedora loading screen animation to be replaced with text during the system’s boot?

  28. muhaha

    Login, connect to the internet, and open the software app. Click Add-ons> Hardware Drivers> NVIDIA Linux Graphics Driver> Install.

    is it possible to use command line to complete this step?

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions