how to mine ZENcash in Linux

This is what I had to do on Ubuntu 18.04 LTS:

ccminer-2.2.5 from tpruvot:
The build instructions don’t tell the whole story, and thus it won’t compile. Do what the INSTALL tells you to:

sudo apt-get install libcurl4-openssl-dev libssl-dev libjansson-dev automake autotools-dev build-essential

Ubuntu is now shipped with gcc 6 or 7 so please install gcc/g++ 5 and make it the default (required by the cuda toolkit)
sudo apt-get install gcc-5 g++-5
sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-5 1
./build.sh

You’ll get lots of compile errors. Notice how it is still using g++-6 libraries even though we used update-alternatives. The compilation is actually failing because ./configure ran correctly with g++5, but nvcc never got the message that it has to use g++5.

/usr/include/c++/6/type_traits(532): error: expected a “>”

/usr/include/c++/6/type_traits(536): error: expected a “>”

/usr/include/c++/6/type_traits(544): error: expected a “>”

/usr/include/c++/6/type_traits(548): error: expected a “>”

/usr/include/c++/6/type_traits(558): error: namespace “std” has no member “nullptr_t”

/usr/include/c++/6/type_traits(579): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(585): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(592): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(599): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(609): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(635): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

mv -f .deps/ccminer-fuguecoin.Tpo .deps/ccminer-fuguecoin.Po
/usr/include/c++/6/type_traits(745): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(759): error: expected a “;”

/usr/include/c++/6/type_traits(774): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(784): error: expected a “)”

/usr/include/c++/6/type_traits(795): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6/type_traits(795): error: expected a type specifier

/usr/include/c++/6/type_traits(795): error: function returning function is not allowed

/usr/include/c++/6/type_traits(795): error: expected a “;”

/usr/include/c++/6/type_traits(801): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(802): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(832): error: function call is not allowed in a constant expression

/usr/include/c++/6/type_traits(832): error: function call is not allowed in a constant expression

/usr/include/c++/6/type_traits(832): error: this operator is not allowed in a template argument expression

/usr/include/c++/6/type_traits(843): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6/type_traits(843): error: expected a type specifier

/usr/include/c++/6/type_traits(843): error: function returning function is not allowed

/usr/include/c++/6/type_traits(843): error: expected a “;”

/usr/include/c++/6/type_traits(849): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(850): error: space required between adjacent “>” delimiters of nested template argument lists (“>>” is the right shift operator)

/usr/include/c++/6/type_traits(875): error: function returning function is not allowed

/usr/include/c++/6/type_traits(886): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6/type_traits(886): error: expected a type specifier

Error limit reached.
100 errors detected in the compilation of “/tmp/tmpxft_00003756_00000000-7_cuda_equi.compute_50.cpp1.ii”.
Compilation terminated.
Makefile:2712: recipe for target ‘equi/cuda_equi.o’ failed
make[2]: *** [equi/cuda_equi.o] Error 1
make[2]: *** Waiting for unfinished jobs….
mv -f .deps/ccminer-ccminer.Tpo .deps/ccminer-ccminer.Po

So after a failed ./build.sh, edit the environment variable NVCC in Makefile so that it looks like this:
NVCC = nvcc -ccbin g++-5

In fact, if you have CUDA 9, you don’t need to use GCC 5 anymore, but you STILL have to tell nvcc to use g++-6 after ./configure.

Overclocking in Linux

sudo is so nvidia-xconfig can create /etc/X11/xorg.conf, because by default that file doesn’t exist.
sudo nvidia-xconfig -a –cool-bits=8
nvidia-settings -c $DISPLAY -a ‘[gpu:0]/GPUGraphicsClockOffset[3]=100’
nvidia-settings -c $DISPLAY -a ‘[gpu:0]/GPUMemoryTransferRateOffset[3]=800’
nvidia-smi dmon (provides same data as GPU-Z, very useful)

Overall I’m impressed with nVidia’s Linux support. It Just Works (TM). Will buy nVidia again.

bminer
ccminer-tpruvot only gave 340 Sol/s and overclocking didn’t help (under Windows, I was getting 370 Sol/s). I tried out one of those miners with a 2% devfee (bminer), and I was blown away. Now I get 500 Sol/s. With this kind of increase, 2% devfee is not bad.

Plus, I didn’t have to compile anything.

nvidia-smi dmon output with ccminer

# gpu pwr temp sm mem enc dec mclk pclk
# Idx W C % % % % MHz MHz
0 141 61 79 65 0 0 4404 2050
0 135 61 79 66 0 0 4404 2050
0 135 61 83 69 0 0 4404 2050
0 140 61 80 67 0 0 4404 2050
0 90 61 82 67 0 0 4404 2050
0 108 61 85 71 0 0 4404 2037

nvidia-smi dmon output with bminer

# gpu pwr temp sm mem enc dec mclk pclk
# Idx W C % % % % MHz MHz
0 144 60 99 87 0 0 4404 1961
0 150 60 99 87 0 0 4404 1974
0 148 60 99 87 0 0 4404 1974
0 149 60 99 87 0 0 4404 1974
0 151 60 99 86 0 0 4404 1974
0 113 60 99 86 0 0 4404 1974
0 144 60 99 86 0 0 4404 1961
0 149 60 99 86 0 0 4404 1974
0 147 60 99 87 0 0 4404 1974

A big difference in utilization. However, when the utilization is this high, the desktop gets laggy, so I use ccminer when I also want to use my desktop.

Leave a Reply

Your email address will not be published. Required fields are marked *