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

When I try to run xmr-stak on macOS High Sierra with CUDA 9 on a mid-2012 MacBook Pro #287

Open dheerajdhobley opened 6 years ago

dheerajdhobley commented 6 years ago

WARNING: NVIDIA Insufficient driver! [2017-11-29 15:28:42] : WARNING: backend NVIDIA disabled.

How can I prevent this from happening? I want to use the GPU capabilities of my laptop for mining.

briard51 commented 6 years ago

It work for My MBP Retina Mid 2012. You need Xcode8.3, Cuda 9. Apple haven't updated yet their Nvidia Cuda driver, so I downloaded the official Cuda driver from Nvidia website [http://www.nvidia.com/object/macosx-cuda-9.0.222-driver.html].

On my Nvidia 650M, I get a 95 H/s.

dheerajdhobley commented 6 years ago

I downloaded Xcode 8.3's CommandLineTools to make sure nvcc is compatible. I'm able to build successfully. I also downloaded the official CUDA driver from the Nvidia website.

I get ~80-90 H/s too, but I don't think that's due to the GPU. It's only because of the CPU. When you run xmr-stak, don't you get WARNING: NVIDIA insufficient driver! WARNING: backend NVIDIA disabled too?

If not, could you please paste what you get when you start xmr-stak?

briard51 commented 6 years ago

Sorry to be late.

This is my nvidia.txt. Maybe it will help you.

/*

  • GPU configuration. You should play around with threads and blocks as the fastest settings will vary.
  • index - GPU index number usually starts from 0.
  • threads - Number of GPU threads (nothing to do with CPU threads).
  • blocks - Number of GPU blocks (nothing to do with CPU threads).
  • bfactor - Enables running the Cryptonight kernel in smaller pieces.
  • Increase if you want to reduce GPU lag. Recommended setting on GUI systems - 8
  • bsleep - Insert a delay of X microseconds between kernel launches.
  • Increase if you want to reduce GPU lag. Recommended setting on GUI systems - 100
  • affine_to_cpu - This will affine the thread to a CPU. This can make a GPU miner play along nicer with a CPU miner.
  • On the first run the miner will look at your system and suggest a basic configuration that will work,
  • you can try to tweak it from there to get the best performance.
  • A filled out configuration should look like this:
  • "gpu_threads_conf" :
  • [
  • { "index" : 0, "threads" : 17, "blocks" : 60, "bfactor" : 0, "bsleep" : 0, "affine_to_cpu" : false},
  • ], */

"gpu_threads_conf" : [ // gpu: GeForce GT 650M architecture: 30 // memory: 741/1023 MiB // smx: 2 { "index" : 0, "threads" : 50, "blocks" : 6, "bfactor" : 8, "bsleep" : 100, "affine_to_cpu" : false, },

],

dheerajdhobley commented 6 years ago

So I created a file called nvidia.txt in the folder where the xmr-stak executable is, and pasted your configuration. Now, the following runtime errors are emitted by xmr-stak: WARNING: NVIDIA Insufficient driver! WARNING: NVIDIA no device found [2017-11-30 14:09:13] : WARNING: backend NVIDIA disabled.

I have gone into my Energy-Saver settings and disabled automatic-graphics-switching so that NVIDIA's graphics card is always available.

psychocrypt commented 6 years ago

The file nvidia.txt is created by the miner if cuda is found. As the miner says you have driver issues. Do you compied the miner on a different machine? It looks like your driver is older than the driver which was used to compile the miner.

dheerajdhobley commented 6 years ago

I compiled the miner on macOS High Sierra. I tried to use it on the same machine. I installed an old version of Xcode's Command Line Tools because nvcc from CUDA 9 doesn't work with the newest AppleClang compiler (version 9). I'm not sure what compiling with an old compiler has to do with not being able to recognise the graphics card.

psychocrypt commented 6 years ago

I have no mac but if you use xcode and xcode provide an newer cuda than the driver than the runtime can not find your gpu.

Which cuda driver is installed? Which cuda toolkit do you use?

dheerajdhobley commented 6 years ago

Cuda Driver version: 9.0.222 Cuda Toolkit: Latest version from NVIDIA's website (CUDA 9)

I thought the CUDA driver and CUDA toolkit came together.

briard51 commented 6 years ago

I've got the same issue. Since Apple update their root bug, an update broke the cuda driver.

So wait & see that Nvidia update the Cuda driver.

-------------------------------------------------------------------
xmr-stak 2.0.0 79154f7

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
-------------------------------------------------------------------
[2017-11-30 17:33:09] : Start mining: MONERO
WARNING: NVIDIA Insufficient driver!
WARNING: NVIDIA no device found
[2017-11-30 17:33:09] : WARNING: backend NVIDIA disabled.
[2017-11-30 17:33:09] : WARNING on MacOS thread affinity is only advisory.
[2017-11-30 17:33:09] : Starting single thread, affinity: 0.
[2017-11-30 17:33:09] : hwloc: set_thisthread_membind not supported
[2017-11-30 17:33:09] : WARNING on MacOS thread affinity is only advisory.
[2017-11-30 17:33:09] : Starting single thread, affinity: 2.
[2017-11-30 17:33:09] : hwloc: set_thisthread_membind not supported
[2017-11-30 17:33:09] : WARNING on MacOS thread affinity is only advisory.
[2017-11-30 17:33:09] : Starting single thread, affinity: 4.
[2017-11-30 17:33:09] : hwloc: set_thisthread_membind not supported
[2017-11-30 17:33:09] : Fast-connecting to xmr-eu1.nanopool.org:14444 pool ...
[2017-11-30 17:33:09] : Pool xmr-eu1.nanopool.org:14444 connected. Logging in...
[2017-11-30 17:33:10] : Difficulty changed. Now: 120001.
[2017-11-30 17:33:10] : Pool logged in
psychocrypt commented 6 years ago

please empty the build folder and try to add as additional cmake parameter -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF Maybe this can solve you issue.

psychocrypt commented 6 years ago

If the last point is not helping please download the latest cuda and install it again: https://developer.nvidia.com/cuda-downloads

Do not forget to install the driver too.

dheerajdhobley commented 6 years ago

No change after emptying build folder and adding additional cmake parameter -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF.

psychocrypt commented 6 years ago

Than please install the cuda driver again. What type of gpu is in your mac book. maybe it is a fermi gpu than you need to install cuda8. Cuda9 is not supporting fermi.

dheerajdhobley commented 6 years ago

It's a GT 650M. I think Cuda9 supports it. Will try to install Cuda driver again.

briard51 commented 6 years ago

Please update your Nvidia Driver with [Nvidia Web Driver - 378.10.10.10.20.109](Nvidia Web Driver - 378.10.10.10.20.109)

When you install and restart your computer. After, go into the Nvidia Preference and choose the Nvidia driver instead of Apple's one.

xmr-stak 2.0.0 79154f7

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
-------------------------------------------------------------------
[2017-12-01 10:21:22] : Start mining: MONERO
[2017-12-01 10:21:23] : Starting NVIDIA GPU thread 0, no affinity.
[2017-12-01 10:21:23] : WARNING on MacOS thread affinity is only advisory.
[2017-12-01 10:21:23] : Starting single thread, affinity: 0.
[2017-12-01 10:21:23] : hwloc: set_thisthread_membind not supported
[2017-12-01 10:21:23] : WARNING on MacOS thread affinity is only advisory.
[2017-12-01 10:21:23] : Starting single thread, affinity: 2.
[2017-12-01 10:21:23] : hwloc: set_thisthread_membind not supported
[2017-12-01 10:21:23] : WARNING on MacOS thread affinity is only advisory.
[2017-12-01 10:21:23] : Starting single thread, affinity: 4.
[2017-12-01 10:21:23] : hwloc: set_thisthread_membind not supported
[2017-12-01 10:21:23] : Fast-connecting to xmr-eu1.nanopool.org:14444 pool ...
[2017-12-01 10:21:23] : Pool xmr-eu1.nanopool.org:14444 connected. Logging in...
[2017-12-01 10:21:23] : Difficulty changed. Now: 120001.
[2017-12-01 10:21:23] : Pool logged in.
HASHRATE REPORT - CPU
| ID | 10s |  60s |  15m | ID | 10s |  60s |  15m |
|  0 | (na) | (na) | (na) |  1 | (na) | (na) | (na) |
|  2 | (na) | (na) | (na) |
-----------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID | 10s |  60s |  15m |
|  0 | (na) | (na) | (na) |
---------------------------
Totals:   (na) (na) (na) H/s
Highest:  0.0 H/s

If you succeed and we can reproduce the solution, maybe it will be needed to update the documentation.

dheerajdhobley commented 6 years ago

briard51: Your solution worked perfectly for me. Instead of using OS X's version of NVIDIA's driver, I should use the latest NVIDIA WebDriver. I think this should be made part of the documentation for Mac OS users of xmr-stak, along with the fact that an older version of XCode's CommandLineTools has to be temporarily installed and xcode-select -switch'ed to, to compile using NVIDIA CUDA's libraries.

psychocrypt commented 6 years ago

@dheerajdhobley @briard51 Could you please open an pull request against the dev branch and update the documentation or post a text snipped which I can add to the documentation. I have no access to OSX therefore I can not write the documentation.

dheerajdhobley commented 6 years ago

The issue has surfaced again. I just updated NVIDIA's WebDriver to 378.10.10.10.25.102 and Xcode's CommandLineTools to the latest version because I'd already compiled xmr-stak so I didn't need the CommandLineTools any longer. The error message is the same as when I'd opened this issue:

WARNING: NVIDIA Insufficient driver! WARNING: NVIDIA no device found [2017-12-13 00:12:35] : WARNING: backend NVIDIA disabled.

rsimenok commented 6 years ago

go into the Nvidia Preference and choose the Nvidia driver instead of Apple's one.

@briard51 how did you to chose another driver and where?)

screen shot 2017-12-21 at 23 53 57

screen shot 2017-12-21 at 23 54 03

unformatt commented 6 years ago

image

image

rsimenok commented 6 years ago

@unformatt damn, why i don't have this menu?) what should i install?)

unformatt commented 6 years ago

@rsimenok - not sure. I installed the driver from here: http://www.nvidia.com/download/driverResults.aspx/125379/en-us

rsimenok commented 6 years ago

Thanks a lot @unformatt , i've successfully compiled only dev branch with latest cuda, web driver, and CommandLiteTools 8.3.3, but gpu is still disabled :(

unformatt commented 6 years ago

@rsimenok Did you call Cmake with these params? -DOpenCL_ENABLE=OFF -DCUDA_ENABLE=ON ?

rsimenok commented 6 years ago

@unformatt i tried cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOpenCL_ENABLE=OFF and cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOpenCL_ENABLE=OFF -DCUDA_ENABLE=ON, in compile log i see that cuda is found everything is ok but when i run xmr-stack i'm getting

WARNING: NVIDIA Insufficient driver!
WARNING: backend NVIDIA disabled.
psychocrypt commented 6 years ago

I know from an other issue that you need somehow to enable the cuda driver in a control center. But I have no mac, try to search within old closed issues maybe the solution is there.

unformatt commented 6 years ago

@rsimenok Try also specifying the CUDA API/Arch version. Mine was 5.2 so I passed -DCUDA_ARCH=52

I got the version from deviceQuery

>>> /Developer/NVIDIA/CUDA-9.0/samples/bin/x86_64/darwin/release/deviceQuery                           
/Developer/NVIDIA/CUDA-9.0/samples/bin/x86_64/darwin/release/deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 950"
  CUDA Driver Version / Runtime Version          9.1 / 9.0
  CUDA Capability Major/Minor version number:    5.2
rsimenok commented 6 years ago

@unformatt :(

./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL
rsimenok commented 6 years ago

@unformatt @psychocrypt I Found the solution! As i understand the important thing is to install web driver first and only after cuda drivers! Solution