xmrig / xmrig-cuda

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

Build Error on Linux #32

Closed BlankerL closed 4 years ago

BlankerL commented 4 years ago

Hello, I am a newbie to XMRig and Clang. I was building the CUDA plugin for Linux. During the make procedure, I got a log as follows,

[  7%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/RandomX/wownero/xmrig-cu_generated_randomx_wownero.cu.o
.../xmrig-cuda/src/RandomX/randomx_cuda.hpp(319): warning: pointless comparison of unsigned integer with zero
.../xmrig-cuda/src/RandomX/randomx_cuda.hpp(319): warning: pointless comparison of unsigned integer with zero
.../xmrig-cuda/src/RandomX/randomx_cuda.hpp(319): warning: pointless comparison of unsigned integer with zero
.../xmrig-cuda/src/RandomX/randomx_cuda.hpp(319): warning: pointless comparison of unsigned integer with zero
.../xmrig-cuda/src/RandomX/randomx_cuda.hpp(319): warning: pointless comparison of unsigned integer with zero
[ 15%] Building NVCC (Device) object CMakeFiles/xmrig-cu.dir/src/xmrig-cu_generated_cuda_core.cu.o

And the make just stuck at 23% for more than 10 minutes. I am not sure if it is a normal situation, if not, can anyone give me a possible solution?

I am really a newbie to Clang and the building process, know quite little about it. I tried to search the pointless comparison of unsigned integer with zero on Google, but it seems that this problem has different solutions for different projects.

Emperornero commented 4 years ago

Try committing more cores with the -jX flag when you do make.

I didn't do this and was stuck on 13% and 25% for a while. It eventually compiled. Making with -j8 made it compiled instantly on my 2700x.

Hhowever, it doesn't work with "Failed to load Cuda Plugin". Still working on figuring that out.

Spudz76 commented 4 years ago

Those warnings are normal. NVCC takes forever if you don't have a lot of memory also and will show nothing ("hang") for up to half an hour in some cases. Linux will swap junk in and out of virtual memory which is super super slow.

Adding more compile threads only works if you've already got way more than enough memory, otherwise it will make it worse.

BlankerL commented 4 years ago

Those warnings are normal. NVCC takes forever if you don't have a lot of memory also and will show nothing ("hang") for up to half an hour in some cases. Linux will swap junk in and out of virtual memory which is super super slow.

Adding more compile threads only works if you've already got way more than enough memory, otherwise it will make it worse.

I am not sure how much memory should I have? Currently, the machine have 4 cores (8 threads) and 16 GB memory.

Spudz76 commented 4 years ago

One thing that helps with compile time is to only enable the CUDA architectures you actually need via the cmake CUDA_ARCH variable. Otherwise it will build for all known GPUs and take forever (I have never compiled without specifying, it could take a while).

The other helpful options are CMAKE_VERBOSE_MAKEFILE and CUDA_VERBOSE_BUILD which should be set ON and then you can actually see what's going on during the otherwise silent long sections. I have never built without these on either, it probably makes the waiting easier.