Overclock.net › Forums › Overclockers Care › Overclock.net Folding@Home Team › HOW TO GUIDE: Linux system monitor, with F@H unit monitor (conky)
New Posts  All Forums:Forum Nav:

HOW TO GUIDE: Linux system monitor, with F@H unit monitor (conky)

post #1 of 8
Thread Starter 
With the new native GPU cores in Linux, I found the need to be able to monitor temps of the cards more consistently, and more efficiently. In addition to having a very light weight, and clean way to see your work unit progress at all times, with out having the "FAHControl" open all the time. With some help from "Ferrrari8608" I was able to also add individual temp sensor data for each (Nvidia) video card. Have not worked on ATI yet, as I don't own one. So If someone wants to try to apply ATI cards, post their findings, working or not, and I'll see if we can add it.


This is my first "how to guide". please be nice to me redface.gif if there is anything missing. I will gladly help anyone through the process if there is issues

How to guide for the folding friendly Linux conky. Must have a few things installed, and configured.

1: Conky
Code:
sudo apt-get install conky-all

2: LM sensors
Code:
sudo apt-get install lm-sensors

3: Detect sensors, and save configuration
Code:
sudo sensors-detect
answer"y" to all and yes when it asks you if you'd like to save to module file.

This is a conky config that I have been working on for a while. It has basic system info and hardware monitoring built into it. (some things will have to be changed for each system).
Warning: Spoiler! (Click to show)
Code:
use_xft yes
xftfont Terminus:size=8
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_class conky-semi
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
background no
double_buffer yes
minimum_size 300 200
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_shade_color black
default_outline_color white
default_bar_size 150 5
default_gauge_size 20 20
imlib_cache_size 0
draw_shades no
alignment top_right
gap_x 5
gap_y 5
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
default_color ECEAE4
color1 light blue
color2 01C423
TEXT
$color
${color CC9900}SYSTEM ${hr 2}$color
${color 597DB2}Linux Worker Bee

${color CC9900}MOTHERBOARD ${hr 2}$color
${color 597DB2}Asus p6t6ws Revolution$color          Board Temp:${color FFFF33} ${exec sensors | awk '/MB Temperature/ {print substr($3,2,4)}'} C$color    
 
${color CC9900}CPU ${hr 2}$color
${color 597DB2}Intel Core i7 920$color @ 4017 MHZ   Socket Temp:${color FFFF33} ${exec sensors | awk '/CPU Temperature/ {print substr($3,2,4)}'} C$color

Total CPU usage: ${cpu cpu0}%
${cpugraph 000000 597DB2}
Core 1 usage                   
${cpu cpu1}% ${color 597DB2}${cpubar cpu1}$color ${alignr}Core 1 Temp:${color FFFF33} ${exec sensors | awk '/Core 0/ {print substr($3,2,4)}'} C$color     
${cpu cpu2}% ${color 597DB2}${cpubar cpu2}$color
Core 2 usage                   
${cpu cpu3}% ${color 597DB2}${cpubar cpu3}$color ${alignr}Core 2 Temp:${color FFFF33} ${exec sensors | awk '/Core 1/ {print substr($3,2,4)}'} C$color   
${cpu cpu4}% ${color 597DB2}${cpubar cpu4}$color
Core 3 usage                   
${cpu cpu5}% ${color 597DB2}${cpubar cpu5}$color ${alignr}Core 3 Temp:${color FFFF33} ${exec sensors | awk '/Core 2/ {print substr($3,2,4)}'} C$color   
${cpu cpu6}% ${color 597DB2}${cpubar cpu6}$color
Core 4 usage                   
${cpu cpu7}% ${color 597DB2}${cpubar cpu7}$color ${alignr}Core 4 Temp:${color FFFF33} ${exec sensors | awk '/Core 3/ {print substr($3,2,4)}'} C$color   
${cpu cpu8}% ${color 597DB2}${cpubar cpu8}$color
GTX 480-1 Temp:${color FFFF33}${alignr}${execpi 10 ~/.conky_scripts/gpu_temp.py 0} C$color
GTX 480-2 Temp:${color FFFF33}${alignr}${execpi 10 ~/.conky_scripts/gpu_temp.py 1} C$color

${color CC9900}NETWORK I.P. (${addr eth1}) ${hr 2}$color
Down: $color${downspeed eth1} k/s ${alignr}Up: ${upspeed eth1} k/s
${downspeedgraph eth1 25,140 000000 ff0000} ${alignr}${upspeedgraph eth1
25,140 000000 00ff00}$color
Total: ${totaldown eth1} ${alignr}Total: ${totalup eth1}
Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768
61000 count}${alignr}Total: ${tcp_portmon 1 65535 count}

${font sans-serif:bold:size=8}${color FF9900}FOLDING AT HOME ${hr 2}${font sans-serif:normal:size=8}
${color white}SMP Progress:${alignr}${execi 15 cat /var/lib/fahclient/log.txt | tr '(' '\n' |tr ')' '\n' | grep -E "(%|percent)"|tail -n 1 | tr -d 'percent' | tr -d '%'} %${execibar 15 cat /var/lib/fahclient/log.txt | tr '(' '\n' |tr ')' '\n' | grep -E "(%|percent)"|tail -n 1 | tr -d 'percent' | tr -d '%'}
${color white}GPU 1 Progress: ${alignr}${execi 15 cat /var/lib/fahclient/work/02/logfile_01.txt | tr '(' '\n' |tr ')' '\n' | grep -E "(%|percent)"|tail -n 1 | tr -d 'percent' | tr -d '%'} %${execibar 15 cat /var/lib/fahclient/work/02/logfile_00.txt | tr '(' '\n' |tr ')' '\n' | grep -E "(%|percent)"|tail -n 1 | tr -d 'percent' | tr -d '%'}
${color white}GPU 2 Progress: ${alignr}${execi 15 cat /var/lib/fahclient/work/03/logfile_01.txt | tr '(' '\n' |tr ')' '\n' | grep -E "(%|percent)"|tail -n 1 | tr -d 'percent' | tr -d '%'} %${execibar 15 cat /var/lib/fahclient/work/03/logfile_01.txt | tr '(' '\n' |tr ')' '\n' | grep -E "(%|percent)"|tail -n 1 | tr -d 'percent' | tr -d '%'}

And this is a screeny



There are a few things that do need to be maintained as the GPU's finish work units and download new ones. You have to change the work folder number as the new work unit creates a folder with a different number. Happens from it downloading a new one before it is finished with the current.

If you have an Nvidia card, this is the method to get the multiple temperature data to work.
Warning: Spoiler! (Click to show)
Code:
#!/usr/bin/env python

import subprocess
import sys

def nvidia_smi():
    cmd = ['nvidia-smi','-q']
    output = subprocess.check_output(cmd).decode("utf-8")
    try:
        for line in output.split('\n'):
            yield line
    except subprocess.CalledProcessError:
        sys.stdout.write('ERROR: nvidia-smi failed with a nonzero exitcode')
        sys.exit(1)

def main():
    gpu = int(sys.argv[1])
    smi_output = [line for line in nvidia_smi() if 'Gpu' in line and 'C' in line]

    temps = []
    for item in smi_output:
        temps.append(item.split()[2])

    try:
        sys.stdout.write(temps[gpu])
    except IndexError:
        sys.stdout.write('Invalid GPU number specified')
        sys.exit(1)

if __name__ == '__main__':
    main()

Copy the code into a new text file, and name it whatever (I used gpu_temp.py). Make sure you make it executable before trying to run it:
Code:
chmod +x gpu_temp.py

Give it an argument of which GPU (as a number) you would like the temp for. Since you have two cards, it should be 0 and 1. Example:
Warning: Spoiler! (Click to show)
./gpu_temp.py 0

I made a directory in my home '.conky_scripts' and put my scripts in there. Assuming you do the same, your conkyrc should include:
Code:
${execpi 10 ~/.conky_scripts/gpu_temp.py 0}
${execpi 10 ~/.conky_scripts/gpu_temp.py 1}

Notice the "0", and "1". This calls for the temperature data of the separate cards (Much thanks to Ferrari8608 for this part.

With the large number of people in this folding community that voted that they would completely switch over to Linux if there was a native GPU core. I felt that this would be a very useful tool.

Thanks
Asustweaker
Wet Willy
(17 items)
 
Oold man 555
(11 items)
 
 
CPUMotherboardGraphicsRAM
i7 920 @4.217 1.24 v's 24/7 Asus p6t6 ws Revolution (full water blocks) GTX 480 SLI @867-1734 samsung 30nm at 2040mhz. 8-9-9-26 1.54v's 
Hard DriveOptical DriveCoolingCooling
OCZ Agility 3 RAID0 lite on dvd burner Raystorm Danger Den 480 Full copper (paralleled)  
OSMonitorMonitorKeyboard
Dual boot, Windows7 64bit/Linux ubuntu64bit 1hpw2207h1680/1050  Sharp 60" LED 120hz s510 
PowerCaseMouseAudio
Ultra 1600w X4 NZXT, Tempest EVO logitech s510 combo Harmon Kardon AVR245 
CPUMotherboardGraphicsRAM
Phenom II X4 B55 m4n82 deluxe ghetto gtx 460 patriot viper 1066 
Hard DriveOptical DriveCoolingOS
some crap sata dvd thermal take big typhoon windows 7 ultimate  
MonitorPowerCase
hp 2207h ultra lsp 750watt cooler master elite 
  hide details  
Reply
Wet Willy
(17 items)
 
Oold man 555
(11 items)
 
 
CPUMotherboardGraphicsRAM
i7 920 @4.217 1.24 v's 24/7 Asus p6t6 ws Revolution (full water blocks) GTX 480 SLI @867-1734 samsung 30nm at 2040mhz. 8-9-9-26 1.54v's 
Hard DriveOptical DriveCoolingCooling
OCZ Agility 3 RAID0 lite on dvd burner Raystorm Danger Den 480 Full copper (paralleled)  
OSMonitorMonitorKeyboard
Dual boot, Windows7 64bit/Linux ubuntu64bit 1hpw2207h1680/1050  Sharp 60" LED 120hz s510 
PowerCaseMouseAudio
Ultra 1600w X4 NZXT, Tempest EVO logitech s510 combo Harmon Kardon AVR245 
CPUMotherboardGraphicsRAM
Phenom II X4 B55 m4n82 deluxe ghetto gtx 460 patriot viper 1066 
Hard DriveOptical DriveCoolingOS
some crap sata dvd thermal take big typhoon windows 7 ultimate  
MonitorPowerCase
hp 2207h ultra lsp 750watt cooler master elite 
  hide details  
Reply
post #2 of 8

Very nice.  I'll have to give this a try if I ever get some GPUs worth folding on again.

post #3 of 8
You should add a note that your instructions for installing the sensor apps are specific to Debian and Ubuntu based distrobutions. Apt is Debian's package manager, and not all Linux flavors use it.

Also, change 'since' to 'if' in the line:
Quote:
Give it an argument of which GPU (as a number) you would like the temp for. Since you have two cards, it should be 0 and 1. Example:

Also, add a note that the script is only compatible with Python 2.7+. Version number can be found with:
Code:
python --version

Edited by Ferrari8608 - 6/22/13 at 11:09am
post #4 of 8
Thread Starter 
OK. going to continue to update this as it becomes more versatile, and when I try it on other than debian/ubuntu.
Wet Willy
(17 items)
 
Oold man 555
(11 items)
 
 
CPUMotherboardGraphicsRAM
i7 920 @4.217 1.24 v's 24/7 Asus p6t6 ws Revolution (full water blocks) GTX 480 SLI @867-1734 samsung 30nm at 2040mhz. 8-9-9-26 1.54v's 
Hard DriveOptical DriveCoolingCooling
OCZ Agility 3 RAID0 lite on dvd burner Raystorm Danger Den 480 Full copper (paralleled)  
OSMonitorMonitorKeyboard
Dual boot, Windows7 64bit/Linux ubuntu64bit 1hpw2207h1680/1050  Sharp 60" LED 120hz s510 
PowerCaseMouseAudio
Ultra 1600w X4 NZXT, Tempest EVO logitech s510 combo Harmon Kardon AVR245 
CPUMotherboardGraphicsRAM
Phenom II X4 B55 m4n82 deluxe ghetto gtx 460 patriot viper 1066 
Hard DriveOptical DriveCoolingOS
some crap sata dvd thermal take big typhoon windows 7 ultimate  
MonitorPowerCase
hp 2207h ultra lsp 750watt cooler master elite 
  hide details  
Reply
Wet Willy
(17 items)
 
Oold man 555
(11 items)
 
 
CPUMotherboardGraphicsRAM
i7 920 @4.217 1.24 v's 24/7 Asus p6t6 ws Revolution (full water blocks) GTX 480 SLI @867-1734 samsung 30nm at 2040mhz. 8-9-9-26 1.54v's 
Hard DriveOptical DriveCoolingCooling
OCZ Agility 3 RAID0 lite on dvd burner Raystorm Danger Den 480 Full copper (paralleled)  
OSMonitorMonitorKeyboard
Dual boot, Windows7 64bit/Linux ubuntu64bit 1hpw2207h1680/1050  Sharp 60" LED 120hz s510 
PowerCaseMouseAudio
Ultra 1600w X4 NZXT, Tempest EVO logitech s510 combo Harmon Kardon AVR245 
CPUMotherboardGraphicsRAM
Phenom II X4 B55 m4n82 deluxe ghetto gtx 460 patriot viper 1066 
Hard DriveOptical DriveCoolingOS
some crap sata dvd thermal take big typhoon windows 7 ultimate  
MonitorPowerCase
hp 2207h ultra lsp 750watt cooler master elite 
  hide details  
Reply
post #5 of 8
Gonna try it too, thank you!
 
Compact Splash
(16 items)
 
 
CPUMotherboardGraphicsRAM
Intel 3220 Intel DQ77KB Integrated. What. Corsair 1x8GB Laptop Memory 
Hard DriveOSPowerCase
Plextor 128GB mSata SSD Ubuntu Delta PA-5M10 None. 
CPUMotherboardGraphicsRAM
Intel i7-3770k @ 4.7GHz ASRock Z77E MITX EVGA GTX 570 HD 2.5GB G.Skill Ripjaws X 2133MHz 
Hard DriveCoolingCoolingCooling
Samsung 830 128GB SSD XSPC EX120 + EX240 XSPC Raystorm Copper EK FC570 GTX SE (rev. 1.1) 
CoolingCoolingCoolingCooling
Swiftech MCP35X pump 3x GT AP-15 fans Tecnofront nano res one million bitspower fittings 
OSMonitorPowerCase
Windows 7 Dell U2410 Silverstone ST45SF-G Scratch built 14.75L prototype 
CPUMotherboardRAMHard Drive
Intel i7-3770k @ 4.8GHz [DELIDDED] ASRock Z77E Samsung Low Voltage 2x4GB Crucial M4 128GB 
Hard DriveCoolingOSMonitor
WD 80GB 5400RPM Corsair H100i ubuntu 13.10 18" Dell Ultrasharp (4:3 Free Oldskool Edition) 
PowerCase
Silverstone ST45SF Compact Splash Prototype 
  hide details  
Reply
 
Compact Splash
(16 items)
 
 
CPUMotherboardGraphicsRAM
Intel 3220 Intel DQ77KB Integrated. What. Corsair 1x8GB Laptop Memory 
Hard DriveOSPowerCase
Plextor 128GB mSata SSD Ubuntu Delta PA-5M10 None. 
CPUMotherboardGraphicsRAM
Intel i7-3770k @ 4.7GHz ASRock Z77E MITX EVGA GTX 570 HD 2.5GB G.Skill Ripjaws X 2133MHz 
Hard DriveCoolingCoolingCooling
Samsung 830 128GB SSD XSPC EX120 + EX240 XSPC Raystorm Copper EK FC570 GTX SE (rev. 1.1) 
CoolingCoolingCoolingCooling
Swiftech MCP35X pump 3x GT AP-15 fans Tecnofront nano res one million bitspower fittings 
OSMonitorPowerCase
Windows 7 Dell U2410 Silverstone ST45SF-G Scratch built 14.75L prototype 
CPUMotherboardRAMHard Drive
Intel i7-3770k @ 4.8GHz [DELIDDED] ASRock Z77E Samsung Low Voltage 2x4GB Crucial M4 128GB 
Hard DriveCoolingOSMonitor
WD 80GB 5400RPM Corsair H100i ubuntu 13.10 18" Dell Ultrasharp (4:3 Free Oldskool Edition) 
PowerCase
Silverstone ST45SF Compact Splash Prototype 
  hide details  
Reply
post #6 of 8
There's an updated version of the script that parses nvidia-smi for other stats as well.

http://www.overclock.net/t/1400247/nvidia-info-in-conky-help/0_100#post_20265699
post #7 of 8
Thread Starter 
Quote:
Originally Posted by She loved E View Post

Gonna try it too, thank you!

Absolutely welcome. A great little helping hand when in linux. I never liked having to have "applets" or other types of indicators on my task bar. This seems to be very clean and uses little resources. Remember to check the lm-sensors output, and get the correct numbers in the config. not all systems will line up the same as mine. You will have to do some minor alterations the "folding folder' locations, depending on how you installed your client.

Quote:
Originally Posted by Ferrari8608 View Post

There's an updated version of the script that parses nvidia-smi for other stats as well.

http://www.overclock.net/t/1400247/nvidia-info-in-conky-help/0_100#post_20265699

Yes, This i key! Be sure to follow the instructions for the custom script to a"T".
Wet Willy
(17 items)
 
Oold man 555
(11 items)
 
 
CPUMotherboardGraphicsRAM
i7 920 @4.217 1.24 v's 24/7 Asus p6t6 ws Revolution (full water blocks) GTX 480 SLI @867-1734 samsung 30nm at 2040mhz. 8-9-9-26 1.54v's 
Hard DriveOptical DriveCoolingCooling
OCZ Agility 3 RAID0 lite on dvd burner Raystorm Danger Den 480 Full copper (paralleled)  
OSMonitorMonitorKeyboard
Dual boot, Windows7 64bit/Linux ubuntu64bit 1hpw2207h1680/1050  Sharp 60" LED 120hz s510 
PowerCaseMouseAudio
Ultra 1600w X4 NZXT, Tempest EVO logitech s510 combo Harmon Kardon AVR245 
CPUMotherboardGraphicsRAM
Phenom II X4 B55 m4n82 deluxe ghetto gtx 460 patriot viper 1066 
Hard DriveOptical DriveCoolingOS
some crap sata dvd thermal take big typhoon windows 7 ultimate  
MonitorPowerCase
hp 2207h ultra lsp 750watt cooler master elite 
  hide details  
Reply
Wet Willy
(17 items)
 
Oold man 555
(11 items)
 
 
CPUMotherboardGraphicsRAM
i7 920 @4.217 1.24 v's 24/7 Asus p6t6 ws Revolution (full water blocks) GTX 480 SLI @867-1734 samsung 30nm at 2040mhz. 8-9-9-26 1.54v's 
Hard DriveOptical DriveCoolingCooling
OCZ Agility 3 RAID0 lite on dvd burner Raystorm Danger Den 480 Full copper (paralleled)  
OSMonitorMonitorKeyboard
Dual boot, Windows7 64bit/Linux ubuntu64bit 1hpw2207h1680/1050  Sharp 60" LED 120hz s510 
PowerCaseMouseAudio
Ultra 1600w X4 NZXT, Tempest EVO logitech s510 combo Harmon Kardon AVR245 
CPUMotherboardGraphicsRAM
Phenom II X4 B55 m4n82 deluxe ghetto gtx 460 patriot viper 1066 
Hard DriveOptical DriveCoolingOS
some crap sata dvd thermal take big typhoon windows 7 ultimate  
MonitorPowerCase
hp 2207h ultra lsp 750watt cooler master elite 
  hide details  
Reply
post #8 of 8

So I basically got it to work biggrin.gif . Since I'm folding on CPU only, I stripped out the GPU stuff to just show CPU usage & temps. But for some reason I'm getting two overlapping displays. Gonna try & see if I have two instances running or if I messed up the config file.... headscratch.gif

 
Compact Splash
(16 items)
 
 
CPUMotherboardGraphicsRAM
Intel 3220 Intel DQ77KB Integrated. What. Corsair 1x8GB Laptop Memory 
Hard DriveOSPowerCase
Plextor 128GB mSata SSD Ubuntu Delta PA-5M10 None. 
CPUMotherboardGraphicsRAM
Intel i7-3770k @ 4.7GHz ASRock Z77E MITX EVGA GTX 570 HD 2.5GB G.Skill Ripjaws X 2133MHz 
Hard DriveCoolingCoolingCooling
Samsung 830 128GB SSD XSPC EX120 + EX240 XSPC Raystorm Copper EK FC570 GTX SE (rev. 1.1) 
CoolingCoolingCoolingCooling
Swiftech MCP35X pump 3x GT AP-15 fans Tecnofront nano res one million bitspower fittings 
OSMonitorPowerCase
Windows 7 Dell U2410 Silverstone ST45SF-G Scratch built 14.75L prototype 
CPUMotherboardRAMHard Drive
Intel i7-3770k @ 4.8GHz [DELIDDED] ASRock Z77E Samsung Low Voltage 2x4GB Crucial M4 128GB 
Hard DriveCoolingOSMonitor
WD 80GB 5400RPM Corsair H100i ubuntu 13.10 18" Dell Ultrasharp (4:3 Free Oldskool Edition) 
PowerCase
Silverstone ST45SF Compact Splash Prototype 
  hide details  
Reply
 
Compact Splash
(16 items)
 
 
CPUMotherboardGraphicsRAM
Intel 3220 Intel DQ77KB Integrated. What. Corsair 1x8GB Laptop Memory 
Hard DriveOSPowerCase
Plextor 128GB mSata SSD Ubuntu Delta PA-5M10 None. 
CPUMotherboardGraphicsRAM
Intel i7-3770k @ 4.7GHz ASRock Z77E MITX EVGA GTX 570 HD 2.5GB G.Skill Ripjaws X 2133MHz 
Hard DriveCoolingCoolingCooling
Samsung 830 128GB SSD XSPC EX120 + EX240 XSPC Raystorm Copper EK FC570 GTX SE (rev. 1.1) 
CoolingCoolingCoolingCooling
Swiftech MCP35X pump 3x GT AP-15 fans Tecnofront nano res one million bitspower fittings 
OSMonitorPowerCase
Windows 7 Dell U2410 Silverstone ST45SF-G Scratch built 14.75L prototype 
CPUMotherboardRAMHard Drive
Intel i7-3770k @ 4.8GHz [DELIDDED] ASRock Z77E Samsung Low Voltage 2x4GB Crucial M4 128GB 
Hard DriveCoolingOSMonitor
WD 80GB 5400RPM Corsair H100i ubuntu 13.10 18" Dell Ultrasharp (4:3 Free Oldskool Edition) 
PowerCase
Silverstone ST45SF Compact Splash Prototype 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Overclock.net Folding@Home Team
Overclock.net › Forums › Overclockers Care › Overclock.net Folding@Home Team › HOW TO GUIDE: Linux system monitor, with F@H unit monitor (conky)