Skip to content

Instantly share code, notes, and snippets.

@moeiscool
Last active January 15, 2024 14:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save moeiscool/e4ea3ecfdcf0a29da21c5b7a687726b7 to your computer and use it in GitHub Desktop.
Save moeiscool/e4ea3ecfdcf0a29da21c5b7a687726b7 to your computer and use it in GitHub Desktop.
Install XMRig with GPU support Quick and Easy on Ubuntu 20.04
echo "Installing dependencies"
sudo apt install gcc-7 g++-7 cmake git -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 800 --slave /usr/bin/g++ g++ /usr/bin/g++-7
echo "============="
echo "Installing Node.js : For using PM2 daemon manager"
wget https://deb.nodesource.com/setup_12.x
chmod +x setup_12.x
./setup_12.x
sudo apt install nodejs -y
sudo apt install node-pre-gyp -y
rm setup_12.x
if ! [ -x "$(command -v npm)" ]; then
sudo apt install npm -y
fi
sudo npm install pm2@3.0.0 -g
echo "============="
echo "Install NVIDIA Drivers with CUDA 10.0 and CUDNN, CUDNN-dev"
echo "Probably don't need them all but I used this script and does have them."
echo "Reboot will be required before running part2.sh!!!!"
wget https://gitlab.com/Shinobi-Systems/Shinobi/-/raw/dev/INSTALL/cuda-10.sh
./cuda-10.sh
echo "I really hope you rebooted after part1.sh! Here we go!"
wget https://github.com/xmrig/xmrig/releases/download/v6.15.3/xmrig-6.15.3-linux-x64.tar.gz
tar -xvf xmrig-6.15.3-linux-x64.tar.gz
echo "============="
echo "Get and Build XMRig CUDA Plugin"
git clone https://github.com/xmrig/xmrig-cuda.git
cd xmrig-cuda
mkdir build
cd build
cmake ..
make
cp libxmrig-cuda.so ../xmrig-6.15.3/libxmrig-cuda.so
cd ../xmrig-6.15.3
echo "edit config.json and set the following :"
echo "cuda.enabled : true"
echo 'cuda.loader : "./libxmrig-cuda.so"'
cd ./xmrig-6.15.3
pm2 start xmrig -- --config config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment