KlausT / ccminer

Software for mining various cryptocoins
GNU General Public License v3.0
403 stars 312 forks source link

Trouble building on Ubuntu 17.10 amd64 #80

Open ksze opened 6 years ago

ksze commented 6 years ago

I'm trying to build on Ubuntu 17.10 amd64.

I have the latest proprietary NVIDIA packages installed, from the graphics-driver ppa:

$ dpkg -l '*nvidia*' '*cuda*' | grep '^ii'
ii  libcuda1-387                     387.34-0ubuntu0~gpu17.10.2 amd64        NVIDIA CUDA runtime library
ii  libcudart8.0:amd64               8.0.61-1                   amd64        NVIDIA CUDA Runtime Library
ii  nvidia-387                       387.34-0ubuntu0~gpu17.10.2 amd64        NVIDIA binary driver - version 387.34
ii  nvidia-cuda-dev                  8.0.61-1                   amd64        NVIDIA CUDA development files
ii  nvidia-cuda-doc                  8.0.61-1                   all          NVIDIA CUDA and OpenCL documentation
ii  nvidia-cuda-gdb                  8.0.61-1                   amd64        NVIDIA CUDA Debugger (GDB)
ii  nvidia-cuda-toolkit              8.0.61-1                   amd64        NVIDIA CUDA development toolkit
ii  nvidia-opencl-dev:amd64          8.0.61-1                   amd64        NVIDIA OpenCL development files
ii  nvidia-opencl-icd-387            387.34-0ubuntu0~gpu17.10.2 amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                     0.8.5                      amd64        Tools to enable NVIDIA's Prime
ii  nvidia-profiler                  8.0.61-1                   amd64        NVIDIA Profiler for CUDA and OpenCL
ii  nvidia-settings                  387.22-0ubuntu0~gpu17.10.1 amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-visual-profiler           8.0.61-1                   amd64        NVIDIA Visual Profiler for CUDA and OpenCL

I also have a bunch of different versions of gcc installed:

$ dpkg -l '*gcc*' | grep '^ii'
ii  gcc                  4:7.2.0-1ubuntu1 amd64        GNU C compiler
ii  gcc-4.8              4.8.5-4ubuntu6   amd64        GNU C compiler
ii  gcc-4.8-base:amd64   4.8.5-4ubuntu6   amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-5                5.5.0-1ubuntu1   amd64        GNU C compiler
ii  gcc-5-base:amd64     5.5.0-1ubuntu1   amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-6                6.4.0-8ubuntu1   amd64        GNU C compiler
ii  gcc-6-base:amd64     6.4.0-8ubuntu1   amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-7                7.2.0-8ubuntu3   amd64        GNU C compiler
ii  gcc-7-base:amd64     7.2.0-8ubuntu3   amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-7-base:i386      7.2.0-8ubuntu3   i386         GCC, the GNU Compiler Collection (base package)
ii  lib32gcc1            1:7.2.0-8ubuntu3 amd64        GCC support library (32 bit Version)
ii  libgcc-4.8-dev:amd64 4.8.5-4ubuntu6   amd64        GCC support library (development files)
ii  libgcc-5-dev:amd64   5.5.0-1ubuntu1   amd64        GCC support library (development files)
ii  libgcc-6-dev:amd64   6.4.0-8ubuntu1   amd64        GCC support library (development files)
ii  libgcc-7-dev:amd64   7.2.0-8ubuntu3   amd64        GCC support library (development files)
ii  libgcc1:amd64        1:7.2.0-8ubuntu3 amd64        GCC support library
ii  libgcc1:i386         1:7.2.0-8ubuntu3 i386         GCC support library

The last output lines of build.sh:

nvcc -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_37,code=sm_37 -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_30,code=sm_30 -I/usr/local/cuda/include -I. -O3 -std=c++11 -Xcompiler -Wall -D_FORCE_INLINES -I./compat/jansson --ptxas-options="-v" --maxrregcount=128 -o cuda_groestlcoin.o -c cuda_groestlcoin.cu
mv -f .deps/ccminer-stats.Tpo .deps/ccminer-stats.Po
g++ -DHAVE_CONFIG_H -I.  -fopenmp  -pthread -fno-strict-aliasing -I./compat/jansson -I/usr/local/cuda/include -DUSE_WRAPNVML -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME   -O3 -march=native -std=c++11 -D_REENTRANT -falign-functions=16 -falign-jumps=16 -falign-labels=16 -MT ccminer-myriadgroestl.o -MD -MP -MF .deps/ccminer-myriadgroestl.Tpo -c -o ccminer-myriadgroestl.o `test -f 'myriadgroestl.cpp' || echo './'`myriadgroestl.cpp
ERROR: No supported gcc/g++ host compiler found, but clang-3.8 is available.
       Use 'nvcc -ccbin clang-3.8' to use that instead.
Makefile:1882: recipe for target 'cuda_groestlcoin.o' failed
make[2]: *** [cuda_groestlcoin.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/ccminer-myriadgroestl.Tpo .deps/ccminer-myriadgroestl.Po
mv -f .deps/ccminer-cuda.Tpo .deps/ccminer-cuda.Po
mv -f sph/.deps/ccminer-fugue.Tpo sph/.deps/ccminer-fugue.Po
make[2]: Leaving directory '/home/m/ccminer-8.15'
Makefile:1436: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/m/ccminer-8.15'
Makefile:503: recipe for target 'all' failed
make: *** [all] Error 2
crazy7bird commented 6 years ago

hey try to folow this https://www.citizenz.info/miner-du-monero-sous-gnu-linux-avec-un-gpu-nvidia and replace cuda 8 by 9. by the way i never used build.sh in the process.

ksze commented 6 years ago

Haha! Thank god I actually read French. I’m from Montréal.

ksze commented 6 years ago

I got further along. I had to install the g++-4.8 package, not just gcc-4.8. ccminer has started to compile for me, using just the build.sh script. However, at one point I get an error about it jansson.h not found:

nvcc -gencode=arch=compute_61,code=sm_61 -I/usr/local/cuda/include -I. -O3 -std=c++11 -Xcompiler -Wall -D_FORCE_INLINES --ptxas-options="-v" -o neoscrypt/cuda_neoscrypt_tpruvot.o -c neoscrypt/cuda_neoscrypt_tpruvot.cu
In file included from neoscrypt/cuda_neoscrypt_tpruvot.cu:10:0:
./miner.h:16:21: fatal error: jansson.h: No such file or directory
 #include <jansson.h>
                     ^
compilation terminated.
Makefile:1925: recipe for target 'neoscrypt/cuda_neoscrypt_tpruvot.o' failed

If I look inside the ccminer source tree, there are two versions of jansson.h:

compat/includes-x86/jansson.h
compat/includes-x64/jansson.h
compat/jansson/jansson.h

The top two files are exactly the same, while the third one is different.

I'm not sure what to do next.

KlausT commented 6 years ago

You could install the jansson package on your system, for example. Since I don't use Linux I would have to guess why the compiler doesn't find the files in compat.

ksze commented 6 years ago

Installing the libjansson-dev package got me past the compilation stage. However, make still failed at the linking staged with a lot of "relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC" messages:

/usr/bin/ld: Algo256/cuda_fugue256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: cuda_groestlcoin.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: cuda_myriadgroestl.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lyra2/lyra2REv2.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: lyra2/cuda_lyra2v2.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Algo256/cuda_blake256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Algo256/cuda_groestl256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Algo256/cuda_keccak256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Algo256/cuda_skein256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Algo256/cuda_bmw256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Algo256/cuda_cubehash256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Algo256/blake256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Algo256/keccak256.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: JHA/jackpotcoin.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: JHA/cuda_jha_keccak512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: JHA/cuda_jha_compactionTest.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: cuda_checkhash.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/cuda_jh512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/cuda_quark_blake512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/cuda_quark_groestl512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/cuda_skein512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/cuda_bmw512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/cuda_quark_keccak512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/cuda_jh512keccak512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/quarkcoin.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: quark/cuda_quark_compactionTest.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: cuda_nist5.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: pentablake.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: skein.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Sia/sia.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: Sia/cuda_sia.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: qubit/qubit.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: qubit/qubit_luffa512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: qubit/deep.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: qubit/doom.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/x11.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/fresh.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/cuda_x11_luffa512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/cuda_x11_cubehash512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/cuda_x11_shavite512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/cuda_x11_simd512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/cuda_x11_echo.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/cuda_x11_luffa512_Cubehash.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x13/x13.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x13/cuda_x13_hamsi512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x13/cuda_x13_fugue512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x15/x14.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x15/x15.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x15/cuda_x14_shabal512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x15/cuda_x15_whirlpool.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x15/whirlpool.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x17/x17.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x17/cuda_x17_haval512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x17/cuda_x17_sha512.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/s3.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x11/c11.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: bitcoin.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: cuda_bitcoin.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x15/cuda_whirlpoolx.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: x15/whirlpoolx.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: neoscrypt/neoscrypt.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: neoscrypt/cuda_neoscrypt.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: neoscrypt/cuda_neoscrypt_tpruvot.o: relocation R_X86_64_32 against symbol `_Z26neoscrypt_gpu_hash_chacha1v' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:820: recipe for target 'ccminer' failed
make[2]: *** [ccminer] Error 1
make[2]: Leaving directory '/home/m/ccminer-8.15'
Makefile:1436: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/m/ccminer-8.15'
Makefile:503: recipe for target 'all' failed
make: *** [all] Error 2
eruditej commented 6 years ago

sudo apt-get install g++-4.9 CC=gcc-4.9 CPP=cpp-4.9 CXX=g++-4.9 ./configure

sadly, nvcc hates g++ > 5 still

cgarnier commented 6 years ago

Did you try inside a docker ? Try this tags https://hub.docker.com/r/cgarnier/ccminer/tags/ It require to be run with nvidia docker. Runing them inside dockers allow you to try many miners with many versions and fight less with dependencies mess.

FROM nvidia/cuda:9.0-devel-ubuntu16.04

RUN groupadd -g 2000 miner && \
    useradd -u 2000 -g miner -m -s /bin/bash miner && \
    echo 'miner:miner' | chpasswd
RUN apt-get -y update \
  &&  apt-get -y install \
    git \
    automake \
    libssl-dev \
    libcurl4-openssl-dev \
    libjansson-dev

USER miner
RUN cd && git clone -b cuda9 https://github.com/KlausT/ccminer.git
RUN cd ~/ccminer && ./build.sh

ENTRYPOINT ["/home/miner/ccminer/ccminer"]