Your Name 7 years ago
parent
commit
22bdee88aa
1 changed files with 26 additions and 126 deletions
  1. 26 126
      setup_nvidia.sh

+ 26 - 126
setup_nvidia.sh

@@ -1,17 +1,12 @@
 #!/bin/bash
 set -e
-script_version="1.43"
-rdate="01/07/2018"
+script_version="0.1b"
+rdate="10/07/2018"
 remote_folder="http://wareck.free.fr/openrig"
-amd_driver_v="18.20-606296"
 
 #### OPTIONS ####
-ROCM_="NO" #rcom compute
 ETHMine="YES"
 GRIDV2="YES"
-SGMINER="YES"
-SGMINER_TT="YES"
-Lyra2z="YES"
 
 swap_size="0" # 0/4/8/16 Go
 
@@ -33,32 +28,28 @@ claymore_xmr_v="`curl -s $remote_folder/version.txt | awk 'NR==3 {print$3; exit}
 
 echo ""
 echo -n -e " \e[97m\u2554"
-for i in {1..36}; do echo -e -n "\u2550"; done
+for i in {1..40}; do echo -e -n "\u2550"; done
 echo -e "\u2557\e[0m"
-echo -e " \e[97m\u2551   Mining Rig Auto-install \e[93m"V$script_version"\e[0m\e[97m    \u2551\e[0m"
-echo -e " \e[97m\u2551      Release date: \e[93m"$rdate"\e[0m\e[97m      \u2551\e[0m"
-echo -e " \e[97m\u2551          wareck@gmail.com          \u2551\e[0m"
+echo -e " \e[97m\u2551  NVIDIA Mining Rig Auto-install \e[93m"V$script_version"\e[0m\e[97m  \u2551\e[0m"
+echo -e " \e[97m\u2551       Release date: \e[93m"$rdate"\e[0m\e[97m         \u2551\e[0m"
+echo -e " \e[97m\u2551           wareck@gmail.com             \u2551\e[0m"
 echo -n -e " \e[97m\u255A"
-for j in {1..36}; do echo -e -n "\u2550";done
+for j in {1..40}; do echo -e -n "\u2550";done
 echo -e -n "\u255D\e[0m"
 echo
-if [ $ROCM_ = "YES"  ]; then echo -e "\e[91m   AMD DRIVER + ROCm Compute firmware \e[0m\e[97m";fi
-if [ $ROCM_ = "NO"  ]; then echo -e "\e[91m    AMD GPU PRO Drivers $amd_driver_v\e[0m\e[97m";fi
-if [ $GRIDV2 = "YES" ]; then echo -e "\e[97m     +\e[91m NXZT Gridv2 support\e[0m\e[97m";fi
+
 if [ $ETHMine = "YES" ]; then echo -e "\e[97m     +\e[91m Etherminer \e[0m\e[97m";fi
-if [ $SGMINER = "YES" ]; then echo -e "\e[97m     +\e[91m Sgminer-nicehash\e[0m\e[97m";fi
-if [ $SGMINER_TT = "YES" ]; then echo -e "\e[97m     +\e[91m Sgminer-timetravel\e[0m\e[97m";fi
 echo -e "\e[97m     +\e[91m Claymore dualminer $claymore_dual_v\e[0m\e[97m"
-echo -e "\e[97m     +\e[91m Claymore zcash $claymore_zcash_v\e[0m\e[97m"
-echo -e "\e[97m     +\e[91m Claymore xmr $claymore_xmr_v\e[0m\e[97m"
-if [ $Lyra2z = "YES" ]; then echo -e "\e[97m     +\e[91m Lyra2z GPU Mining (experimental)\e[0m\e[97m";fi
+#echo -e "\e[97m     +\e[91m Claymore zcash $claymore_zcash_v\e[0m\e[97m"
+#echo -e "\e[97m     +\e[91m Claymore xmr $claymore_xmr_v\e[0m\e[97m"
+
 
 sleep 4
 sed -i -e "s/# set const/set const/g" /etc/nanorc
 
 echo -e "\n\e[95mExpand Disk :\e[0m"
-myDrive=`df -h | grep /dev/sda | awk ' { print $1 }'`
-myDrive1=`df -h | grep /dev/sda | awk ' { print $1 }'| cut -c -8`
+myDrive=`df -h | grep /dev/sd | awk ' { print $1 }'`
+myDrive1=`df -h | grep /dev/sd | awk ' { print $1 }'| cut -c -8`
 echo "My drive :$myDrive"
 echo "My drive1:$myDrive1"
 sudo growpart $myDrive 1 |true
@@ -67,8 +58,8 @@ echo -e "\e[97mDone !\e[0m"
 
 echo -e "\n\e[95mSystem Update :\e[0m"
 sudo apt-get update
-sudo add-apt-repository -y ppa:ethereum/ethereum -y
-sudo apt-get update
+#sudo add-apt-repository -y ppa:ethereum/ethereum -y
+#sudo apt-get update
 sudo apt install ethereum git screen htop curl ntp pv git cmake libcryptopp-dev libleveldb-dev libjsoncpp-dev \
 build-essential libcurl4-gnutls-dev libboost-all-dev libgmp-dev \
 libreadline-dev libmicrohttpd-dev libjansson-dev libgmp-dev libssl-dev unzip python-nfqueue python-scapy -y
@@ -79,20 +70,17 @@ sudo sed -i -e 's#GRUB_CMDLINE_LINUX=""#GRUB_CMDLINE_LINUX="amddgpu.vm_fragment_
 sudo update-grub2
 sudo apt dist-upgrade -y
 
-if [ $ROCM_ = "YES" ]
-then
-sudo apt-get install libnuma-dev -y
-echo -e "\n\e[95mInstall ROCm Compute:\e[0m"
-#update ROCM
-sudo apt-get install libnuma-dev -y
-wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | sudo apt-key add -
-sudo sh -c 'echo deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main > /etc/apt/sources.list.d/rocm.list'
+echo -e "\n\e[95mInstall Nvidia Drivers :\e[0m"
+sudo add-apt-repository ppa:graphics-drivers/ppa -y
 sudo apt-get update
-sudo apt-get install rocm-dkms rocm-opencl-dev -y
-sudo usermod -a -G video work
-cd ..
-echo -e "\e[97mDone !\e[0m"
-fi
+sudo apt-get install nvidia-375 -y
+cd /tmp
+wget -c https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64 -O cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64.deb
+sudo dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64.deb
+sudo apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub
+sudo apt-get update
+sudo apt-get install cuda
+exit
 
 echo -e "\n\e[95mInstall AMD Drivers :\e[0m"
 mkdir /home/work/tempo |true
@@ -103,39 +91,12 @@ curl -sf http://wareck.free.fr/grinder/drivers/amdgpu-pro-18.20-606296.tar.xz |
 #cd amdgpu-pro-17.50-511655
 cd amdgpu-pro-18.20-606296
 
-if [ $ROCM_ = "YES" ]
-then
-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
-else
-./amdgpu-pro-install --pro --opencl=legacy -y
-fi
-
-echo -e "\n\e[95mInstall AMD SDK :\e[0m"
-cd /home/work/tempo
-./AMD-APP-SDK-v3.0.130.136-GA-linux64.sh
-cd /opt/
-if [ -d ADL_SDK ]; then rm -r /opt/ADL_SDK; fi
-mkdir ADL_SDK
-cd ADL_SDK
-wget -c http://wareck.free.fr/grinder/drivers/ADL_SDK10.zip -O ADL_SDK.zip
-unzip -q ADL_SDK.zip
-cd ~
-echo -e "\e[97mDone !\e[0m"
-sleep 2
-
 echo -e "\n\e[95mInstall Claymore Miners :\e[0m"
 cd /home/work/
 sudo -u work curl -sf $remote_folder/miners/claymore_dual_$claymore_dual_v.tar.xz | tar xvJ
 echo ""
-sudo -u work curl -sf $remote_folder/miners/claymore_zcash_$claymore_zcash_v.tar.xz | tar xvJ
-echo ""
-sudo -u work curl -sf $remote_folder/miners/claymore_xmr_$claymore_xmr_v.tar.xz | tar xvJ
-echo ""
 sudo -u work curl -sf http://wareck.free.fr/grinder/miner.sh.tar.xz | tar xvJ
 sudo chown work claymore
-sudo chown work claymore_xmr
-sudo chown work claymore_zcash
 sudo chown work /home/work/miner.sh
 
 if [ $ETHMine = "YES" ]
@@ -154,74 +115,13 @@ cd cpp_ethminer
 git submodule update --init --recursive
 mkdir build |true
 cd build
-cmake .. -DETHASHCUDA=OFF -DETHASHCL=ON
+cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF
 make
 cd ~
 ln -s cpp_ethminer/build/ethminer/ethminer ethminer | true
 fi
 echo -e "\e[97mDone !\e[0m"
 
-if [ $SGMINER = "YES" ]
-then
-echo -e "\n\e[95mInstall SGMINER:\e[0m"
-cd ~
-if [ ! -d sgminer ]
-then
-git clone https://github.com/nicehash/sgminer.git
-cd sgminer
-else
-cd sgminer
-git pull
-fi
-sudo apt install git autoconf automake libtool build-essential libncurses5-dev libcurl4-gnutls-dev -y
-git submodule init
-git submodule update
-autoreconf -fi
-CFLAGS="-Os -Wall -march=native -I/opt/AMDAPPSDK-3.0/include" LDFLAGS="-L/opt/amdgpu-pro/lib/x86_64-linux-gnu" ./configure --disable-git-version --disable-adl
-make $(if $(THREADS="-j$(($(tail -c 2 /sys/devices/system/node/node0/cpulist 2>/dev/null)+2))"); then echo $THREADS; fi)
-cd ~
-echo -e "\e[97mDone !\e[0m"
-fi
-
-if [ $SGMINER_TT = "YES" ]
-then
-echo -e "\n\e[95mInstall SGMINER-TIMETRAVEL:\e[0m"
-cd ~
-if [ ! -d sgminer-timetravel ]
-then
-sudo -u work curl -sf http://wareck.free.fr/openrig/miners/sgminer-timetravel.tar.xz | tar xvJ
-cd ~
-echo -e "\e[97mDone !\e[0m"
-fi
-fi
-
-if [ $Lyra2z = "YES" ]
-then
-echo -e "\n\e[95mInstall Lyra2Z GPU Miner (experimental):\e[0m"
-cd ~
-sudo -u work curl -sf http://wareck.free.fr/grinder/lyra2z.tar.xz | tar xvJ
-fi
-cd ~/sgminer-msvc2015
-git pull
-./autogen.sh
-CFLAGS="-Os -Wall -march=native -I/opt/AMDAPPSDK-3.0/include" LDFLAGS="-L/opt/amdgpu-pro/lib/x86_64-linux-gnu" ./configure --disable-git-version --disable-adl
-make $(if $(THREADS="-j$(($(tail -c 2 /sys/devices/system/node/node0/cpulist 2>/dev/null)+2))"); then echo $THREADS; fi)
-cd ~
-echo "Done."
-
-if [ $GRIDV2 = "YES" ]
-then
-echo -e "\n\e[95mInstall Grid+v2 :\e[0m"
-cd ~
-if ! [ -d /home/work/gridfan ]
-then git clone https://github.com/CapitalF/gridfan.git
-sudo cp ~/gridfan/gridfan /usr/local/bin/
-fi
-gridfan ping | true
-gridfan set fans all speed 40 |true
-echo "Done."
-fi
-
 
 echo -e "\n\e[95mDownloading NoFees Patch:\e[0m"
 cd ~