NVIDIA GPU Fan Control using GUI in Linux

Message boards : Number crunching : NVIDIA GPU Fan Control using GUI in Linux
Message board moderation

To post messages, you must log in.

1 · 2 · 3 · Next

AuthorMessage
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1881285 - Posted: 31 Jul 2017, 4:05:03 UTC

I've got a GUI nVidia fan control app working on my 3 Linux hosts. It's written in Python and PyQT. It looks like this:



This app works on all 3 of my Ubuntu 14.04 hosts, but with the Linux fragmentation such as it is, I have no idea whether it'll work on other flavors or not. If it doesn't work for you, I'm not sure I'll be able to come up with a solution, inasmuch as this is my first crack at Python. :^)

Here's a link to a zipped file with the app..
https://www.dropbox.com/s/qj6hipjed4zjajr/gpufancnv.7z?dl=0
It includes a ReadMe text file, but I'll also post the contents here for those who may want to get a head start on reading.

-----------------------------

Fan Control for nVidia GPUs (v0.1)

1. There is no installer. Simply extract all files from gpufancnv.7z to the folder where you want to have easy access to launch the program.

2. Ensure that gpufancnv.pyw is marked as executable in the file's Properties->Permissions window.

3. If not already installed, from Package Manager install "python-numpy" (and any additional packages specified by that selection).

4. In order to launch the program with a standard double-click, WITHOUT having to resort to the Terminal (that's the whole point of a GUI, after all), your system must be configured to do so. Verify by right-clicking on gpufancnv.pyw. If the first option shown at the top of the menu is "Run", you're all set. If not, follow these steps:

4a. Launch "dconf Editor". (Install with Package Manager if it's not already on your system.)

4b. Navigate to "org->gnome->nautilus->preferences".

4c. Set "executable-text-activation" to "launch"

4d. Close "dconf Editor"

4e. Close/reopen the file manager, and navigate back to gpufancnv.pyw

5. Verify that you have already applied the "coolbits" tweak to the NVIDIA X Server Settings. (The Thermal Settings for each GPU will show an "Enable GPU Fan Settings" and "Fan Speed" slider. If not, apply the "coolbits" now. A restart MAY be necessary afterwards.)

6. Double-click on gpufancnv.pyw to launch the program. (Once the program is running, lock it to the launcher by right-clicking on the launcher icon. Then, only a single click will be necessary to launch the program in the future.)

NOTE: If the program window does not appear within 4-5 seconds, it probably means that an error has occurred and the program isn't smart enough (yet) to trap it. In this case, you'll need to open a dreaded Terminal, navigate to the folder where the program resides, and enter "python gpufancnv.pyw". Watch for error messages

7. The program comes with a default configuration file which allows control for up to 6 nVidia GPUs. If you have fewer on your system, just adjust the "# of GPUs" accordingly.

8. Set temperature ranges for each GPU with the first four sliders. (The fifth one is locked to an upper value of 100+.) Set a corresponding fan speed for each range. (On first use, it is recommended to set the desired values for all GPUs before actually turning the fan control on for any of them.)

9. Turn on the fan control for each GPU using the "On" button.

10. SAVE YOUR SETTINGS! They will be retrieved from the configuration file and applied each time the program is launched. (It wouldn't be a bad idea to make a copy of the gpufancnv.cfg file and save it in another folder, either, to avoid having the default file from a future distribution inadvertently wipe out your hard work.)

11. The default control interval for checking the temperatures and making any necessary speed adjustments is set to 10 seconds. You can change that to any value up to 120 seconds.

12. Just let 'er run. You can minimize the application window when you get tired of watching the current temperature and fan speed value as they fluctuate.
ID: 1881285 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13161
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1881299 - Posted: 31 Jul 2017, 6:00:30 UTC

Thanks Jeff. I'll tackle the testing tomorrow on fresh eyes. Looks simple enough to use and will be one less thing that I have done from Terminal so far.

Are you an old hand at Python programming or is this an exercise to learn it?
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1881299 · Report as offensive
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1881302 - Posted: 31 Jul 2017, 6:10:46 UTC - in response to Message 1881299.  

Are you an old hand at Python programming or is this an exercise to learn it?
Python is completely new to me. I got a book about 10 days ago on programming with Python and PyQt. Have been progressing in fits and starts ever since. In Windows, I've been using Delphi for many years to write various GUI utilities for my own use, so the concepts were familiar, but Python's quirks and limitations are taking some getting used to.

Ah, well, past my bedtime here. Perhaps I'll find out in the morning if I've snared any other volunteers. ;^)
ID: 1881302 · Report as offensive
Profile ML1
Volunteer moderator
Volunteer tester

Send message
Joined: 25 Nov 01
Posts: 20142
Credit: 7,508,002
RAC: 20
United Kingdom
Message 1881318 - Posted: 31 Jul 2017, 9:08:55 UTC

Hey! Nice work :-)

(OK... So I'm far too lazy to write a GUI when there is the old magic of the command line... ;-) )


Happy cool crunchin',
Martin
See new freedom: Mageia Linux
Take a look for yourself: Linux Format
The Future is what We all make IT (GPLv3)
ID: 1881318 · Report as offensive
Profile Tom M
Volunteer tester

Send message
Joined: 28 Nov 02
Posts: 5124
Credit: 276,046,078
RAC: 462
Message 1881325 - Posted: 31 Jul 2017, 13:28:30 UTC - in response to Message 1881285.  

I have subscribed to this thread as I am probably going to want to see if I can get this setup on my Lubuntu setup.

Tom
A proud member of the OFA (Old Farts Association).
ID: 1881325 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13161
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1881355 - Posted: 31 Jul 2017, 16:49:41 UTC

I am unable to start it with a double-click. I started it from Run in the menu and it didn't start. Dropped to terminal to see error messages. I assume I am missing PyQT4?
keith@Darksider:~/Desktop/gpufancnv$ python gpufancnv.pyw
Traceback (most recent call last):
  File "gpufancnv.pyw", line 6, in <module>
    from gpufancnvgui import *
  File "/home/keith/Desktop/gpufancnv/gpufancnvgui.py", line 10, in <module>
    from PyQt4 import QtCore, QtGui
ImportError: No module named PyQt4
keith@Darksider:~/Desktop/gpufancnv$ 

Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1881355 · Report as offensive
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1881358 - Posted: 31 Jul 2017, 17:19:23 UTC - in response to Message 1881355.  

I am unable to start it with a double-click. I started it from Run in the menu and it didn't start. Dropped to terminal to see error messages. I assume I am missing PyQT4?
keith@Darksider:~/Desktop/gpufancnv$ python gpufancnv.pyw
Traceback (most recent call last):
  File "gpufancnv.pyw", line 6, in <module>
    from gpufancnvgui import *
  File "/home/keith/Desktop/gpufancnv/gpufancnvgui.py", line 10, in <module>
    from PyQt4 import QtCore, QtGui
ImportError: No module named PyQt4
keith@Darksider:~/Desktop/gpufancnv$ 
Yep, it looks that way. It must come standard with Ubuntu 14.04. The numpy package was the only one that I had to add to the two machines other than the one I did the development on.

Okay, in Package Manager, find and install "python-qt4".........and try again. :^)
ID: 1881358 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13161
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1881360 - Posted: 31 Jul 2017, 17:38:47 UTC - in response to Message 1881358.  

Yep, wasn't installed. Installed and now running your app. I had to comment out my original script that had the fans at 100% since there was conflict. I'll have to rewrite that part since your app does the same. I mainly used the script to slightly overclock the cards and keep them in Power Level 3. Still have to run the script which keeps the gpus tasks at high priority. Everything is working fine. Good Job! Thanks Jeff.
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1881360 · Report as offensive
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1881365 - Posted: 31 Jul 2017, 17:58:13 UTC - in response to Message 1881360.  

Yep, wasn't installed. Installed and now running your app. I had to comment out my original script that had the fans at 100% since there was conflict. I'll have to rewrite that part since your app does the same. I mainly used the script to slightly overclock the cards and keep them in Power Level 3. Still have to run the script which keeps the gpus tasks at high priority. Everything is working fine. Good Job! Thanks Jeff.
That's good to hear! Only 1 speed bump for the first beta test report feels pretty good. With such massive fragmentation in Linux World, it probably won't be the last, though.

Guess I'll have to add that "python-qt4" package to Item 3 of my ReadMe file.

Thanks for the testing and the report, Keith. :^)
ID: 1881365 · Report as offensive
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1881488 - Posted: 1 Aug 2017, 4:48:59 UTC

ALERT!

When I started up my Linux boxes this evening and launched the Fan Control app, I found that, although it set the fan speeds correctly, it didn't automatically turn the fan control on for each GPU in NVIDIA X Server Settings. I had to actually click on each GPU, in turn, to trigger that action.

The bug has now been fixed and, of course, v0.2 has now been uploaded. The link is the same as in my original post.

For those who have already started trying out the app, don't allow the default configuration file (gpufancnv.cfg) from the new 7z file overwrite your existing file. Otherwise, any settings you already have will be reset to the defaults and you'll need to start over.
ID: 1881488 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13161
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1881497 - Posted: 1 Aug 2017, 5:22:30 UTC - in response to Message 1881488.  

ALERT!

When I started up my Linux boxes this evening and launched the Fan Control app, I found that, although it set the fan speeds correctly, it didn't automatically turn the fan control on for each GPU in NVIDIA X Server Settings. I had to actually click on each GPU, in turn, to trigger that action.

The bug has now been fixed and, of course, v0.2 has now been uploaded. The link is the same as in my original post.

For those who have already started trying out the app, don't allow the default configuration file (gpufancnv.cfg) from the new 7z file overwrite your existing file. Otherwise, any settings you already have will be reset to the defaults and you'll need to start over.

I noticed that too but I think my normal boot sequence worked around that. I run a script that sets persistence mode and fan control to enabled along with some overclocking.. That has fan control acting on your program. If I don't run my script then I noticed the fan control check boxes aren't checked. If you are just running fan control, your v. 0.2 seems to be in order.
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1881497 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13161
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1881933 - Posted: 3 Aug 2017, 22:14:53 UTC

Anybody else besides Jeff and myself running his GUI Fan Control app? Wondering what your experiences are? The app is running fine here.
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1881933 · Report as offensive
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1881977 - Posted: 4 Aug 2017, 4:25:53 UTC - in response to Message 1881933.  

Well, Stephen did raise his hand.......but perhaps he was just indicating he needed to go to the bathroom. ;^)
ID: 1881977 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13161
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1881990 - Posted: 4 Aug 2017, 6:00:44 UTC - in response to Message 1881977.  

LOL :-}
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1881990 · Report as offensive
rob smith Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer moderator
Volunteer tester

Send message
Joined: 7 Mar 03
Posts: 22158
Credit: 416,307,556
RAC: 380
United Kingdom
Message 1882002 - Posted: 4 Aug 2017, 7:43:35 UTC

I just need a few minutes at one of my Linux computers to get it installed and running.
However the only tuit I can find just now is square not round :-(
Bob Smith
Member of Seti PIPPS (Pluto is a Planet Protest Society)
Somewhere in the (un)known Universe?
ID: 1882002 · Report as offensive
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1882505 - Posted: 6 Aug 2017, 23:13:39 UTC

Just on the off chance that there's a silent user out there who's trying out the app, but has discovered (or soon will) that it wouldn't launch automatically from "Startup Applications" on a reboot, version 0.3 is now available, which should fix that shortcoming. The D/L link remains the same.
ID: 1882505 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13161
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1882513 - Posted: 6 Aug 2017, 23:59:54 UTC

Thanks Jeff, I had wondered about the behavior since I did have it in Startup Applications. I wasn't sure if it was starting on its own or not since I launch 3 other scripts beforehand by Terminal before I start BOINC to get the gpus prepped.
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1882513 · Report as offensive
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1882516 - Posted: 7 Aug 2017, 0:13:25 UTC - in response to Message 1882513.  

When it launches successfully, you should always see the app's window appear, although it could be hidden behind other windows if you have multiple applications launching at startup.
ID: 1882516 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13161
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1882519 - Posted: 7 Aug 2017, 0:23:27 UTC

OK, I do think I have a problem then. I have just a couple of programs launching in Startup Applications and neither of them open large enough windows to hide the gpufancnv window. But the fans seem to get controlled. This is the output of the terminal launch of the program which you suggested would show any errors.

keith@Darksider:~/Desktop/gpufancnv$ python gpufancnv.pyw
Traceback (most recent call last):
  File "gpufancnv.pyw", line 262, in <module>
    fcapp = FCForm()
  File "gpufancnv.pyw", line 18, in __init__
    os.chdir(os.path.dirname(sys.argv[0]))
OSError: [Errno 2] No such file or directory: ''
keith@Darksider:~/Desktop/gpufancnv$ 

Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1882519 · Report as offensive
Profile Jeff Buck Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester

Send message
Joined: 11 Feb 00
Posts: 1441
Credit: 148,764,870
RAC: 0
United States
Message 1882522 - Posted: 7 Aug 2017, 0:50:22 UTC - in response to Message 1882519.  

I just re-verified that it works okay from the Terminal on all 3 of my Linux boxes, so perhaps there's an OS-specific issue here. Bur first, try launching it without "python" at the beginning, just entering gpufancnv.pyw (or, perhaps, ./gpufancnv.pyw).
ID: 1882522 · Report as offensive
1 · 2 · 3 · Next

Message boards : Number crunching : NVIDIA GPU Fan Control using GUI in Linux


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.