Skip to content

Instantly share code, notes, and snippets.

@cryptozeny
Last active July 6, 2018 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cryptozeny/05bf30cadf8029fd60c9f73b80548ca0 to your computer and use it in GitHub Desktop.
Save cryptozeny/05bf30cadf8029fd60c9f73b80548ca0 to your computer and use it in GitHub Desktop.
GPUMining NVIDIA 396 & CUDA 9.2
# Dependancies \
sudo apt-get install -y \
build-essential `# For building the driver` \
gcc-multilib `# For providing 32-bit support` \
dkms `# For providing dkms support` \
xorg xorg-dev `# On a workstation with GUI` && \
\
# Create Blacklist for Nouveau Driver \
sudo bash -c "> /etc/modprobe.d/blacklist-nouveau.conf" ; `# 파일비우기` \
sudo touch /etc/modprobe.d/blacklist-nouveau.conf && `# 파일만들기` \
echo 'blacklist nouveau' | sudo tee --append /etc/modprobe.d/blacklist-nouveau.conf && `#삽입1` \
echo 'options nouveau modeset=0' | sudo tee --append /etc/modprobe.d/blacklist-nouveau.conf && `#삽입2` \
cat /etc/modprobe.d/blacklist-nouveau.conf && \
sudo update-initramfs -u `# 이것 이후에 꼭 재부팅을 해야함` \
\
# 재부팅
##############################################
# !!!경고!!! GUI가 없어진다!!! 터미널에서만 가능
##############################################
# Stop lightdm \
sudo service lightdm stop ; \
sudo service gdm stop ; \
sudo service kdm stop
##############################################
# !!!경고!!! 당황하지말고 Ctl+Alt+F1 으로 터미널 로그인
# >> .sh 실행
##############################################
# Download NVIDIA-396.24 \
cd && \
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/396.24/NVIDIA-Linux-x86_64-396.24.run && \
chmod +x NVIDIA-Linux-x86_64-396.24.run && \
sudo ./NVIDIA-Linux-x86_64-396.24.run --dkms -s && \
\
# Download CUDA-9.2 and Patch-1 \
cd && \
wget https://developer.nvidia.com/compute/cuda/9.2/Prod/local_installers/cuda_9.2.88_396.26_linux && \
wget https://developer.nvidia.com/compute/cuda/9.2/Prod/patches/1/cuda_9.2.88.1_linux && \
chmod +x cuda_9.2.88_396.26_linux && \
chmod +x cuda_9.2.88.1_linux && \
./cuda_9.2.88_396.26_linux --extract=$HOME && \
sudo ./cuda-linux.9.2.88-23920284.run && `#엄청 긴 사용계약서를 다 읽고(엔터) 마지막에 accept라고 써야한다. 그리고 엔터` \
\
# Configure Runtime Library \
sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf" && \
sudo ldconfig && \
sudo bash -c "echo /usr/local/cuda/bin > /etc/environments" && \
sudo ldconfig
# 재부팅
# 실행
nvidia-smi
# 참고
https://gist.github.com/wangruohui/df039f0dc434d6486f5d4d098aa52d07
#!/bin/sh
# Download NVIDIA-396.24 \
cd && \
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/396.24/NVIDIA-Linux-x86_64-396.24.run && \
chmod +x NVIDIA-Linux-x86_64-396.24.run && \
sudo ./NVIDIA-Linux-x86_64-396.24.run --dkms -s && \
\
# Download CUDA-9.2 and Patch-1 \
cd && \
wget https://developer.nvidia.com/compute/cuda/9.2/Prod/local_installers/cuda_9.2.88_396.26_linux && \
wget https://developer.nvidia.com/compute/cuda/9.2/Prod/patches/1/cuda_9.2.88.1_linux && \
chmod +x cuda_9.2.88_396.26_linux && \
chmod +x cuda_9.2.88.1_linux && \
./cuda_9.2.88_396.26_linux --extract=$HOME && \
sudo ./cuda-linux.9.2.88-23920284.run && \
\
# Configure Runtime Library \
sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf" && \
sudo ldconfig && \
sudo bash -c "echo /usr/local/cuda/bin > /etc/environments" && \
sudo ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment