Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. #!/bin/bash
  2. # Copyright Dobromir Dobrev &copy 2017 : dobreff@gmail.com
  3. # Generate /etc/X11/xorg.conf by this command "nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration"
  4. # Remember to start Xorg before executing this script!
  5. # The configuration file
  6. JSON=`cat /root/config.json`
  7. osSeries=`echo $JSON | jq -r .osSeries`
  8. # End
  9. # Getting GPU Cards
  10. if [ "$osSeries" == "nvidia" ]; then
  11. GPU_COUNT=`nvidia-smi -a |grep Temperature | wc -l`
  12. else
  13. echo "Get going, no cards are supported"
  14. fi
  15. # End
  16. # Gettings NVIDIA Variables
  17. nvNVCClk=`echo $JSON | jq -r .nvCore`
  18. nvNVMemclk=`echo $JSON | jq -r .nvMem`
  19. nvNVPL=`echo $JSON | jq -r .nvPowerlimit`
  20. # Loop through
  21. x=0
  22. while [ $x -lt $GPU_COUNT ]; do
  23. # 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
  24. # Core clock is in stepping, for GTX 1070 value is from -200 to +200 for Max OC, leave at +100/+150 for best results
  25. # Memory clock is in stepping, for GTX 1070 value is from -200 to +1600 for Max OC, leave at +600/+800 for best results
  26. if [ "$osSeries" == "nvidia" ]; then
  27. nvidia-smi -i $x -pm 0
  28. nvidia-smi -i $x -pl $nvNVPL
  29. DISPLAY=:0.$x /usr/bin/nvidia-settings -a [gpu:$x]/GPUPowerMizerMode=1
  30. for y in {3..3}
  31. do
  32. DISPLAY=:0.$x /usr/bin/nvidia-settings -a [gpu:$x]/GPUGraphicsClockOffset[${y}]=$nvNVCClk
  33. DISPLAY=:0.$x /usr/bin/nvidia-settings -a [gpu:$x]/GPUMemoryTransferRateOffset[${y}]=$nvNVMemclk
  34. done
  35. fi
  36. x=$((x+1))
  37. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement