xmrig / xmrig-cuda

NVIDIA CUDA plugin for XMRig miner
GNU General Public License v3.0
378 stars 155 forks source link

xmrig-cuda build error #180

Open neerajnangireddy opened 1 year ago

neerajnangireddy commented 1 year ago

make -j$(nproc) [ 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/AstroBWT/dero/xmrig-cu_generated_AstroBWT.cu.o [ 16%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero_he/xmrig-cu_generated_AstroBWT_v2.cu.o [ 22%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/KawPow/raven/xmrig-cu_generated_KawPow.cu.o nvcc fatal : Unsupported gpu architecture 'compute_35' nvcc fatal : Unsupported gpu architecture 'compute_35' nvcc fatal : Unsupported gpu architecture 'compute_35' CMake Error at xmrig-cu_generated_KawPow.cu.o.Release.cmake:220 (message): Error generating /home/user/xmrig/build/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/KawPow/raven/./xmrig-cu_generated_KawPow.cu.o

CMake Error at xmrig-cu_generated_AstroBWT.cu.o.Release.cmake:220 (message): Error generating /home/user/xmrig/build/xmrig-cuda/build/CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero/./xmrig-cu_generated_AstroBWT.cu.o

CMake Error at xmrig-cu_generated_AstroBWT_v2.cu.o.Release.cmake:220 (message): Error generating /home/user/xmrig/build/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:147: CMakeFiles/xmrig-cu.dir/src/KawPow/raven/xmrig-cu_generated_KawPow.cu.o] Error 1 make[2]: Waiting for unfinished jobs.... 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[2]: [CMakeFiles/xmrig-cu.dir/build.make:133: CMakeFiles/xmrig-cu.dir/src/AstroBWT/dero/xmrig-cu_generated_AstroBWT.cu.o] Error 1 nvcc fatal : Unsupported gpu architecture 'compute_35' CMake Error at xmrig-cu_generated_cuda_extra.cu.o.Release.cmake:220 (message): Error generating /home/user/xmrig/build/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 make[1]: [CMakeFiles/Makefile2:84: CMakeFiles/xmrig-cu.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

my specs: OS: arch Kernel: 6.2.2-arch1-1 CUDA Version: 11.4 cmake version: 3.25.3

Dvd-Znf commented 1 year ago

I am experiencing the exact same issue
(Maybe this is related to #174 ?)
You can try updating CUDA to the latest version 12.1 and see if anything changes
Also what version of gcc are you using?

Dvd-Znf commented 1 year ago

Found temporary solution for building xmrig-cuda:
Add the -DCUDA_ARCH=(Your compute capability) when using cmake
You can find out your "compute capability" by looking at the official tables provided by nvidia: https://developer.nvidia.com/cuda-gpus#compute
For example, for my RTX 3050 i used -DCUDA_ARCH=75

However xmrig will still not work showing the message: "Driver does not support CUDA 12.1 API! Update your nVidia driver!"
Even though i am using the latest available drivers, this seems to be an issue with xmrig support for certain drivers

materia-nigra commented 1 year ago

The solution above did the trick! As an aside comment, for those trying to compile on ArchLinux, the process is the same as indicated on https://xmrig.com/docs/miner/build/ubuntu, except for different paths: -DCUDA_LIB=/opt/cuda/lib64/stubs/libcuda.so -DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda

MrFoxPro commented 1 year ago

Another way is to install nvidia-beta (530+) on Arch.

gary9872 commented 1 year ago

gcc 13 did not seem to work.

might need to roll back to 12.

metal3d commented 1 year ago

see #138 , I presented a solution using "spack" to build with another gcc version.

https://github.com/xmrig/xmrig-cuda/issues/138#issuecomment-1581437370