Last active
March 11, 2019 11:56
-
-
Save zcshiner/4b32980792d367222304 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.
This file contains hidden or 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
#!/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 |
For Elementary Loki, Ubuntu 16.04 you need to install gcc-multilib otherwise it won't understand 64bit building 32bit.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The above helped but I had to set the path to /lib64 not /lib in the first command (1): (from the page)
(export LD_LIBRARY_PATH=$LD_LIBARY_PATH:/usr/local/cuda/lib64)
...........
Problem: When executing a CUDA program under Linux, you get the following error:
error while loading shared libraries: libcudart.so.2: cannot open shared object file: No such file or directory
Solution: You need to add the path to the CUDA libraries to your $LD_LIBRARY_PATH environment variable.
Explanation:
When a CUDA program is executed, it needs to dynamically link to the CUDA runtime libraries. By default, these libraries are located in the /usr/local/cuda/lib directory. When searching for these libraries, the operating system looks in directories specified in the $LD_LIBRARY_PATH environment variable. If the CUDA library directory is not specified here, the program will fail with the error shown above.
There are two solutions (these assume you are using the bash shell, which is the default CS Department shell):