Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not compile, cmake can not find CUDA_LIB #240

Closed
renheren opened this issue Feb 28, 2019 · 22 comments
Closed

Can not compile, cmake can not find CUDA_LIB #240

renheren opened this issue Feb 28, 2019 · 22 comments

Comments

@renheren
Copy link

-- Found CUDA: /usr/local/cuda (found suitable version "9.2", minimum required is "7.5")
-- Found NVML: /usr/local/cuda/include
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g")
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Looking for syslog.h
-- Looking for syslog.h - found
-- Found MHD: /usr/lib/x86_64-linux-gnu/libmicrohttpd.so
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_LIB
linked by target "xmrig-nvidia" in directory /xmrig-nvidia

-- Configuring incomplete, errors occurred!
See also "/xmrig-nvidia/build/CMakeFiles/CMakeOutput.log".
See also "/xmrig-nvidia/build/CMakeFiles/CMakeError.log".

While for version 2.8.3, things went well. It seems it is related to commit 2e23e1e.
Have I missed something for compilation?

@ghost
Copy link

ghost commented Feb 28, 2019

@renheren

  • Do you have an nvidia graphics card?
  • Did you install nvidia drivers?
  • Did you install nvidia-cuda-toolkit?

If the answer to all above is yes, then there is probably a problem with CMakeLists.txt

@renheren
Copy link
Author

@xorz57
I used docker image nvidia/cuda:9.2-devel for compilation.
I do have nvidia graphic cards and driver on the host.
There should be a nvidia-cuda-toolkit installed inside the docker image.

@ghost
Copy link

ghost commented Feb 28, 2019

@renheren Did you also try other versions of this docker image? I am asking this because I see that version 9.2 is experimental. Try version 10 and see if it works there.
Maybe all of this is totally irrelevant but give it a try.

@renheren
Copy link
Author

renheren commented Mar 1, 2019

@xorz57
Actually, the one tagged as 9.2-devel is not experimental as that of 9.2-devel-ubuntu18.04.
I will try version 10 after upgrading nvidia driver to a higher version ( currently 396.54 ).

@renheren
Copy link
Author

renheren commented Mar 1, 2019

@xorz57
I've upgarded nvidia driver to version 410. But there is no luckiness. The same error was shown with docker image of 10.0-devel.

@ghost
Copy link

ghost commented Mar 1, 2019

@renheren Then it's problem with CMakeLists.txt

@ghost
Copy link

ghost commented Mar 1, 2019

@renheren If you can, log into your docker image with interactive terminal and use ccmake if possible to see all cmake variables/options.

@Perfect-Web
Copy link

any news on this ?

@RockZhaoL
Copy link

ln your/cudapath /usr/local/cuda
then

  • cmake ..
  • make

@jonathansd1
Copy link

+1 for this issue. I do not get this error on v2.11.0, but v2.13.0 and v2.14.0 both end with this error.

@RockZhaoL
Copy link

I set the default cuda path, then make OK.

@Perfect-Web
Copy link

@xorz57 can we merge this into master pls ?

@ghost
Copy link

ghost commented Mar 8, 2019

@Perfect-Web I am not maintaining this repository. You should probably talk to @xmrig

@xmrig
Copy link
Owner

xmrig commented Mar 8, 2019

#235 (comment)

Miner now required NVRTC both in compile time and runtime, including libcuda.so (driver component) because new algorithms cn/r and cn/wow require runtime compilation. Probably docker image not contains full CUDA installation or libcuda.so located in some non standard path. Previously miner was require only CUDA runtime (static library) now anything much more complicated.
Thank you.

@renheren
Copy link
Author

renheren commented Mar 8, 2019

@xorz57
With ccmake, I got the following options:

 ARM_TARGET                      *OFF
 BUILD_STATIC                    *OFF
 CMAKE_BUILD_TYPE                *
 CMAKE_INSTALL_PREFIX            */usr/local
 CUDA_ARCH                       *30;50;60;70
 CUDA_COMPILER                   *nvcc
 CUDA_HOST_COMPILER              */usr/bin/cc
 CUDA_KEEP_FILES                 *OFF
 CUDA_LIB                        *CUDA_LIB-NOTFOUND
 CUDA_NVRTC_LIB                  */usr/local/cuda/lib64/libnvrtc.so
 CUDA_SDK_ROOT_DIR               *CUDA_SDK_ROOT_DIR-NOTFOUND
 CUDA_SHOW_CODELINES             *OFF
 CUDA_SHOW_REGISTER              *OFF
 CUDA_TOOLKIT_ROOT_DIR           */usr/local/cuda
 CUDA_USE_STATIC_CUDA_RUNTIME    *ON
 CUDA_rt_LIBRARY                 */usr/lib/x86_64-linux-gnu/librt.so
 UV_INCLUDE_DIR                  */usr/include
 UV_LIBRARY                      */usr/lib/x86_64-linux-gnu/libuv.a
 WITH_AEON                       *ON
 WITH_ASM                        *ON
 WITH_CN_GPU                     *ON
 WITH_CN_PICO                    *ON
 WITH_DEBUG_LOG                  *OFF
 WITH_EMBEDDED_CONFIG            *OFF
 WITH_HTTPD                      *ON
 WITH_SUMO                       *ON
 WITH_TLS                        *ON
 XMR-STAK_LARGEGRID              *ON

still no cuda_lib is found.

@renheren
Copy link
Author

renheren commented Mar 8, 2019

@KnightZhao
I've tried to do this in both "/usr/local/cuda/lib64" and "/usr/local/cuda/", still the same error. Maybe it's something else.

@ghost
Copy link

ghost commented Mar 8, 2019

@renheren at least now you can see all cmake variables. Maybe @xmrig can help you.

@renheren
Copy link
Author

renheren commented Mar 8, 2019

@xmrig
I'm using nvidia/cuda:10.0-base image, no "libcuda.so" is found in "/usr/local/cuda/lib64", I'm going to check other image. A nice hint, thanks!

@renheren
Copy link
Author

renheren commented Mar 8, 2019

@xorz57
Yes, thanks!

@renheren
Copy link
Author

renheren commented Mar 8, 2019

@xmrig
I'm wrong, I was using devel image other than base image for compilation. So I don't know if it's easy to get a more complete cuda docker image currently.

@renheren
Copy link
Author

renheren commented Mar 8, 2019

@xmrig @xorz57 @KnightZhao
Update...
I've found "libcuda.so" in path of "/usr/local/cuda/lib64/stubs/libcuda.so". Sorry, I'm lost.

@renheren
Copy link
Author

renheren commented Mar 8, 2019

@xmrig @xorz57 @KnightZhao
Finally, I've solved my problem.
Just add option of "-DCUDA_LIB=/usr/local/cuda/lib64/stubs/libcuda.so" to cmake is enough for compilation.
Also, runtime image of cuda should be used instead of base image for execution to solve lackness of "libnvrtc.so.10.0".
Many Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants