Last active
August 25, 2023 05:06
-
-
Save Tknott95/8ec2e9363c86d0bbdb3d9aadba6eb332 to your computer and use it in GitHub Desktop.
shell script clocking GETTERS (from honeybadgerminer akja platform137)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# f - is fan speed by provding a gpu-index-# | |
# l - list amount of GPUs | |
# m - memory clock | |
# g - graphics clock | |
# p - power draw | |
# @TODO - NEED A SCRIPT TO PULL TEMP LIMIT | |
# CODE NEEDS TO BE REFACTORED THIS IS SLOPPY | |
# : after the flag makes you have to have a param | |
while getopts 't:f:a:l:m:p:g:' OPTION; do | |
case "$OPTION" in | |
t) | |
nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader -i $OPTARG | |
;; | |
f) | |
# nvidia-smi -q | grep -i fan | |
# nvidia-smi --query-gpu=fan.speed --format=csv,noheader | |
nvidia-smi --query-gpu=fan.speed --format=csv,noheader -i $OPTARG | grep -Eo "^[0-9]+" | |
;; | |
l) | |
nvidia-smi --list-gpus | wc -l | |
;; | |
m) | |
nvidia-smi --query-gpu=clocks.mem --format=csv,noheader -i $OPTARG | grep -Eo "^[0-9]+" | |
;; | |
p) | |
# @TODO - REMOVE REGEX AND MAKE IT FOR A FLOAT INSTEA OF INT | |
nvidia-smi --query-gpu=power.draw --format=csv,noheader -i $OPTARG | grep -Eo "^[0-9]+" | |
;; | |
g) | |
nvidia-smi --query-gpu=clocks.gr --format=csv,noheader -i $OPTARG | grep -Eo "^[0-9]+" | |
;; | |
?) | |
echo "script usage: $(basename \$0) [-l] [-h] [-a somevalue]" >&2 | |
exit 1 | |
;; | |
esac | |
done | |
# shift "$(($OPTIND -1))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
will clean this later so you can use it with an alias or bash function if wanted. For me this speeds up dev as I like to hand crank fans, not automated, when running high computation on my gpus. You can easily automate if you want via linux but that is your call.