Tips for installing Nvidia .run files in Linux

It seems that a lot of GPU problems revolve around specific versions of drivers. Though NVidia has their own support structure, you can often learn from information reported by others who fold.

Moderators: Site Moderators, FAHC Science Team

Jesse_V
Site Moderator
Posts: 2850
Joined: Mon Jul 18, 2011 4:44 am
Hardware configuration: OS: Windows 10, Kubuntu 19.04
CPU: i7-6700k
GPU: GTX 970, GTX 1080 TI
RAM: 24 GB DDR4
Location: Western Washington

Tips for installing Nvidia .run files in Linux

Post by Jesse_V »

As some of you guys may remember, a while ago I had a tough time installing Nvidia drivers in Linux Mint. The 970 was too old for the regular drivers, xorg-edgers didn't include OpenCL in their 343.22 drivers, so I had so resort to the fun task of installing the driver manually. Linux is wonderful and amazing so much of the time, but on occasion it's frustrating. This was one of those times, mainly because Nouveau is stubborn and doesn't seem to want to unload from the kernel without a fight, and of course Nvidia's installer is not tolerant of Nouveau's presence.

Recently I acquired a new SSD and decided this was a good time to do a full reinstall, take advantage of the SSD and install the driver properly this time around. My earlier instructions were posted here, but I found some better guides online and followed them. For my setup I was on Linux Mint 17 (LTS) and I used the 346.16 Beta Nvidia drivers, mainly because the changelog had several items that looked like they might solve the problems I was encountering before. Although I didn't perform these exact steps in this exact order because I wasn't sure that I was doing, these steps were basically what I did to get the driver installed and working with F@h:

1. Installed Mint, updated everything via the Update Manager, restarted. Note that open-source drivers are in use here.
2. Used Firefox to fetch the Nvidia driver. Renamed it to "nvidia.run" for ease-of-use, and chmod +x nvidia.run to allow it to execute.
3. Control-Alt-F1 to drop into the command-line. Logged in.
4. sudo service mdm stop to kill the graphical display.
5. Tried to install the Nvidia driver but failed because Nouveau was still in use by the kernel. Verified that with sudo rmmod nouveau which indicated that Nouveau was in use.
6. sudo nano /etc/modprobe.d/blacklist.conf then appended

Code: Select all

blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
to the bottom of the file to prevent Nouveau from loading on startup.
7. sudo update-initramfs -u to apply these changes.
8. sudo nano /etc/default/grub and changed "quiet splash" to "text" in the GRUB_CMDLINE_LINUX_DEFAULT line so that Linux started without a GUI.
9. sudo update-grub
10. Restarted via sudo reboot
11. As expected, Linux booted into the command-line, and no graphical interface appeared. Confirmed that Nouveau was not loaded by attempting to unloading it with sudo rmmod nouveau
12. Navigated to the Downloads directory, or wherever my .run file was.
13. sudo ./nvidia.run
14. Allowed the Nvidia driver to install the 32-bit libs and basically let it do everything it wanted to.
15. Reversed the changes of step 8 by switching the options back.
16. Did step 9.
17. Rebooted after the installation completed with sudo reboot
18. Confirmed that X11 was working, confirmed the installed driver in nvidia-settings, checked "./ocore --devices" to confirm that the proper GPUs were identified.
19. Install F@h, begin folding.

As you can see, it's much simpler than that GRUB hack that I suggested last time. I suggest that everyone follow this when faced with Nvidia .run files. Please let me know if you have any questions or if it doesn't work for you.

Edit by Mod:
Step 4 suggests that your display manager is mdm.
In general, your display manager may also be any of { lightdm, gdm, sddm or another display manager }.
Last edited by Jesse_V on Wed Feb 25, 2015 4:02 am, edited 2 times in total.
F@h is now the top computing platform on the planet and nothing unites people like a dedicated fight against a common enemy. This virus affects all of us. Lets end it together.
Saleck
Posts: 5
Joined: Wed Jul 02, 2008 1:04 am

Re: Tips for installing Nvidia .run files in Linux

Post by Saleck »

At last! I've been wanting a guide like this for ages, thank you :) I've been running Linux in dualboot for a while now but installing drivers always puts me off from using it for folding. I also have a 970 so I'll be trying this out later.
Image
Saleck
Posts: 5
Joined: Wed Jul 02, 2008 1:04 am

Re: Tips for installing Nvidia .run files in Linux

Post by Saleck »

Ok I tried doing this but unfortunately, whenever I press CTRL + ALT + F1, all I get is a black screen with no other text available.

What should I try doing now? I've tried searching around but had no luck so far.

Thanks!
Image
bollix47
Posts: 2959
Joined: Sun Dec 02, 2007 5:04 am
Location: Canada

Re: Tips for installing Nvidia .run files in Linux

Post by bollix47 »

From: viewtopic.php?f=80&t=26981&p=270804#p270804
* For some the ctrl-alt-f1 might not work so you need to get to the root prompt via the grub menu.
Reboot and select Advanced, then recovery mode (2nd entry ...you might need to hold down the shift key while booting
to show the grub menu if you only have one o/s on the system).
In the recovery menu select the grub entry which will change your o/s from read-only to read-write.
After that's done select the root entry.
Image
davidcoton
Posts: 1094
Joined: Wed Nov 05, 2008 3:19 pm
Location: Cambridge, UK

Re: Tips for installing Nvidia .run files in Linux

Post by davidcoton »

bollix47 wrote:From: viewtopic.php?f=80&t=26981&p=270804#p270804
* ...you might need to hold down the shift key while booting
to show the grub menu if you only have one o/s on the system...
To be precise, at least in some cases it must be the right shift key. YMMV.
Image
Saleck
Posts: 5
Joined: Wed Jul 02, 2008 1:04 am

Re: Tips for installing Nvidia .run files in Linux

Post by Saleck »

That worked perfectly thank you very much :)
I freshly installed Linux Mint 17 KDE and went into the recovery mode. I did steps 6 and 7, jumped straight to 12, 13 and 14. Rebooted and everything seems to be in order with the 346.16 drivers. It seems to detect my CUDA cores.
Image
Jesse_V
Site Moderator
Posts: 2850
Joined: Mon Jul 18, 2011 4:44 am
Hardware configuration: OS: Windows 10, Kubuntu 19.04
CPU: i7-6700k
GPU: GTX 970, GTX 1080 TI
RAM: 24 GB DDR4
Location: Western Washington

Re: Tips for installing Nvidia .run files in Linux

Post by Jesse_V »

Excellent! Glad to hear it!

By the way, these steps should work on other flavors of Linux, although anyone using a desktop other than Cinnamon should change "mdm" on step 4 to whatever their desktop uses underneath. Other than that all the other steps should be the same.
F@h is now the top computing platform on the planet and nothing unites people like a dedicated fight against a common enemy. This virus affects all of us. Lets end it together.
Jesse_V
Site Moderator
Posts: 2850
Joined: Mon Jul 18, 2011 4:44 am
Hardware configuration: OS: Windows 10, Kubuntu 19.04
CPU: i7-6700k
GPU: GTX 970, GTX 1080 TI
RAM: 24 GB DDR4
Location: Western Washington

Re: Tips for installing Nvidia .run files in Linux

Post by Jesse_V »

One more thing. This method will cause linker errors when trying to compile OpenGL applications from source, such as my viewer. (It's usually recommended to use my PPA anyway). The specific error is "cannot find -lGL", which is basically saying that the OpenGL library cannot be found. To fix this, simply create a symlink like so:

sudo ln -s /usr/lib/libGL.so.1 /usr/lib/libGL.so

After that it should work just fine. Note that /usr/lib/libGL.so.1 is most likely a symlink itself, but that's all right.
F@h is now the top computing platform on the planet and nothing unites people like a dedicated fight against a common enemy. This virus affects all of us. Lets end it together.
Saleck
Posts: 5
Joined: Wed Jul 02, 2008 1:04 am

Re: Tips for installing Nvidia .run files in Linux

Post by Saleck »

I'd also like to point out that, if you have headphones, this will activate nVidias HDA. If you have monitors with speakers, it will turn them on and things like Amarok will not play properly. nVidia HDA also likes to force itself as the default audio device and no amount of tinkering I could do would force it to behave otherwise.

So I found out how to disable it entirely. You can disable nVidia HDA alltogether by opening the terminal and typing

sudo nano /etc/modprobe.d/blacklist.conf

and adding

blacklist snd_hda_intel

to the bottom of the blacklist list. Reboot and you'll be able to hear Amarok and possibly other things through your headset again.
Image
Jesse_V
Site Moderator
Posts: 2850
Joined: Mon Jul 18, 2011 4:44 am
Hardware configuration: OS: Windows 10, Kubuntu 19.04
CPU: i7-6700k
GPU: GTX 970, GTX 1080 TI
RAM: 24 GB DDR4
Location: Western Washington

Re: Tips for installing Nvidia .run files in Linux

Post by Jesse_V »

Saleck wrote:I'd also like to point out that, if you have headphones, this will activate nVidias HDA. If you have monitors with speakers, it will turn them on and things like Amarok will not play properly. nVidia HDA also likes to force itself as the default audio device and no amount of tinkering I could do would force it to behave otherwise.

So I found out how to disable it entirely. You can disable nVidia HDA alltogether by opening the terminal and typing

sudo nano /etc/modprobe.d/blacklist.conf

and adding

blacklist snd_hda_intel

to the bottom of the blacklist list. Reboot and you'll be able to hear Amarok and possibly other things through your headset again.
Ah, that's interesting. I just noticed Nvidia NDA on Mint's Sound app, but my audio seems to be fine. Plugging my AT M50s into the front audio jack caused Mint to switch to the headphone jack, and my speakers plugged into the back seem to work fine as well. Perhaps that's motherboard or OS specific. Mint KDE handles audio differently than Mint Cinnamon, and while Cinnamon's sound apps handle audio control in a very intuitive manner, KDE does offer more controls in that department.
F@h is now the top computing platform on the planet and nothing unites people like a dedicated fight against a common enemy. This virus affects all of us. Lets end it together.
rwh202
Posts: 410
Joined: Mon Nov 15, 2010 8:51 pm
Hardware configuration: 8x GTX 1080
3x GTX 1080 Ti
3x GTX 1060
Various other bits and pieces
Location: South Coast, UK

Re: Tips for installing Nvidia .run files in Linux

Post by rwh202 »

Thanks very much for putting this guide together - it was a great starting point to get going again under Linux.

The last time I was using Linux was running bigadv on i7-860's and the gpu2 client through wine on gtx460's so I was a little rusty! Anyway, I had a few days off work to babysit a plumber so had some time spare and have now migrated 10 systems from windows 7 and all are now folding nicely.

Below are the steps I used - they largely follow the original ones, but there are a few changes that might help others who hit the same stumbling blocks.

1. Installed Mint, updated everything with "sudo apt-get update" and "sudo apt-get dist-upgrade", restarted. Note that open-source drivers are in use here (on my newer GPUs (780 and up), no drivers were in use and instead in software rendering mode).
2. Used Firefox to fetch the Nvidia driver. Renamed it to "nvidia.run" for ease-of-use.
3. Made nvidia.run executable using properties>permissions>allow execution as a program check box or alternatively "chmod +x nvidia.run" if you're already in terminal
4. Control-Alt-F1 to drop into the command-line. Didn’t work! Just got a blank screen on 9 out of 10 systems.
5. Control-Alt-F7 to return to desktop
6. sudo gedit /etc/default/grub
changed

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT=“quiet splash”
GRUB_CMDLINE_LINUX=“”
to

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT=“”
GRUB_CMDLINE_LINUX=“nomodeset”
7. save and sudo update-grub
8. sudo reboot
On the one old system where ctrl-alt-F1 worked and drivers were in use, this had the added benefit of reverting to software rendering mode allowing me to proceed.
9. Control-Alt-F1 to drop into the command-line. Log in.
10. sudo service mdm stop to kill the graphical display.
11. ran sudo rmmod nouveau which succeeded and indicated that Nouveau was not in use.
12. Navigated to the Downloads directory, or wherever my .run file was.
13. sudo ./nvidia.run
14. Allowed the Nvidia driver to install the 32-bit libs and basically let it do everything it wanted to.
15. Rebooted after the installation completed with sudo reboot
16. Install F@h, begin folding.

As a final note, if after reboot you are stuck on 640x480 like I was on my 2 systems connected by vga, "sudo rm /etc/X11/xorg.conf" "sudo reboot" caused it to get regenerated and did the trick.

Now I’ve got the option of windows or linux - right now linux is winning to the tune of 400k ppd extra compared to windows so I think I’ll stick with it for a while…
Jesse_V
Site Moderator
Posts: 2850
Joined: Mon Jul 18, 2011 4:44 am
Hardware configuration: OS: Windows 10, Kubuntu 19.04
CPU: i7-6700k
GPU: GTX 970, GTX 1080 TI
RAM: 24 GB DDR4
Location: Western Washington

Re: Tips for installing Nvidia .run files in Linux

Post by Jesse_V »

Thanks very much for your walkthrough rwh202, more guides that are similar are always helpful. I have no doubt that the PPA or the official repo will have the latest proper driver in time or perhaps even now, but we all want a working driver now, so we have to through these steps. I'm happy that you found my guide helpful and figured it out. :)
F@h is now the top computing platform on the planet and nothing unites people like a dedicated fight against a common enemy. This virus affects all of us. Lets end it together.
DocJonz
Posts: 244
Joined: Thu Dec 06, 2007 6:31 pm
Hardware configuration: Folding with: 4x RTX 4070Ti, 1x RTX 4080 Super
Location: United Kingdom
Contact:

Re: Tips for installing Nvidia .run files in Linux

Post by DocJonz »

Gents - Jesse_V and rwh202 - thanks for this, its been a great help. Now got 2x GTX 970's running under Ubuntu 14.04.2 :D

(Especially useful was the bit about getting a black screen with Ctrl-Alt-F1 and tweaking Grub to rectify it).
Folding Stats (HFM.NET): DocJonz Folding Farm Stats
Jesse_V
Site Moderator
Posts: 2850
Joined: Mon Jul 18, 2011 4:44 am
Hardware configuration: OS: Windows 10, Kubuntu 19.04
CPU: i7-6700k
GPU: GTX 970, GTX 1080 TI
RAM: 24 GB DDR4
Location: Western Washington

Re: Tips for installing Nvidia .run files in Linux

Post by Jesse_V »

I just followed my guide for the installation of 346.47. I had some typos in my guide (chmod and update-grub) which I have now fixed.

I didn't have the black screen issue, oddly, but perhaps that was because I restarted after applying all the updates.

I also had to run
wget https://fah-web.stanford.edu/file-relea ... c/GPUs.txt
sudo mv GPUs.txt /var/lib/fahclient/
sudo service FAHClient restart
to allow it to recognize my GTX 970.
F@h is now the top computing platform on the planet and nothing unites people like a dedicated fight against a common enemy. This virus affects all of us. Lets end it together.
DocJonz
Posts: 244
Joined: Thu Dec 06, 2007 6:31 pm
Hardware configuration: Folding with: 4x RTX 4070Ti, 1x RTX 4080 Super
Location: United Kingdom
Contact:

Re: Tips for installing Nvidia .run files in Linux

Post by DocJonz »

Jesse_V wrote:I also had to run
wget https://fah-web.stanford.edu/file-relea ... c/GPUs.txt
sudo mv GPUs.txt /var/lib/fahclient/
sudo service FAHClient restart
to allow it to recognize my GTX 970.
Good point about the GPUs.txt file - I had to do the same, though I thought v7.4.4 was supposed to come with the GPU list (unlike v7.3.6)?
Folding Stats (HFM.NET): DocJonz Folding Farm Stats
Post Reply