This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add one-click install script for HiveOS
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
# Become root (similar to Ansible's become: yes) | ||
if [ "$EUID" -ne 0 ] | ||
then echo "Please run as root" | ||
exit | ||
fi | ||
|
||
# self-upgrade hiveos | ||
selfupgrade || true | ||
|
||
# update nvidia-drivers | ||
if nvidia-smi &>/dev/null; then | ||
nvidia-driver-update || echo "nvidia-driver-update encountered an error, but continuing..." | ||
else | ||
echo "No NVIDIA GPU detected. Skipping nvidia-driver-update." | ||
fi | ||
|
||
# install amd-drivers | ||
if lspci | grep -i --quiet "VGA.*AMD"; then | ||
amd-ocl-install 22.20 || echo "amd-ocl-install encountered an error, but continuing..." | ||
else | ||
echo "No AMD GPU detected. Skipping amd-ocl-install." | ||
fi | ||
|
||
# install dependencies | ||
apt install -y build-essential cmake mesa-common-dev tmux | ||
|
||
# clone quai-gpu-miner | ||
git clone https://github.com/dominant-strategies/quai-gpu-miner /home/user/quai-gpu-miner | ||
cd /home/user/quai-gpu-miner | ||
git submodule update --init --recursive | ||
|
||
# create build directory | ||
if [ ! -d "/home/user/quai-gpu-miner/build" ]; then | ||
mkdir -p '/home/user/quai-gpu-miner/build' | ||
fi | ||
|
||
# configure cmake | ||
cd '/home/user/quai-gpu-miner/build' | ||
cmake .. | ||
|
||
# build cmake | ||
cmake --build . | ||
|
||
# Finish | ||
echo "All tasks completed successfully!" | ||
|