xmrig-cuda icon indicating copy to clipboard operation
xmrig-cuda copied to clipboard

CMake Error on Fedora

Open flolu opened this issue 2 years ago • 1 comments

I want to build xmrig-cuda on Fedora 36.

Here is what I've did:

Build XMRig

sudo dnf install -y git make cmake gcc gcc-c++ libstdc++-static libuv-static hwloc-devel openssl-devel
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build && cd xmrig/build
cmake ..
make -j$(nproc)

Install CUDA

sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/fedora35/x86_64/cuda-fedora35.repo
sudo dnf clean all
sudo dnf -y module install nvidia-driver:latest-dkms
sudo dnf -y install cuda

Build xmrig-cuda

git clone https://github.com/xmrig/xmrig-cuda.git
mkdir xmrig-cuda/build && cd xmrig-cuda/build
cmake .. -DCUDA_LIB=/usr/local/lib64/libcuda.so -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda

So far so good.

But then, running make -j$(nproc) throws the following errors:

[ 22%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero/xmrig-cu_generated_AstroBWT.cu.o
[ 16%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/xmrig-cu_generated_cuda_extra.cu.o
[ 16%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/KawPow/raven/xmrig-cu_generated_KawPow.cu.o
[ 27%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/RandomX/arqma/xmrig-cu_generated_randomx_arqma.cu.o
[ 27%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/RandomX/monero/xmrig-cu_generated_randomx_monero.cu.o
[ 44%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero_he/xmrig-cu_generated_AstroBWT_v2.cu.o
[ 44%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/RandomX/keva/xmrig-cu_generated_randomx_keva.cu.o
[ 44%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/RandomX/xmrig-cu_generated_randomx.cu.o
[ 50%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/xmrig-cu_generated_cuda_core.cu.o
[ 61%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/RandomX/wownero/xmrig-cu_generated_randomx_wownero.cu.o
[ 61%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/RandomX/graft/xmrig-cu_generated_randomx_graft.cu.o
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/include/crt/host_config.h:132:2: error: #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  132 | #error -- unsupported GNU version! gcc versions later than 11 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
      |  ^~~~~
CMake Error at xmrig-cu_generated_randomx.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/RandomX/./xmrig-cu_generated_randomx.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:119: CMakeFiles/xmrig-cu.dir/src/RandomX/xmrig-cu_generated_randomx.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at xmrig-cu_generated_randomx_monero.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/RandomX/monero/./xmrig-cu_generated_randomx_monero.cu.o


CMake Error at xmrig-cu_generated_randomx_graft.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/RandomX/graft/./xmrig-cu_generated_randomx_graft.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:112: CMakeFiles/xmrig-cu.dir/src/RandomX/monero/xmrig-cu_generated_randomx_monero.cu.o] Error 1
make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:98: CMakeFiles/xmrig-cu.dir/src/RandomX/graft/xmrig-cu_generated_randomx_graft.cu.o] Error 1
CMake Error at xmrig-cu_generated_KawPow.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/KawPow/raven/./xmrig-cu_generated_KawPow.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:147: CMakeFiles/xmrig-cu.dir/src/KawPow/raven/xmrig-cu_generated_KawPow.cu.o] Error 1
CMake Error at xmrig-cu_generated_randomx_keva.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/RandomX/keva/./xmrig-cu_generated_randomx_keva.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:105: CMakeFiles/xmrig-cu.dir/src/RandomX/keva/xmrig-cu_generated_randomx_keva.cu.o] Error 1
CMake Error at xmrig-cu_generated_randomx_arqma.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/RandomX/arqma/./xmrig-cu_generated_randomx_arqma.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:91: CMakeFiles/xmrig-cu.dir/src/RandomX/arqma/xmrig-cu_generated_randomx_arqma.cu.o] Error 1
CMake Error at xmrig-cu_generated_cuda_core.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/./xmrig-cu_generated_cuda_core.cu.o


CMake Error at xmrig-cu_generated_randomx_wownero.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/RandomX/wownero/./xmrig-cu_generated_randomx_wownero.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:77: CMakeFiles/xmrig-cu.dir/src/xmrig-cu_generated_cuda_core.cu.o] Error 1
make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:126: CMakeFiles/xmrig-cu.dir/src/RandomX/wownero/xmrig-cu_generated_randomx_wownero.cu.o] Error 1
CMake Error at xmrig-cu_generated_cuda_extra.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/./xmrig-cu_generated_cuda_extra.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:84: CMakeFiles/xmrig-cu.dir/src/xmrig-cu_generated_cuda_extra.cu.o] Error 1
CMake Error at xmrig-cu_generated_AstroBWT.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero/./xmrig-cu_generated_AstroBWT.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:133: CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero/xmrig-cu_generated_AstroBWT.cu.o] Error 1
CMake Error at xmrig-cu_generated_AstroBWT_v2.cu.o.Release.cmake:220 (message):
  Error generating
  /home/flolu/Documents/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero_he/./xmrig-cu_generated_AstroBWT_v2.cu.o


make[2]: *** [CMakeFiles/xmrig-cu.dir/build.make:140: CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero_he/xmrig-cu_generated_AstroBWT_v2.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/xmrig-cu.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

flolu avatar Jun 12 '22 13:06 flolu

Fedora 36 doesn't have gcc-11 which is required by whichever version of CUDA you pulled in. On CentOS there is some alternate compiler repo that has all the versions, unknown if that works for Fedora.

See also and follow this reddit thread

Spudz76 avatar Jun 14 '22 07:06 Spudz76