This is pretty straight forward and very similar to @MrYukonC’s post detailing the process for Ubuntu 17.10. I had some minor difficulty building in 16.04, so I thought I would also document the process here in case anyone else has similar issues.
First, let’s install the tools we know we will need. If you are starting from Ubuntu mini, you will need g++. I think this is installed by default on other versions of the distro, so you may be able to omit g++ otherwise. It doesn’t hurt to include it - if you already have it installed, apt will just inform you.
sudo apt install g++ git cmake -y
Next, since Ubuntu 16.04 only has Boost v1.58 in the repositories, we will have to download and build boost manually. I used v1.66, but I believe 1.67 is out now and should work as well. Boost is pretty large, so building and installing takes a little while.
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 tar --bzip2 -xf boost_1_66_0.tar.bz2 cd boost_1_66_0 ./bootstrap.sh sudo ./b2 install
Next, we’ll need the CUDA toolkit. I used the toolkit downloaded right from nvidia’s website. Here I have the CUDA 9.1 net package installer (small .deb to add package sources to apt). This is a pretty large install, so it takes a while to install as well.
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub sudo apt-get update sudo apt-get install cuda -y
Now that the CUDA libraries are installed, it is time to set our PATH and LD_LIBRARY_PATH environment variables so CUDA can be found during compilation.
Finally, we have all the pre-requisites to build the aion reference miner. So, let’s grab the source and start building.
git clone https://github.com/aionnetwork/aion_miner.git cd aion_miner mkdir build && cd build
Here is where you might want to adjust the CMakeLists.txt file if you are having the AVX vs SSE crashing issue described in this thread.
At this point, I consistently get the following error:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find CUDA (missing: CUDA_CUDART_LIBRARY) (found version “9.1”)
This really makes no sense to me, since the error message even says that it found version “9.1”. Regardless, you cannot continue in an error state, so we have to remedy this! Now, I’m not a regular cmake user, so I am not sure the cause of this error or the correct way to fix it, but the easiest way I know of is to simply override the CMakeCache.txt file that is in the build directory. So, we’ll use nano and modify the CMakeCache.txt file
From here, you can either go to line 233, or use CTRL+W and search for CUDART, which is the missing reference. You’ll notice that the file says CUDA_CUDART_LIBRARY:FILEPATH=CUDA_CUDART_LIBRARY-NOTFOUND, and we will simply update this with the correct path.
Now use CTRL+O to write the file out, and CTRL+X to exit nano. Now just repeat the ‘cmake …/aion_reference_minor’ command and you should have a successful cmake stage:
– Boost version: 1.66.0
– Found the following Boost libraries:
– CUDA_NVCC_FLAGS: --disable-warnings;–ptxas-options=-v;-use_fast_math;-lineinfo;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70
– Configuring done
– Generating done
Now just run make and you should get a complete and functioning executable.
Running the miner with -ci should now show your CUDA devices.
2:~/test$ ./aionminer -ci
============================= aion reference miner====================== Equihash<210,9> CPU&GPU Miner for AION v0.1.8 Base on NiceHash equihash miner. ============================= aion reference miner======================
Number of CUDA devices found: 6
#0 GeForce GTX 1080 Ti | SM version: 6.1 | SM count: 28
#1 GeForce GTX 1080 Ti | SM version: 6.1 | SM count: 28
#2 GeForce GTX 1080 Ti | SM version: 6.1 | SM count: 28
#3 GeForce GTX 1080 Ti | SM version: 6.1 | SM count: 28
#4 GeForce GTX 1080 Ti | SM version: 6.1 | SM count: 28
#5 GeForce GTX 1080 Ti | SM version: 6.1 | SM count: 28