Skip to content

Instantly share code, notes, and snippets.

@lemonlatte
Forked from zcshiner/UbuntuMiner
Created June 7, 2017 16:24
Show Gist options
  • Save lemonlatte/141e96c3e7f9f8e710c3687822510322 to your computer and use it in GitHub Desktop.
Save lemonlatte/141e96c3e7f9f8e710c3687822510322 to your computer and use it in GitHub Desktop.
UbuntuMiner. Command list to build an Ubuntu 14.04 Server with Cuda Toolkit 6.5, driver 352.41, and ccminer.
#!/bin/bash
### Command log to install Cuda Toolkit 6.5, driver 343.22, and ccminer.
## Update the system
sudo apt-get update && sudo apt-get -y dist-upgrade
# All the dependencies for Cuda & ccminer (I think)
sudo apt-get -y install gcc g++ build-essential automake linux-headers-$(uname -r) git gawk libcurl4-openssl-dev libjansson-dev xorg libc++-dev libgmp-dev python-dev
## Install the nvidia display driver
cd && wget http://us.download.nvidia.com/XFree86/Linux-x86_64/352.41/NVIDIA-Linux-x86_64-352.41.run
sudo chmod +x NVIDIA-Linux-x86_64-352.41.run
sudo ./NVIDIA-Linux-x86_64-352.41.run --accept-license --no-questions --disable-nouveau --no-install-compat32-libs
rm NVIDIA-Linux-x86_64-352.41.run
sudo echo 'GRUB_CMDLINE_LINUX="nomodeset"' >> /etc/default/grub
sudo update-grub
sudo nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration # flags enable OC and fan controls. via: https://bitcointalk.org/index.php?topic=826901.msg12279696#msg12279696
## Time to install cuda!
cd && wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb
rm cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit-6-5 # You're gonna have to accept the terms here. Not an unattended install!
# OPTIONAL: Install the 'cuda' package. It includes some more things.
sudo usermod -a -G video $USER
echo "" >> ~/.bashrc
echo "export PATH=/usr/local/cuda-6.5/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc
## You should probably restart the system here
sudo shutdown -r now
## Lets make the deviceQuery sample. This is used to verify cuda works
cd /usr/local/cuda/samples/1_Utilities/deviceQuery && sudo make
# If you see all of your cards listed, and the last line says "Result = PASS" you're good to go!
/usr/local/cuda/samples/1_Utilities/deviceQuery/deviceQuery
## djm34's fork requires this, and there aren't any packages available in the repos.
cd && wget http://www.mpir.org/mpir-2.6.0.tar.bz2
tar jxf mpir-2.6.0.tar.bz2
rm mpir-2.6.0.tar.bz2
cd mpir-2.6.0/
./configure
make && make check
sudo make install
cd && rm -r mpir-2.6.0/
echo "export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
## ccminer, djm34 fork. commit: 3cd198a461618eb3807fe608475f2034ef76bd53 as of this writing.
cd && git clone https://github.com/djm34/ccminer.git
cd ccminer/
./autogen.sh
./configure
make
### Thought this was useful? btc:14ciL7BuCyLy1LJcqhzQnpEQUGjinGU5TD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment