GPU_QuickMag: Estimate GPU performance for GridcoinsteemCreated with Sketch.

in utopian-io •  7 years ago  (edited)

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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Nice, are there any plans to make a windows app for this?

Technically this can currently be run in windows using Bash on Ubuntu on Windows (in the windows store).

As for a more formal windows program... that is a little bit more difficult. It will depend on how much I can convert to python and if anything requires learning a new programing language.

You just planted 0.09 tree(s)!


Thanks to @ragnarokdel

We have planted already 3346.99 trees
out of 1,000,000


Let's save and restore Abongphen Highland Forest
in Cameroonian village Kedjom-Keku!
Plant trees with @treeplanter and get paid for it!
My Steem Power = 18543.43
Thanks a lot!
@martin.mikes coordinator of @kedjom-keku
treeplantermessage_ok.png

This post was upvoted by Steemgridcoin with the aim of promoting discussions surrounding Gridcoin and science.

This service is free. You can learn more on how to help here.

Have a nice day. :)

  ·  7 years ago (edited)

That's one great script!

(In the example above, top host for pgrid is unexpectedly high.)

I have compared with GTX 1060 3GB

Project  |  Top 4 magnitude(s) for Nvidia GTX 1060 3GB|1

amicable  9.83   9.77   8.95   7.02
collatz   23.01  22.53  22.09  21.85
enigma    14.84  9.73   5.30   5.25
pgrid     23.49  23.18  19.68  18.12
einstein  18.19  17.09  15.36  15.17
milkyway  5.15   3.66   2.64   2.50
seti      22.81  14.30  12.18  11.89
gpug      19.54  19.44  19.15  18.69

And while for some projects like collatz or seti they (GTX 1060 3GB and GTX 1060 6GB) are almost equal, differences in other projects like enigma, amicable and milky are huge.

Well that's another bug. Turns out the rig has 12 GTX 1060 6GBs in it. I didn't even know you could put more than 8 Nvidia cards in a single machine without running into driver limitations.

Luckily the fix is simply changing the GPUid to be 'GTX 1060 6GB|1|'

Documentation and GPUlist.data has been updated.

  ·  7 years ago (edited)

Oh shit :D
I can't wait to check it
edit: nevermind, not supporting windows :|
Maybe someone can check it for me:
-GPU GTX 960m 4GB
-CPU: i5-6300HQ

Loading...

Hey @nexusprime I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]