nicehash / nheqminer

Equihash miner for NiceHash
https://www.nicehash.com
MIT License
768 stars 584 forks source link

Error while "make -j $(nproc)" because of CUDA9 and GCC6 #334

Open tunnckoCore opened 6 years ago

tunnckoCore commented 6 years ago

Seems like CUDA requires GCC6 but errors with it :D Pretty fantastic logic...

I know it's not a problem here, but some thread or workaround about that?

ArchLinux user here. Let me know if more info is needed.

output

~/Downloads/nheqminer/build master *
❯ make -j $(nproc)       
[  4%] Building NVCC (Device) object cuda_djezo/CMakeFiles/cuda_djezo.dir/cuda_djezo_generated_equi_miner.cu.o
[ 13%] Built target cpu_xenoncat
In file included from /opt/cuda/include/host_config.h:50:0,
                 from /opt/cuda/include/cuda_runtime.h:78,
                 from <command-line>:0:
/opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
 #error -- unsupported GNU version! gcc versions later than 6 are not supported!
  ^~~~~
CMake Error at cuda_djezo_generated_equi_miner.cu.o.cmake:219 (message):
  Error generating
  /home/charlike/Downloads/nheqminer/build/cuda_djezo/CMakeFiles/cuda_djezo.dir//./cuda_djezo_generated_equi_miner.cu.o

make[2]: *** [cuda_djezo/CMakeFiles/cuda_djezo.dir/build.make:65: cuda_djezo/CMakeFiles/cuda_djezo.dir/cuda_djezo_generated_equi_miner.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:178: cuda_djezo/CMakeFiles/cuda_djezo.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

~/Downloads/nheqminer/build master *
❯ ls /usr/bin/   

~/Downloads/nheqminer/build master *
❯ cuda

~/Downloads/nheqminer/build master *
❯ pacman -Qi cuda          
Name            : cuda
Version         : 9.0.176-4
Description     : NVIDIA's GPU programming toolkit
Architecture    : x86_64
URL             : http://www.nvidia.com/object/cuda_home.html
Licenses        : custom:NVIDIA
Groups          : None
Provides        : cuda-toolkit  cuda-sdk
Depends On      : gcc-libs  opencl-nvidia  gcc6
Optional Deps   : gdb: for cuda-gdb
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : cuda-toolkit  cuda-sdk
Installed Size  : 2.18 GiB
Packager        : Sven-Hendrik Haase <sh@lutzhaase.com>
Build Date      : Tue 03 Oct 2017 05:24:44 AM EEST
Install Date    : Tue 28 Nov 2017 07:30:43 AM EET
Install Reason  : Explicitly installed
Install Script  : Yes
Validated By    : Signature

and the CUDA file core problem (/opt/cuda/include/crt/host_config.h)

#if __GNUC__ > 6

#error -- unsupported GNU version! gcc versions later than 6 are not supported!

#endif /* __GNUC__ > 6 */
andersfylling commented 6 years ago

Same :/

CtrlC-Root commented 6 years ago

@olstenlarck @andersfylling I just built this on Arch using CUDA9 and GCC6. Not officially supported but it seems to work for me.

pacman -S cuda
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/cuda/lib64"
export PATH="$PATH:/opt/cuda/bin"
export CXX="/usr/bin/g++-6"
export CC="/usr/bin/gcc-6"

Open nheqminer/cuda_djezo/eqcuda.hpp in your favorite text editor and remove the line that's including the device_functions_decls.h header then save the file. Now follow the linux instructions in the README.md document.

ghost commented 6 years ago

@CtrlC-Root Thank you so much, this works for me as well !