fireice-uk / xmr-stak-nvidia

Monero NVIDIA miner
GNU General Public License v3.0
249 stars 99 forks source link

Can't Compile on Ubuntu 16.04 #102

Open anamhira47 opened 6 years ago

anamhira47 commented 6 years ago

When I try to compile on my computer this happens. [ 4%] Building CXX object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. CMakeFiles/xmr-stak-nvidiaCuda.dir/build.make:62: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o' failed make[2]: *** [CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/all' failed make[1]: *** [CMakeFiles/xmr-stak-nvidiaCuda.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

How hand I link my cuda installation. I have CUDA 8.0 downloaded.

psychocrypt commented 6 years ago

your clang compiler is to old please use clang 4.x

hmfundInD commented 6 years ago

I'm also having problems compiling this on my computer. I purged clang and installed cuda 8 and clang 4.0, but when I run cmake . I get that the C compiler identification is unknown and that the CXX compiler identification is unknown. How can I identify clang-4.0 as the C compiler? my terminal output is below:

peg@Peg:~/xmr-stak-nvidia-master$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 8.0, V8.0.61

peg@Peg:~/xmr-stak-nvidia-master$ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

peg@Peg:~/xmr-stak-nvidia-master$ sudo apt-get install clang-4.0 Reading package lists... Done Building dependency tree
Reading state information... Done clang-4.0 is already the newest version (1:4.0-1ubuntu1~16.04.2). The following packages were automatically installed and are no longer required: libclang-common-3.8-dev libclang1-3.8 libllvm3.8 linux-headers-4.4.0-89 linux-headers-4.4.0-89-generic linux-image-4.4.0-89-generic linux-image-extra-4.4.0-89-generic llvm-3.8 llvm-3.8-dev llvm-3.8-runtime Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

peg@Peg:~/xmr-stak-nvidia-master$ export CC=/usr/bin/clang peg@Peg:~/xmr-stak-nvidia-master$ export CXX=/usr/bin/clang++ peg@Peg:~/xmr-stak-nvidia-master$ cmake . -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:1 (project): The CMAKE_C_COMPILER:

/usr/bin/clang

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:1 (project): The CMAKE_CXX_COMPILER:

/usr/bin/clang++

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred! See also "/home/peg/xmr-stak-nvidia-master/CMakeFiles/CMakeOutput.log". See also "/home/peg/xmr-stak-nvidia-master/CMakeFiles/CMakeError.log".

psychocrypt commented 6 years ago

You need clang as c and c++ compiler. Also remove all temporary files from the last compile else the old config is cached by cmake. You could also use g++ if you have trouble with clang.

hmfundInD commented 6 years ago

I deleted the folder, unziped the archive, then ran

export CC=/usr/bin/clang-4.0 export CXX=/usr/bin/clang++-4.0 cmake .

and it worked fine. When I run make install

, i get the following error:

peg@Peg:~/xmr-stak-nvidia-master$ make install [ 4%] Building NVCC (Device) object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/xmr-stak-nvidiaCuda_generated_cuda_extra.cu.o nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). nvcc fatal : The version ('40000') of the host compiler ('clang') is not supported CMake Error at xmr-stak-nvidiaCuda_generated_cuda_extra.cu.o.cmake:207 (message): Error generating /home/peg/xmr-stak-nvidia-master/CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/./xmr-stak-nvidiaCuda_generated_cuda_extra.cu.o

CMakeFiles/xmr-stak-nvidiaCuda.dir/build.make:70: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/xmr-stak-nvidiaCuda_generated_cuda_extra.cu.o' failed make[2]: [CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/xmr-stak-nvidiaCuda_generated_cuda_extra.cu.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/all' failed make[1]: [CMakeFiles/xmr-stak-nvidiaCuda.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

Why do I get a fatal nvcc error saying clang4.0 is not supported, and how can I successfully generate xmr-stak-nvidiaCuda_generated_cuda_extra.cu.o?

psychocrypt commented 6 years ago

cuda is not compatible with clang 4 but you can compile everything with clang device and host side.

Just add -DCUDA_COMPILER=clangas paramter to the cmake call

hmfundInD commented 6 years ago

Thanks, it compiled successfully. My final question is how do I run this at the terminal? Do I simply type

xmr-stak-nvidia

after I've setup "config.txt", or are there parameters that I need to include?

psychocrypt commented 6 years ago

goto the directory with the binary and type ./xmr-stak-nvidia

anamhira47 commented 6 years ago

I followed all of that, now I am getting this error. clang: error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_30. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_35. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_37. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_50. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_52. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_60. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_61. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_62. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. CMakeFiles/xmr-stak-nvidiaCuda.dir/build.make:62: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o' failed make[2]: *** [CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/all' failed

psychocrypt commented 6 years ago

@anamhira47 Clang has issues to find the cuda installation, please provide the output of cmake within a clean directory.

mlavkin commented 6 years ago

Hi, my problem, it's fresh 16.04 installation

root@farm1:/work/mine/xmr# export CC=/usr/bin/clang-4.0 root@farm1:/work/mine/xmr# export CXX=/usr/bin/clang++-4.0 root@farm1:/work/mine/xmr# cmake -DCUDA_COMPILER=clang . -- Configuring done -- Generating done -- Build files have been written to: /work/mine/xmr root@farm1:/work/mine/xmr# make [ 4%] Building CXX object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o c++: error: unrecognized command line option ‘--cuda-path=/usr’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_20’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_30’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_35’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_37’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_50’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_52’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_60’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_61’ c++: error: unrecognized command line option ‘--cuda-gpu-arch=sm_62’ CMakeFiles/xmr-stak-nvidiaCuda.dir/build.make:62: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o' failed make[2]: [CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/all' failed make[1]: [CMakeFiles/xmr-stak-nvidiaCuda.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

mlavkin commented 6 years ago

cmake did't use enviroment variables hmm.. I fix paths in cache file and now it work.

sheepchen commented 6 years ago

Hey mlavkin, can you please tell me what exactly you have done? Where is the cache file? Which part i have to edit?

psychocrypt commented 6 years ago

foto your build directory and call 'ccmake .' than you are able to edit all variables in a ncurses gui.

Am 27.09.2017 9:05 Nachm. schrieb "sheepchen" notifications@github.com:

Hey mlavkin, can you please tell me what exactly you have done? Where is the cache file? Which part i have to edit?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/fireice-uk/xmr-stak-nvidia/issues/102#issuecomment-332623913, or mute the thread https://github.com/notifications/unsubscribe-auth/AYsxtu_Q1uGioMn9W555DCY8F4cjSFpaks5smpx0gaJpZM4PDrft .

warptoy commented 6 years ago

Hello. I'm trying to build under Debian and/or Ubuntu, but I'm having the same problems as anamhira47: $ export CC=/usr/bin/clang-4.0 $ export CXX=/usr/bin/clang++-4.0 $ cmake -DCUDA_COMPILER=clang . -- The C compiler identification is Clang 4.0.1 -- The CXX compiler identification is Clang 4.0.1 -- Check for working C compiler: /usr/bin/clang-4.0 -- Check for working C compiler: /usr/bin/clang-4.0 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/clang++-4.0 -- Check for working CXX compiler: /usr/bin/clang++-4.0 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found CUDA: /usr (found suitable version "8.0", minimum required is "7.5") -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g") -- Configuring done -- Generating done -- Build files have been written to: /home/thetoy/monero/xmr-stak-nvidia $ make Scanning dependencies of target xmr-stak-nvidiaCrypto [ 4%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_blake256.c.o [ 9%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_groestl.c.o [ 14%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_jh.c.o [ 19%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_keccak.c.o [ 23%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_skein.c.o [ 28%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/soft_aes.c.o [ 33%] Linking C static library libxmr-stak-nvidiaCrypto.a [ 33%] Built target xmr-stak-nvidiaCrypto Scanning dependencies of target xmr-stak-nvidiaCuda [ 38%] Building CXX object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o clang: error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_30. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_35. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_37. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_50. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_52. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_60. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_61. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_62. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. CMakeFiles/xmr-stak-nvidiaCuda.dir/build.make:62: set di istruzioni per l'obiettivo "CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o" non riuscito make[2]: [CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o] Errore 1 CMakeFiles/Makefile2:104: set di istruzioni per l'obiettivo "CMakeFiles/xmr-stak-nvidiaCuda.dir/all" non riuscito make[1]: [CMakeFiles/xmr-stak-nvidiaCuda.dir/all] Errore 2 Makefile:129: set di istruzioni per l'obiettivo "all" non riuscito make: *** [all] Errore 2

It seems to me that CUDA SDK has not defined its location on the environment, so using ccmake: ccmake -DCUDA_COMPILER=clang . i get:

CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /home/thetoy/monero/xmr-stak-nvidia
CUDA_ARCH 20;30;35;37;50;52;60;61;62
CUDA_HOST_COMPILER /usr/bin/clang-4.0
CUDA_KEEP_FILES OFF
CUDA_SDK_ROOT_DIR CUDA_SDK_ROOT_DIR-NOTFOUND
CUDA_SHOW_REGISTER OFF
CUDA_TOOLKIT_ROOT_DIR /usr
CUDA_USE_STATIC_CUDA_RUNTIME ON
CUDA_rt_LIBRARY /usr/lib/x86_64-linux-gnu/librt.so
MHTD /usr/lib/x86_64-linux-gnu/libmicrohttpd.so
MICROHTTPD_REQUIRED ON
OpenSSL_REQUIRED ON
XMR-STAK_LARGEGRID ON
XMR-STAK_THREADS 0

I suppose that CUDA_SDK_ROOT_DIR-NOTFOUND is THE problem, but I'm not able to understand where it should point to.

I forgot to say that CUDA dev kit was installed from repository but Debian and Ubuntu seems to have the same problem.

Thanks any help.

sheepchen commented 6 years ago

I have complied mine on Ubuntu Server 17.04

here are the compiled programs: ftp://github:github2017@sheepchen.net/xmr-stak-nvidia.tar.gz ftp://github:github2017@sheepchen.net/xmr-stak-cpu.tar.gz

the CPU-Miner need some libs: ftp://github:github2017@sheepchen.net/xmr-stak-cpu_libs.tar.gz unzip with: cd /; tar -xzvf xmr-stak-cpu_libs.tar.gz

here are the NVIDIA-packs i used: ftp://github:github2017@sheepchen.net/cuda_9.0.176_384.81_linux-run ftp://github:github2017@sheepchen.net/NVIDIA-Linux-x86_64-384.90.run

For Filezilla: server: sheepchen.net user: github password: github2017 Protocol: implic. FTP over TLS

Files: -rw-r--r-- 1 ftp ftp 1643293725 Oct 19 16:22 cuda_9.0.176_384.81_linux-run -rw-r--r-- 1 ftp ftp 80833580 Oct 19 16:23 NVIDIA-Linux-x86_64-384.90.run -rw-r--r-- 1 ftp ftp 156738 Oct 19 16:36 xmr-stak-cpu.tar.gz -rw-r--r-- 1 ftp ftp 174865 Oct 19 16:16 xmr-stak-cpu_libs.tar.gz -rw-r--r-- 1 ftp ftp 1634720 Oct 19 16:36 xmr-stak-nvidia.tar.gz

Disclamer: you do all steps at your own risk! I am not responsable for what you do on your server!

If you try please let me know if it works..

warptoy commented 6 years ago

Thanks sheepchen but it doesn't work, as it's dynamically linked with some missing libraries... anyway I got it compiled under Debian using CUDA 8.0 (taken from NVidia, not from the repo) and gcc5.0! I had to use CUDA 8.0 as Debian (even if it's unstable release) is stuck to nvidia-driver ver 375.82

pic16f874 commented 6 years ago

Hi, I have same problem as Warptoy on Ubuntu 17.10

root@inv-H270-HD3:/home/kiv/mnrs/xmr-stak-nvidia-master# export CC=/usr/bin/clang root@inv-H270-HD3:/home/kiv/mnrs/xmr-stak-nvidia-master# export CXX=/usr/bin/clang++ root@inv-H270-HD3:/home/kiv/mnrs/xmr-stak-nvidia-master# cmake . -DCUDA_COMPILER=clang -- The C compiler identification is Clang 4.0.1 -- The CXX compiler identification is Clang 4.0.1 -- Check for working C compiler: /usr/bin/clang -- Check for working C compiler: /usr/bin/clang -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/clang++ -- Check for working CXX compiler: /usr/bin/clang++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found CUDA: /usr (found suitable version "8.0", minimum required is "7.5") -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g") -- Configuring done -- Generating done -- Build files have been written to: /home/kiv/mnrs/xmr-stak-nvidia-master root@inv-H270-HD3:/home/kiv/mnrs/xmr-stak-nvidia-master# make install Scanning dependencies of target xmr-stak-nvidiaCrypto [ 4%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_blake256.c.o [ 9%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_groestl.c.o [ 14%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_jh.c.o [ 19%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_keccak.c.o [ 23%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_skein.c.o [ 28%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/soft_aes.c.o [ 33%] Linking C static library libxmr-stak-nvidiaCrypto.a [ 33%] Built target xmr-stak-nvidiaCrypto Scanning dependencies of target xmr-stak-nvidiaCuda [ 38%] Building CXX object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_core.cu.o clang: error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_30. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_35. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_37. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_50. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_52. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_60. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_61. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find libdevice for sm_62. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes. clang: error: cannot find CUDA installation. Provide its path via --cuda-path, or pass -nocudainc to build without CUDA includes.

huertanix commented 6 years ago

Same.

Ubuntu 16.04 LTS / CUDA 9 / clang 4

printenv shows CXX=/usr/bin/clang++-4.0 and CC=/usr/bin/clang-4.0

huertanix@computer:~/xmr-stak-nvidia$ cmake -DCUDA_COMPILER=clang .
-- The C compiler identification is Clang 4.0.0
-- The CXX compiler identification is Clang 4.0.0
-- Check for working C compiler: /usr/bin/clang-4.0
-- Check for working C compiler: /usr/bin/clang-4.0 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++-4.0
-- Check for working CXX compiler: /usr/bin/clang++-4.0 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda-9.0 (found suitable version "9.0", minimum required is "7.5") 
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/huertanix/xmr-stak-nvidia

This runs without error, but make install fails:

huertanix@computer:~/xmr-stak-nvidia$ make install
Scanning dependencies of target xmr-stak-nvidiaCuda
[  4%] Building CXX object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_extra.cu.o
clang: error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_30. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_35. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_37. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_50. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_52. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_60. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_61. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_62. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
CMakeFiles/xmr-stak-nvidiaCuda.dir/build.make:62: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_extra.cu.o' failed
make[2]: *** [CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/cuda_extra.cu.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/xmr-stak-nvidiaCuda.dir/all' failed
make[1]: *** [CMakeFiles/xmr-stak-nvidiaCuda.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Has anyone got this installed?

psychocrypt commented 6 years ago

As I know clang 4.0 is not supporting device code builds with cuda9. Please use cuda8. This is a clang issue :-(

flicksterdoo commented 6 years ago

Tried with clang-3.8 with cuda-8.0 and got the same error as @ @huertanix above. I confirmed the directory with ccmake (cache file) and I've tried different things like nvcc and cuda 7.5 and in the end get some error or other. CPU compiles fine of course.....