Created
January 26, 2019 20:14
-
-
Save z-hao-wang/2fa324d335a7ea278c68065275fbf25e to your computer and use it in GitHub Desktop.
Grin miner setup ubuntu 18 cuda docker
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
### INSTALL CUDA DRIVERS | |
sudo rm /etc/apt/sources.list.d/cuda* | |
sudo apt remove nvidia-cuda-toolkit | |
sudo apt remove nvidia-* | |
sudo apt update | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | |
sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list' | |
sudo apt update | |
sudo apt install nvidia-driver-410 | |
sudo apt install cuda-10-0 | |
# set PATH for cuda 10.0 installation | |
if [ -d "/usr/local/cuda-10.0/bin/" ]; then | |
export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}} | |
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} | |
fi | |
## Test nvidia drivers | |
nvcc --version | |
##check you are picking up your nvidia cards | |
nvidia-smi | |
#nvidia docker setup | |
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers | |
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f | |
sudo apt-get purge -y nvidia-docker | |
# Add the package repositories | |
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ | |
sudo apt-key add - | |
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) | |
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \ | |
sudo tee /etc/apt/sources.list.d/nvidia-docker.list | |
sudo apt-get update | |
# may need to restart computer from here | |
# Install nvidia-docker2 and reload the Docker daemon configuration | |
sudo apt-get install -y nvidia-docker2 | |
sudo pkill -SIGHUP dockerd | |
# Test nvidia-smi with the latest official CUDA image | |
nvidia-docker run --rm nvidia/cuda:9.0-base nvidia-smi | |
cd ~ | |
git clone https://github.com/mimblewimble/grin-miner.git | |
cd grin-miner | |
docker build -t grin-miner . | |
nvidia-docker run --name miner1 --rm grin-miner | |
#check power | |
nvidia-smi -q -d POWER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment