Your Name 5 years ago
parent
commit
c297e057aa
3 changed files with 129 additions and 4 deletions
  1. 109 0
      amdgpu-pro-fans.sh
  2. 4 0
      miner_new.sh
  3. 16 4
      setup_amd.sh

+ 109 - 0
amdgpu-pro-fans.sh

@@ -0,0 +1,109 @@
+#!/usr/bin/env bash
+#####################################
+#  AMDGPU-PRO LINUX UTILITIES SUITE  #
+######################################
+# Utility Name: AMDGPU-PRO-FANS
+# Version: 0.1.5
+# Version Name: MahiMahi
+# https://github.com/DominiLux/amdgpu-pro-fans
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+#####################################################################
+#                          *** IMPORTANT ***                        #
+# DO NOT MODIFY PAST THIS POINT IF YOU DONT KNOW WHAT YOUR DOING!!! # 
+#####################################################################
+
+############################
+# COMMAND PARSED VARIABLES #
+############################
+adapter="all"
+targettemp=""
+fanpercent=""
+arguments="$@"
+##################
+# USAGE FUNCTION #
+##################
+usage ()
+{
+    echo "* AMDGPU-PRO-FANS *"
+    echo "error: invalid arguments"
+    echo "usage: $0 [-h] for help..."
+    exit
+}
+
+###########################
+# SET FAN SPEED FUNCTIONS #
+###########################
+
+set_all_fan_speeds ()
+{
+    cardcount="0";
+    for CurrentCard in  /sys/class/drm/card?/ ; do
+         for CurrentMonitor in "$CurrentCard"device/hwmon/hwmon?/ ; do
+              cd $CurrentMonitor # &>/dev/null
+              workingdir="`pwd`"
+              fanmax=$(head -1 "$workingdir"/pwm1_max)
+              if [ $fanmax -gt 0 ] ; then    
+                  speed=$(( fanmax * fanpercent ))
+                  speed=$(( speed / 100 ))
+                  sudo chown $USER "$workingdir"/pwm1_enable
+                  sudo chown $USER "$workingdir"/pwm1
+                  sudo echo -n "1" >> $workingdir/pwm1_enable # &>/dev/null
+                  sudo echo -n "$speed" >> $workingdir/pwm1 # &>/dev/null
+                  speedresults=$(head -1 "$workingdir"/pwm1)
+                  if [ $(( speedresults - speed )) -gt 6 ] ; then
+                       echo "Error Setting Speed For Card$cardcount!"
+                  else
+                       echo "Card$cardcount Speed Set To $fanpercent %"
+                  fi
+              else
+                  echo "Error: Unable To Determine Maximum Fan Speed For Card$cardcount!"
+              fi
+         done
+         cardcount="$(($cardcount + 1))"
+    done
+}
+
+set_fans_requested ()
+{
+    if [ "$adapter"="all" ] ; then
+        set_all_fan_speeds
+    fi
+}
+
+
+#################################
+# PARSE COMMAND LINE PARAMETERS #
+#################################
+command_line_parser ()
+{
+     parseline=`getopt -s bash -u -o a:s: -n '$0' -- "$arguments"` 
+     eval set -- "$parseline"
+     while true ; do
+        case "$1" in
+            -a ) adapter="$2" ; shift 2 ;;
+            -s ) fanpercent="$2" ; set_fans_requested ; break ;;
+            --)  break ;;
+            *) usage ; exit 1 ;;
+        esac    
+    done
+}
+
+#################
+# Home Function #
+#################
+
+command_line_parser
+exit;

+ 4 - 0
miner_new.sh

@@ -85,6 +85,10 @@ screen -dmS miner PhoenixMiner/PhoenixMiner -pool stratum+tcp://daggerhashimoto.
 #screen -dmS miner ./xmrig-amd -o stratum+tcp://cryptonightv8.eu-new.nicehash.com:3367 -u 3Fn2uyxTZ8Zu9ksVyakH6tT2XYzq1fyXf3.OpenRig -p x -a cryptonight --variant 2 &
 #screen -dmS miner ./xmrig-amd -o stratum+tcp://cryptonightv8.eu-new.nicehash.com:3367 -u 3Fn2uyxTZ8Zu9ksVyakH6tT2XYzq1fyXf3.OpenRig -p x -a cryptonight --variant 2 &
 #screen -dmS miner ./xmr-stak -o stratum+tcp://cryptonightv8.eu-new.nicehash.com:3367 -u 3Fn2uyxTZ8Zu9ksVyakH6tT2XYzq1fyXf3.OpenRig -p x --use-nicehash --currency cryptonight_v8
 #screen -dmS miner ./xmr-stak -o stratum+tcp://cryptonightv8.eu-new.nicehash.com:3367 -u 3Fn2uyxTZ8Zu9ksVyakH6tT2XYzq1fyXf3.OpenRig -p x --use-nicehash --currency cryptonight_v8
 
 
+# Nicehash cryptonight_r
+#screen -dmS miner ./xmr-stak -o stratum+tcp://cryptonightr.eu.nicehash.com:3375  -u 3Fn2uyxTZ8Zu9ksVyakH6tT2XYzq1fyXf3.OpenRig -p x --use-nicehash --currency cryptonight_r
+
+
 ##--------------
 ##--------------
 ##--- Lyra2z ---
 ##--- Lyra2z ---
 ##--------------
 ##--------------

+ 16 - 4
setup_amd.sh

@@ -8,7 +8,7 @@ lsb_r="`lsb_release -d | awk '{print$2" "$3}'`"
 curdir=$PWD
 curdir=$PWD
 
 
 #### OPTIONS ####
 #### OPTIONS ####
-host_name="Miner1"
+host_name="OpenRig"
 Drivers="17.50"
 Drivers="17.50"
 #Drivers="18.20"
 #Drivers="18.20"
 #Drivers="18.40"
 #Drivers="18.40"
@@ -17,7 +17,6 @@ Drivers="17.50"
 
 
 ROCM_="NO" #rcom compute
 ROCM_="NO" #rcom compute
 ETHMine="YES"
 ETHMine="YES"
-
 XMRIG_AMD="YES"
 XMRIG_AMD="YES"
 XMR_STAK="YES"
 XMR_STAK="YES"
 SGMINER="YES"
 SGMINER="YES"
@@ -28,7 +27,10 @@ Phoenix="YES"
 lolMiner="YES"
 lolMiner="YES"
 Gminer="YES"
 Gminer="YES"
 swap_size="16" # 0/4/8/16 Go
 swap_size="16" # 0/4/8/16 Go
+
+
 NewNiceHash="YES"
 NewNiceHash="YES"
+pro="NO"
 
 
 #script_version=`grep version version.txt | awk '{ print $2 }'`
 #script_version=`grep version version.txt | awk '{ print $2 }'`
 #rdate=`grep release version.txt | awk '{ print $2 }'`
 #rdate=`grep release version.txt | awk '{ print $2 }'`
@@ -146,7 +148,12 @@ if [ $Drivers = "17.50" ]
   sed -i -e "s/amdgpu-pro-dkms libdrm2-amdgpu-pro/libdrm2-amdgpu-pro/g" amdgpu-pro-install
   sed -i -e "s/amdgpu-pro-dkms libdrm2-amdgpu-pro/libdrm2-amdgpu-pro/g" amdgpu-pro-install
   ./amdgpu-pro-install --pro --opencl=legacy,rocm -y
   ./amdgpu-pro-install --pro --opencl=legacy,rocm -y
   else
   else
-  ./amdgpu-pro-install --pro --opencl=legacy -y
+if [ $PRO  = "YES" ]
+then
+./amdgpu-pro-install --pro --opencl=legacy -y
+else
+./amdgpu-install --opencl=legacy -y
+fi
   fi
   fi
 fi
 fi
 
 
@@ -162,7 +169,12 @@ if [ $Drivers = "18.20" ]
   sed -i -e "s/amdgpu-pro-dkms libdrm2-amdgpu-pro/libdrm2-amdgpu-pro/g" amdgpu-pro-install
   sed -i -e "s/amdgpu-pro-dkms libdrm2-amdgpu-pro/libdrm2-amdgpu-pro/g" amdgpu-pro-install
   ./amdgpu-pro-install --pro --opencl=legacy,rocm -y
   ./amdgpu-pro-install --pro --opencl=legacy,rocm -y
   else
   else
-  ./amdgpu-pro-install --pro --opencl=legacy -y
+ if [ $PRO = "YES" ]
+	then
+ 	./amdgpu-pro-install --pro --opencl=legacy -y
+	else
+	./amdgpu-install --opencl=legacy -y
+	fi
   fi
   fi
 fi
 fi