From a09dac9f77c06dc0402ffccc8440b302141dabf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Jaro=C5=A1=C4=8Diak?= Date: Fri, 24 Nov 2023 06:33:58 -0500 Subject: [PATCH] Create vast-new.sh auto-detection of GPUs --- vast-new.sh | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 vast-new.sh diff --git a/vast-new.sh b/vast-new.sh new file mode 100644 index 0000000..3da862e --- /dev/null +++ b/vast-new.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +echo "-------------------------" +echo " XENBLOCKS " +echo " STARTING INSTALL " +echo "-------------------------" + +sudo apt -y upgrade > /dev/null 2>&1 +echo "STEP 1 of 10: Completed Packages Update" + +sudo apt -y install ocl-icd-opencl-dev > /dev/null 2>&1 +echo "STEP 2 of 10: Installed OpenCL" + +sudo apt -y install nano > /dev/null 2>&1 +echo "STEP 3 of 10: Installed Nano" + +sudo apt -y install cmake > /dev/null 2>&1 +echo "STEP 4 of 10: Installed cMake" + +sudo apt -y install python3-pip > /dev/null 2>&1 +echo "STEP 5 of 10: Installed Python" + +sudo git clone https://github.com/shanhaicoder/XENGPUMiner.git > /dev/null 2>&1 +echo "STEP 6 of 10: Cloned https://github.com/shanhaicoder/XENGPUMiner.git" + +cd XENGPUMiner +sudo chmod +x build.sh > /dev/null 2>&1 +sudo ./build.sh > /dev/null 2>&1 +echo "STEP 7 of 10: Permissions set!" + +sudo sed -i 's/account = 0x24691e54afafe2416a8252097c9ca67557271475/account = 0xca5F023af4F822353A563Ae6a3591bA2024495E8/g' config.conf > /dev/null 2>&1 +echo "STEP 8 of 10: Replaced ETH address" + +sudo pip install -U -r requirements.txt > /dev/null 2>&1 +echo "STEP 9 of 10: Installed Python Requirements" + +echo "STEP 10 of 10: Starting Miner & GPU" + +# Start the Python miner +sudo nohup python3 miner.py --gpu=true > miner.log 2>&1 & + +# Detect the number of GPUs (assuming GPUs are either NVIDIA, AMD, or Intel) +num_gpus=$(lspci | grep -E 'VGA|3D' | wc -l) + +# Start a miner for each GPU +for gpu_id in $(seq 0 $((num_gpus - 1))) +do + sudo nohup ./xengpuminer -d$gpu_id > xengpuminer-$gpu_id.log 2>&1 & + sleep 1 +done + +echo "-------------------------" +echo " MINING XENBLOCKS " +echo " https://xen.pub " +echo "-------------------------" +echo " " +tail -f /root/XENGPUMiner/miner.log