Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Copyright Dobromir Dobrev © 2017 : dobreff@gmail.com
- # Generate /etc/X11/xorg.conf by this command "nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration"
- # Remember to start Xorg before executing this script!
- # The configuration file
- JSON=`cat /root/config.json`
- osSeries=`echo $JSON | jq -r .osSeries`
- # End
- # Getting GPU Cards
- if [ "$osSeries" == "nvidia" ]; then
- GPU_COUNT=`nvidia-smi -a |grep Temperature | wc -l`
- else
- echo "Get going, no cards are supported"
- fi
- # End
- # Gettings NVIDIA Variables
- nvNVCClk=`echo $JSON | jq -r .nvCore`
- nvNVMemclk=`echo $JSON | jq -r .nvMem`
- nvNVPL=`echo $JSON | jq -r .nvPowerlimit`
- # Loop through
- x=0
- while [ $x -lt $GPU_COUNT ]; do
- # For NVIDIA Driver, Powerlimit is in W and is between Min and Max limit provided for each card ex. GTX 1070 min 100, max 216
- # Core clock is in stepping, for GTX 1070 value is from -200 to +200 for Max OC, leave at +100/+150 for best results
- # Memory clock is in stepping, for GTX 1070 value is from -200 to +1600 for Max OC, leave at +600/+800 for best results
- if [ "$osSeries" == "nvidia" ]; then
- nvidia-smi -i $x -pm 0
- nvidia-smi -i $x -pl $nvNVPL
- DISPLAY=:0.$x /usr/bin/nvidia-settings -a [gpu:$x]/GPUPowerMizerMode=1
- for y in {3..3}
- do
- DISPLAY=:0.$x /usr/bin/nvidia-settings -a [gpu:$x]/GPUGraphicsClockOffset[${y}]=$nvNVCClk
- DISPLAY=:0.$x /usr/bin/nvidia-settings -a [gpu:$x]/GPUMemoryTransferRateOffset[${y}]=$nvNVMemclk
- done
- fi
- x=$((x+1))
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement