fireice-uk / xmr-stak

Free Monero RandomX Miner and unified CryptoNight miner
GNU General Public License v3.0
4.05k stars 1.79k forks source link

Mac OS X 10.12 xmd-stak-nvidia CMake Error: #2281

Closed valeradyomin closed 5 years ago

valeradyomin commented 5 years ago

$ cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOpenCL_ENABLE=OFF . -- The C compiler identification is AppleClang 8.1.0.8020042 -- The CXX compiler identification is AppleClang 8.1.0.8020042 -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- 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: /Library/Developer/CommandLineTools/usr/bin/c++ -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- 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 - found -- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda (found suitable version "9.0", minimum required is "7.5") -- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.0.2q")
-- The ASM compiler identification is AppleClang -- Found assembler: /Library/Developer/CommandLineTools/usr/bin/cc 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_NVRTC_LIB linked by target "xmrstak_cuda_backend" in directory /Users/user/xmr-stak

-- Configuring incomplete, errors occurred!

valeradyomin commented 5 years ago

PS: wtf! sorry but I'm f*ing tired with this sheet... why it's always so many problems to compile something for OS X. rrrrrrr.....

Spudz76 commented 5 years ago

CUDA Toolkit incomplete? You have to install NVRTC library also for new CN-R algo, not just the base/minimal.

Spudz76 commented 5 years ago

NVRTC should be included with brew pack, but your library dirs are probably broken so it doesn't know where to find it. Apparently if you turned on ""SIP"" you should go kill it or you can't compile cool stuff anymore (""security"")

Check this: https://stackoverflow.com/a/47104838/2395052

valeradyomin commented 5 years ago

Thx! I'll try this later and give an answer.

nhnc commented 5 years ago

Is that possible to release the pre-compiled Linux binaries for nvidia GPU?

psychocrypt commented 5 years ago

Since a new dependency to cuda nvrtc I have issues to ship working binaries for linux and nvidia gpus. I need to solve this issue first.

valeradyomin commented 5 years ago

Nothing helps.. I've made all as described above (made clean OS X 10.13.6 install , all needable packages with homebrew installed without errors, cuda 10.1, SIP off) and same error as a result.

# 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_NVRTC_LIB #

It's disgusting!!! Fu..k ... I've got no words to describe anger.

Why not to upload compiled executabales?

psychocrypt commented 5 years ago

Sry since noboday of the developer owns a mac we can not provide binaries.

Spudz76 commented 5 years ago

Hunt your system for the location of the NVRTC library file somewhere under the CUDA Toolkit path Post that full path here Then we can patch the CMakeLists.txt for it

Spudz76 commented 5 years ago

Nevermind the CUDA Readme has it all, brb

Spudz76 commented 5 years ago

OK try this it's a really stupid patch but should be what's missing.

ebr commented 5 years ago

I have the same issue building in Docker. Also on OS X but that really shouldn't matter, since the image is FROM nvidia/cuda:9.0-base

git checkout 2.10.1
docker build --no-cache -t xmr-stak .

.... updates etc

+ cmake -DXMR-STAK_COMPILE=generic -DCUDA_ENABLE=ON -DOpenCL_ENABLE=OFF .
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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/c++
-- Check for working CXX compiler: /usr/bin/c++ -- 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 (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")
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Configuring incomplete, errors occurred!
See also "/xmr-stak/CMakeFiles/CMakeOutput.log".
See also "/xmr-stak/CMakeFiles/CMakeError.log".
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_NVRTC_LIB
    linked by target "xmrstak_cuda_backend" in directory /xmr-stak

Edit: I got around it by setting -DCUDA_ENABLE=OFF in the Dockerfile, since I don't need CUDA. still, it would be good to have CUDA_NVRTC_LIB set correctly.

psychocrypt commented 5 years ago

you must use the devel image from nvidia instead the base image.

Spudz76 commented 5 years ago

Either way, #2335 repairs the search path for OSX Even if there was a devel image of CUDA it still wouldn't find it, it's in /lib/ which is not currently in the subdir list for searching.

valeradyomin commented 5 years ago

Thanks! (https://github.com/Spudz76/xmr-stak/archive/dev-fixosxcuda.zip) - compiled perfect!

valeradyomin commented 5 years ago

Noope.. Again problem. Compiled but not working. Here is the log:


xmr-stak 2.10.1 4277a3c91

Brought to you by fireice_uk and psychocrypt under GPLv3. Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk). Based on NVIDIA mining code by KlausT and psychocrypt.

Configurable dev donation level is set to 2.0%


You can use following keys to display reports: 'h' - hashrate 'r' - results 'c' - connection

Upcoming xmr-stak-gui is sponsored by:

__ ____

| __ \ / \

#| |/ / | / \/

|| #| /| | | | / \ | | | | | || '|| '|/ | ' \ / __|| | | |

| |\ | || || () || _/| || || | | | | /| | | || ( | || |

_| _|_, | _/ __/ __,||| || _||| || _| __, |

/ | / |
              |___/   https://ryo-currency.com                       |___/

This currency is a way for us to implement the ideas that we were unable to in Monero. See https://github.com/fireice-uk/cryptonote-speedup-demo for details.

[2019-03-15 00:37:19] : Mining coin: cryptonight_r [2019-03-15 00:37:19] : NVIDIA: try to load library 'xmrstak_cuda_backend_cuda10_0' WARNING: NVIDIA cannot load backend library: dlopen(libxmrstak_cuda_backend_cuda10_0.dylib, 1): image not found [2019-03-15 00:37:19] : NVIDIA: try to load library 'xmrstak_cuda_backend_cuda9_2' WARNING: NVIDIA cannot load backend library: dlopen(libxmrstak_cuda_backend_cuda9_2.dylib, 1): image not found [2019-03-15 00:37:19] : NVIDIA: try to load library 'xmrstak_cuda_backend' WARNING: NVIDIA cannot load backend library: dlopen(libxmrstak_cuda_backend.dylib, 1): Library not loaded: @rpath/libnvrtc.10.1.dylib Referenced from: /Home/Folder/xmr-stak/libxmrstak_cuda_backend.dylib Reason: image not found [2019-03-15 00:37:19] : WARNING: backend NVIDIA disabled. [2019-03-15 00:37:19] : WARNING on macOS thread affinity is only advisory. [2019-03-15 00:37:19] : Starting 1x thread, affinity: 0. [2019-03-15 00:37:19] : hwloc: set_thisthread_membind not supported [2019-03-15 00:37:19] : WARNING on macOS thread affinity is only advisory. [2019-03-15 00:37:19] : Starting 1x thread, affinity: 2. [2019-03-15 00:37:19] : hwloc: set_thisthread_membind not supported [2019-03-15 00:37:19] : WARNING on macOS thread affinity is only advisory. [2019-03-15 00:37:19] : Starting 1x thread, affinity: 4. [2019-03-15 00:37:19] : hwloc: set_thisthread_membind not supported [2019-03-15 00:37:19] : WARNING on macOS thread affinity is only advisory. [2019-03-15 00:37:19] : Starting 1x thread, affinity: 6. [2019-03-15 00:37:19] : hwloc: set_thisthread_membind not supported [2019-03-15 00:37:19] : WARNING on macOS thread affinity is only advisory. [2019-03-15 00:37:19] : Starting 1x thread, affinity: 8. [2019-03-15 00:37:19] : hwloc: set_thisthread_membind not supported [2019-03-15 00:37:19] : WARNING on macOS thread affinity is only advisory. [2019-03-15 00:37:19] : Starting 1x thread, affinity: 10. [2019-03-15 00:37:19] : hwloc: set_thisthread_membind not supported [2019-03-15 00:37:19] : WARNING on macOS thread affinity is only advisory. [2019-03-15 00:37:19] : Starting 1x thread, affinity: 12. [2019-03-15 00:37:19] : hwloc: set_thisthread_membind not supported [2019-03-15 00:37:19] : Fast-connecting to pool.supportxmr.com:5555 pool ... [2019-03-15 00:37:19] : Pool pool.supportxmr.com:5555 connected. Logging in... [2019-03-15 00:37:19] : Difficulty changed. Now: 10000. [2019-03-15 00:37:19] : Pool logged in. [2019-03-15 00:37:20] : enable cryptonight_r asm 'intel_avx' cpu's [2019-03-15 00:37:20] : enable cryptonight_r asm 'intel_avx' cpu's [2019-03-15 00:37:20] : enable cryptonight_r asm 'intel_avx' cpu's [2019-03-15 00:37:20] : enable cryptonight_r asm 'intel_avx' cpu's [2019-03-15 00:37:20] : enable cryptonight_r asm 'intel_avx' cpu's [2019-03-15 00:37:20] : enable cryptonight_r asm 'intel_avx' cpu's [2019-03-15 00:37:20] : enable cryptonight_r asm 'intel_avx' cpu's [2019-03-15 00:37:28] : Difficulty changed. Now: 15385. [2019-03-15 00:37:28] : New block detected. [2019-03-15 00:37:46] : Result accepted by the pool. [2019-03-15 00:37:55] : Result accepted by the pool.

valeradyomin commented 5 years ago

So... any ideas?

Spudz76 commented 5 years ago

locate libnvrtc.10.1.dylib copy to run folder (/Home/Folder/xmr-stak/)

Windows and Linux both have a second library like nvrtc-builtins you will need that too if it exists in OSXCUDA, same deal copy to run folder.

Report where those files were originally found so we can add the copy-over into the build phase ("plug and play")

Alternative make sure you've installed CUDA to the system including NVRTC Runtime Components (again dunno what the OSX version looks like, based on Win/Lin)

Spudz76 commented 5 years ago

Or fix the libpath

export DYLD_LIBRARY_PATH="$CUDA_HOME/lib:$CUDA_HOME:$CUDA_HOME/extras/CUPTI/lib"
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
./xmr-stak blah blah blah
Spudz76 commented 5 years ago

That may not work either since SIP in which case this:

export CUDA_HOME=/usr/local/cuda
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
export PATH=$DYLD_LIBRARY_PATH:$PATH

OSX decided at some point (recently) that loading DLLs from a relative path is insecure so now it's blocked.

valeradyomin commented 5 years ago

I've placed libnvrtc.10.1.dylib to executable folder but still get error :

# WARNING: NVIDIA cannot load backend library: dlopen(libxmrstak_cuda_backend.dylib, 1): Library not loaded: @rpath/libnvrtc.10.1.dylib Referenced from: /Home/Folder/xmr-stak/libxmrstak_cuda_backend.dylib Reason: image not found [2019-03-15 00:37:19] : WARNING: backend NVIDIA disabled. #

P.S i 've used last 2.10.2 version.

valeradyomin commented 5 years ago

Does all packages ( hwloc libmicrohttpd gcc openssl cmake ) need to be installed on mining rig? Especially problem one - nvidia ( -> brew cask install nvidia-cuda )? I mean next situation: 1). first step is compiling working executables on mashine A. 2). JUST transfering executables to other mashines B-C-D... 3). run xmr-stak on A-B-C-D...

Will this version support such workflow? Because previous releases do it but now it seems to me not working.

Spudz76 commented 5 years ago

It will work but you have to put the dylib wherever the OS lets you do it and it's not insecured Newer OSX will no longer load dylib from working dir at all which is why that doesn't work Drop dylib in same place as the CUDA installer puts it

or run CUDA installer and only install the NVRTC runtime section, yes on every rig

Spudz76 commented 5 years ago

And you need the runtimes of openssl not the dev parts, on rigs hwloc httpd should both end up static linked and not need runtimes

I guess there might not be an actual GUI installer for mac-cuda? I've never even so much as seen one.

Spudz76 commented 5 years ago

That whole @rpath thing is where it's telling you it is only looking in the secured paths It will ignore the DYLD_LIBRARY_PATH and LD_LIBRARY_PATH completely it probably has to be in one of like three main system libdirs but I don't know where those are

valeradyomin commented 5 years ago

I'm wondering does "->brew cask install nvidia-cuda" affect on installed nvidia kext driver which I'm using on my hackintosh mashine. I don't want my comp to become unbootable. Please give me an answer.

Spudz76 commented 5 years ago

The file says it only copies the CUDA kext and does not appear to do anything driver related.

valeradyomin commented 5 years ago

xmr-stak 2.10.4 a5b8fb7

Brought to you by fireice_uk and psychocrypt under GPLv3. Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk). Based on NVIDIA mining code by KlausT and psychocrypt.

Configurable dev donation level is set to 2.0%


You can use following keys to display reports: 'h' - hashrate 'r' - results 'c' - connection

Upcoming xmr-stak-gui is sponsored by:    #####   __               ____

     ## | __ \             /  \

        #| |/ /        | / \/                    

   ||   #|    /| | | | / \ | |   | | | || '|| '|/ | ' \  / __|| | | |

         #| |\ | || || () || _/| || || |  | | |  /| | | || ( | || |

     ## _| _|_, | _/ __/ __,|||  ||  _||| || _| __, |

   #####           / |                                                  / |                   |/   https://ryo-currency.com                       |/

This currency is a way for us to implement the ideas that we were unable to in Monero. See https://github.com/fireice-uk/cryptonote-speedup-demo for details.

[2019-04-02 22:27:17] : Mining coin: cryptonight_r [2019-04-02 22:27:17] : NVIDIA: try to load library 'xmrstak_cuda_backend_cuda10_0' WARNING: NVIDIA cannot load backend library: dlopen(libxmrstak_cuda_backend_cuda10_0.dylib, 1): image not found [2019-04-02 22:27:17] : NVIDIA: try to load library 'xmrstak_cuda_backend_cuda9_2' WARNING: NVIDIA cannot load backend library: dlopen(libxmrstak_cuda_backend_cuda9_2.dylib, 1): image not found [2019-04-02 22:27:17] : NVIDIA: try to load library 'xmrstak_cuda_backend' NVIDIA: found 1 potential device's [2019-04-02 22:27:17] : Starting NVIDIA GPU thread 0, no affinity. CUDA [10.1/10.1] GPU#0, device architecture 61: "GeForce GTX 1080 Ti"... device init succeeded [2019-04-02 22:27:17] : NVIDIA: use library 'xmrstak_cuda_backend' [2019-04-02 22:27:17] : WARNING on macOS thread affinity is only advisory. [2019-04-02 22:27:17] : Starting 1x thread, affinity: 0. [2019-04-02 22:27:17] : hwloc: set_thisthread_membind not supported [2019-04-02 22:27:17] : WARNING on macOS thread affinity is only advisory. [2019-04-02 22:27:17] : Starting 1x thread, affinity: 2. [2019-04-02 22:27:17] : hwloc: set_thisthread_membind not supported [2019-04-02 22:27:17] : WARNING on macOS thread affinity is only advisory. [2019-04-02 22:27:17] : Starting 1x thread, affinity: 4. [2019-04-02 22:27:17] : hwloc: set_thisthread_membind not supported [2019-04-02 22:27:17] : WARNING on macOS thread affinity is only advisory. [2019-04-02 22:27:17] : Starting 1x thread, affinity: 6. [2019-04-02 22:27:17] : hwloc: set_thisthread_membind not supported [2019-04-02 22:27:17] : WARNING on macOS thread affinity is only advisory. [2019-04-02 22:27:17] : Starting 1x thread, affinity: 8. [2019-04-02 22:27:17] : hwloc: set_thisthread_membind not supported [2019-04-02 22:27:17] : WARNING on macOS thread affinity is only advisory. [2019-04-02 22:27:17] : Starting 1x thread, affinity: 10. [2019-04-02 22:27:17] : hwloc: set_thisthread_membind not supported [2019-04-02 22:27:17] : WARNING on macOS thread affinity is only advisory. [2019-04-02 22:27:17] : Starting 1x thread, affinity: 12. [2019-04-02 22:27:17] : hwloc: set_thisthread_membind not supported [2019-04-02 22:27:17] : Fast-connecting to pool.supportxmr.com:5555 pool ... [2019-04-02 22:27:17] : Pool pool.supportxmr.com:5555 connected. Logging in... [2019-04-02 22:27:18] : Difficulty changed. Now: 40000. [2019-04-02 22:27:18] : Pool logged in. [2019-04-02 22:27:18] : enable cryptonight_r asm 'intel_avx' cpu's [2019-04-02 22:27:18] : enable cryptonight_r asm 'intel_avx' cpu's [2019-04-02 22:27:18] : enable cryptonight_r asm 'intel_avx' cpu's [2019-04-02 22:27:18] : enable cryptonight_r asm 'intel_avx' cpu's [2019-04-02 22:27:18] : enable cryptonight_r asm 'intel_avx' cpu's [2019-04-02 22:27:18] : enable cryptonight_r asm 'intel_avx' cpu's [2019-04-02 22:27:18] : enable cryptonight_r asm 'intel_avx' cpu's [2019-04-02 22:27:18] : nvrtcCompileProgram failed: NVRTC_ERROR unknown [2019-04-02 22:27:18] : Program compile log: nvrtc: error: failed to open libnvrtc-builtins.dylib.   Make sure that libnvrtc-builtins.dylib is installed correctly. [CUDA] Error gpu 0: :1036 "device kernel image is invalid" libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: [CUDA] Error: device kernel image is invalid Abort trap: 6 logout

valeradyomin commented 5 years ago

Why??? Does??? It??? So??? Diffucult??? Just??? To??? Compile??? Working??? Executables??? ... it's f*cking killing me(.

Spudz76 commented 5 years ago

You make it hard on yourself by using OSX without also knowing exactly how to control its libraries and security.

Nobody here knows anything about OSX I just did google searching for you and guessed some things. It is truly up to you to figure out how to make it load that library and it's a CUDA/OSX security interaction bug not really our bug, or even anything to do with mining. You should be hunting for more generic "why does OSX have trouble loading dylib" and asking questions on OSX forums where OSX users hang out. That is definitely not here. And I still think it's partially some problem with new things OSX changed recently and nVidia may need to fix their CUDA installation procedure to follow the new rules (if any).

Or mine anything other than CN-R based coins and you don't need the two libnvrtc libs. Or mine with anything but OSX and this doesn't happen :)

timetoseek commented 5 years ago

Why??? Does??? It??? So??? Diffucult??? Just??? To??? Compile??? Working??? Executables??? ... it's f*cking killing me(.

So in addition to Linux Mint, I also use macOS on my 2012 Mac Pro, and let me tell you it is getting more difficult to compile things in general... one example (not related to xmr-stak), just the other day I was trying to compile a program only to find out that "x86intrin.h" (which is available on Linux) is not present on the MAC libc! So, workarounds are needed more and more, but they are requiring more effort.. and you're lucky that you have a nvidia card--- if you had an AMD (like the Radeon 580 that I've got in my Mac Pro), you would be disappointed to find out that the OpenCl version built into Mojave is not only ancient, but also depreciated :scream: yes, seems that OpenCL will be removed very soon, in favor of Metal

OK, one bit of advice for macOS -- please only compile with Xcode.. also worth checking that you are running the most current version, why roll the dice, just open a terminal window and type gcc -v

Good luck!

valeradyomin commented 5 years ago

I need to work on mac os but i don't like this os. There are no any problems some releases ago. Everything compiled and worked. Anyway thanks for advise!

Spudz76 commented 5 years ago

Yes, newer MacOS is broken (philosophically) and Mojave already abandoned OpenCL (and probably also sabotaging CUDA) in preference of their own new garbage, "Metal"... Not sure why they need their own stupid API, if anyone is abandoning OpenCL+CUDA they should be adopting Vulkan IMO, as that is probably going to replace them on all other platforms eventually.

I would bet literally nobody will write Metal miner kernels if Apple is the only reason to do so, nobody has even bothered (yet?) to make attempts converting miner kernels to Vulkan and it's been capable for a while now. Eventually OpenCL will cease to exist everywhere (unless old OS and drivers retained) since Vulkan is from the same Khronos Group and is intended to replace all older APIs at some point.

valeradyomin commented 5 years ago

Resently I've tried to switch for mining ethereum. Download compiled ethminer and get an error. This miner could detect my nvidia card but give an error about unrecognized Apple platform and stopped. F*cking bastards! How i hate this company and situation that almost everybody think they are cool and doing something special/perfect.

timetoseek commented 5 years ago

I would bet literally nobody will write Metal miner kernels if Apple is the only reason to do so, nobody has even bothered (yet?) to make attempts converting miner kernels to Vulkan and it's been capable for a while now. Eventually OpenCL will cease to exist everywhere (unless old OS and drivers retained) since Vulkan is from the same Khronos Group and is intended to replace all older APIs at some point.

True, there aren't likely to be Metal miner kernels, nor is there really a need--- I'll be honest :bowtie: we Mac enthusiasts do some mining for fun here and there, but if I was going to set up a cryptocurrency mining farm in Sichuan Province, I definitely wouldn't be running macOS :wink:

valeradyomin commented 5 years ago

When I was using Windows I could do many tricks in order to reach some result. But now I've got to use this OS ( f*king semi-linux ) and there are so many problems because I can't get full control.