GPU_QuickMag: Estimate GPU performance for Gridcoin

This is a continuation of my new Github project QuickMag. The goal of the QuickMag programs is to find a quick estimate of the performance of various types of hardware on the different whitelisted Gridcoin projects. The CPU version of this script was posted several days ago.

What does the program do?

As in the previously released script for CPUs, the program works by finding the top hosts on each project with the specified model of GPU. The performance (measured in magnitude) can be calculated by:

 Magnitude=hostRac/(115000*numberWhitelisted*TeamRac)

Finding Host RAC

The first step is to determine if the GPU supports CUDA (Nvidia only) because the GPUgrid project only supports CUDA projects. This is done by checking the GPU name against the complete list of Nvidia brands.

  nVidSearch=$( echo $GPUid | grep -E "(GT|Quadro|NVS|TITAN|GeForce|Tesla)" )

Additionally once we have sorted the GPUs by manufacturer (AMD/Nvidia) we can use various flags to search for hosts with only one GPU in their system.

For Nvidia cards:

 cat ./HostFiles/PROJECThosts | grep -A 4 "$GPUid" | sed -n '/CUDA*CUDA/!p;: m;//{$!{n;b m};}'| sed -n '/CAL/!p;: m;//{$!{n;b m};}'| grep -A 4 "$GPUid" | grep "expavg_credit"|grep -Eo "[0-9]+\.[0-9]+"| sort -rn | head -n $iters

For AMD cards:

cat ./HostFiles/PROJECThosts | grep -A 4 "$GPUid" | sed -n '/CAL*CAL/!p;: m;//{$!{n;b m};}'| sed -n '/CUDA/!p;: m;//{$!{n;b m};}'| grep -A 4 "$GPUid" | grep "expavg_credit"|grep -Eo "[0-9]+\.[0-9]+"| sort -rn | head -n $iters

These lines return the RAC values for the top hosts with a single GPU. The given GPUid if formatted correctly will only return sytems with one card of the specified type. The sed commands are used to remove systems with multiple GPUs of differing types.

Getting the number of Whitelisted Projects

The number of whitelisted projects is obtained from gridcoinstats.eu and used to determine how much total magnitude is allocated to each project. This number excludes greylisted projects, even if they are still included in the results of this script.

Finding Team RAC

The team RAC is found by searching the team files for each project.

 cat ./TeamFiles/PROJECTteam | grep -B 4 -A 3 ">Gridcoin<" | grep "expavg_credit"|grep -Eo "[0-9]+\.[0-9]+"

How to use GPU_QuickMag

It is necessary to run UpdateDatabaseFiles.sh to download the host and team database files before running GPU_QuickMag.

 bash UpdateDatabaseFiles.sh [Project Type] [debug]
     [Project Type]    can be cpu, gpu, or all
     [debug]                can specify debug (or -v) to enable progress bars in case of connection problems

This script download the necessary host data and team data to perform the calculations in the main script. This downloads and stores around 2GB of data on the local computer if project type gpu is selected.

The primary script is:

bash GPU_QuickMag.sh [GPUid] [#hosts] [output]
 
 [GPUid]    :   GPU id string e.g. 'GTX 1080 Ti|1|' (check GPUlist.data for more examples)
 [#hosts]   :   number of hosts to return data for
 [output]   :   save output to file name (optional)

This script scans the previously downloaded files and returns the magnitude of the top [#hosts] with a single GPU of the specified model. The data is saved to the file specified in [output] or printed in the terminal if no file destination is entered.

There is an additional file:

GPUlist.data

This file contains the names of common GPU models formatted to work with GPU_QuickMag.sh

For example 'GTX 1080 Ti|1|' or 'RX 580 Series|1|'

Notes:

  • AMD GPU naming conventions are inconsistent. Looking up the GPUid string in GPUlist.data is recommended.
  • Dual GPU cards need to be followed by a 2 (since BOINC detects each GPU die as a separate GPU). e.g. 'TESLA K80|2|'. Due to the rarity of these cards, it is usually better to search for the single die version of the card and double the score.

Example Usage

$ bash UpdateDatabaseFiles.sh gpu
Skipping cpu projects
Starting 8 downloads...

Progress: 100%

$ bash GPU_QuickMag.sh 'GTX 1060 6GB|1|' 4
amicable  16.34  15.05  13.91  12.27
collatz   24.19  24.16  22.65  20.20
enigma    22.54  18.44  17.48  15.65
pgrid     26.05  23.11  21.50  14.73
einstein  18.14  18.05  17.12  16.63
milkyway  15.73  7.10   6.93   5.64
seti      14.70  13.76  13.43  11.88
gpug      23.20  22.85  20.34  18.95

If data is missing, the code sets the associated values to zero.

Limitations

As brought up in the previous post, this script requires the GPU of interest to be in use, preferably by multiple people, on every project at full utilization to get the most accurate results. Hopefully some of this can be addressed by incorporating some information about the number of tasks being submitted and the date of the last submission in a future version of the code.

Where can I get the CPU_QuickMag and GPU_QuickMag scripts?

Get the scripts on Github, and try it for yourself!

https://github.com/nexus-prime/QuickMag

smallGRCopt.png



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
11 Comments