fireice-uk / xmr-stak-nvidia

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

"No CUDA device found!" - miner doesn't suggest basic configuration #39

Open fresheneesz opened 7 years ago

fresheneesz commented 7 years ago

Running the miner for the first time (after filling in the mining pool and my address only, leaving gpu_threads_conf as null) outputs "No CUDA device found!" and quits. The config.txt file says "On the first run the miner will look at your system and suggest a basic configuration that will work", but doesn't look like this is happening.

fireice-uk commented 7 years ago

What is your hardware setup?

fresheneesz commented 7 years ago

NVIDIA GeForce GTX 870M. I have since reworked my config and got it working for up to 3 or 4 minutes, but it crashed with another error, which I reported as a different issue.

psychocrypt commented 7 years ago

@fresheneesz If you get it running, can we close this issue? Could you please post how you solved this issue.

The issue with the crash after 3 minutes is #40

fresheneesz commented 7 years ago

I was given the advice to reduce blocks to a multiple of threads (or something else I forgot what someone told me). Apparently my GPU has 7 something (threads or something else) so I have some multiple of 7 blocks.

I changed my config from having 7 threads and 20 blocks to 7 threads and 7 blocks.

I don't think this ticket should be closed until a better error message is given for this case and until the miner actually suggests configuration like it says it will. It doesn't make sense that it wouldn't find the device just because I botched my config

hanserasmus commented 7 years ago

I have the same issue as @fresheneesz in that now config is suggested upon first start up. Centos 7 with gcc 5.3.1 CUDA 8 and cmake3. Build went well, but upon starting up, No CUDA devices found. No basic config suggested and no config parameters working at all.

Any ideas would be nice.

psychocrypt commented 7 years ago

@hanserasmus Is a config suggested or not. Please post your config,your OS and the output of nvidia-smi (only in linux available)

hanserasmus commented 7 years ago

Nope, no config suggested at all.

CentOS Linux release 7.3.1611 (Core) cmake3-3.6.3-1.el7.x86_64

nvidia-smi Sun Aug 27 21:43:47 2017
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 384.59 Driver Version: 384.59 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 Quadro K610M Off | 00000000:01:00.0 On | N/A | | N/A 43C P8 N/A / N/A | 328MiB / 980MiB | 0% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 Not Supported | +-----------------------------------------------------------------------------+

Don't know what this is supposed to tell you, but according to NVIDIA's site this processor is CUDA capable. I have installed CUDA 8 (cuda-8.0.61-1.x86_64) and it was successful. Shows up with rpm -qa | grep cuda.

config.txt

Results are the same if the gpu_threads definition is left default (null).

jonasacres commented 7 years ago

I'm having a similar problem. Output of cmake, make, bin/xmr-stak-nvidia, cat config.txt and nvidia-smi included below. I'm on Ubuntu 16.04 with a Titan Xp and CUDA 8.0.

update: i added some more debug output to cuda_get_devicecount, where this seems to come from: No CUDA device found! Error 30: unknown error

I'm going to start testing to see if my CUDA install works in general. This is a new system.

update 2: yeah ok, it was my system. CUDA drivers were not installed properly and no other CUDA stuff was working.


original output

> cmake .
18:56:10
-- 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 "8.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/jonas/repos/thirdparty/xmr-stak-nvidia
> make
18:56:16
[  4%] Building NVCC (Device) object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/xmr-stak-nvidiaCuda_generated_cuda_core.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 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).
[  9%] 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 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).

Scanning dependencies of target xmr-stak-nvidiaCuda
[ 14%] Linking CXX static library libxmr-stak-nvidiaCuda.a
[ 14%] Built target xmr-stak-nvidiaCuda
Scanning dependencies of target xmr-stak-nvidiaCrypto
[ 19%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_blake256.c.o
[ 23%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/soft_aes.c.o
[ 28%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_jh.c.o
[ 33%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_skein.c.o
[ 38%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_keccak.c.o
[ 42%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_groestl.c.o
[ 47%] Linking C static library libxmr-stak-nvidiaCrypto.a
[ 47%] Built target xmr-stak-nvidiaCrypto
Scanning dependencies of target xmr-stak-nvidia
[ 52%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/webdesign.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/jpsock.cpp.o
[ 61%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/cli-miner.cpp.o
[ 66%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/minethd.cpp.o
[ 71%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/console.cpp.o
[ 76%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/executor.cpp.o
[ 80%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/httpd.cpp.o
[ 85%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/socket.cpp.o
[ 90%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/jconf.cpp.o
[ 95%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/crypto/cryptonight_common.cpp.o
[100%] Linking CXX executable bin/xmr-stak-nvidia
[100%] Built target xmr-stak-nvidia
> bin/xmr-stak-nvidia 
19:03:06
No CUDA device found!
> nvidia-smi                   
19:07:22
Tue Aug 29 19:07:22 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.66                 Driver Version: 384.66                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  TITAN Xp            Off  | 00000000:41:00.0  On |                  N/A |
| 29%   47C    P5    28W / 250W |   2789MiB / 12174MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0      1568    G   /usr/lib/xorg/Xorg                            1850MiB |
|    0      3691    G   compton                                          4MiB |
|    0     11207    G   ...el-token=F7D9A3748DAEC2F66FEB0577638B2A8D    68MiB |
|    0     15399    C   /usr/lib/libreoffice/program/soffice.bin       153MiB |
|    0     86381    G   ...el-token=A851313376D5A2875799353745221A45   707MiB |
+-----------------------------------------------------------------------------+
> cat config.txt 
19:09:04
/*
 * 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" : 
null,

/*
 * TLS Settings
 * If you need real security, make sure tls_secure_algo is enabled (otherwise MITM attack can downgrade encryption
 * to trivially breakable stuff like DES and MD5), and verify the server's fingerprint through a trusted channel. 
 *
 * use_tls         - This option will make us connect using Transport Layer Security.
 * tls_secure_algo - Use only secure algorithms. This will make us quit with an error if we can't negotiate a secure algo.
 * tls_fingerprint - Server's SHA256 fingerprint. If this string is non-empty then we will check the server's cert against it.
 */
"use_tls" : false,
"tls_secure_algo" : true,
"tls_fingerprint" : "",

/*
 * pool_address   - Pool address should be in the form "pool.supportxmr.com:3333". Only stratum pools are supported.
 * wallet_address - Your wallet, or pool login.
 * pool_password  - Can be empty in most cases or "x".
 */
"pool_address" : "pool.supportxmr.com:3333",
"wallet_address" : "",
"pool_password" : "",

/*
 * Network timeouts.
 * Because of the way this client is written it doesn't need to constantly talk (keep-alive) to the server to make 
 * sure it is there. We detect a buggy / overloaded server by the call timeout. The default values will be ok for 
 * nearly all cases. If they aren't the pool has most likely overload issues. Low call timeout values are preferable -
 * long timeouts mean that we waste hashes on potentially stale jobs. Connection report will tell you how long the
 * server usually takes to process our calls.
 *
 * call_timeout - How long should we wait for a response from the server before we assume it is dead and drop the connection.
 * retry_time   - How long should we wait before another connection attempt.
 *                Both values are in seconds.
 * giveup_limit - Limit how many times we try to reconnect to the pool. Zero means no limit. Note that stak miners
 *                don't mine while the connection is lost, so your computer's power usage goes down to idle.
 */
"call_timeout" : 10,
"retry_time" : 10,
"giveup_limit" : 0,

/*
 * Output control.
 * Since most people are used to miners printing all the time, that's what we do by default too. This is suboptimal
 * really, since you cannot see errors under pages and pages of text and performance stats. Given that we have internal
 * performance monitors, there is very little reason to spew out pages of text instead of concise reports.
 * Press 'h' (hashrate), 'r' (results) or 'c' (connection) to print reports.
 *
 * verbose_level - 0 - Don't print anything. 
 *                 1 - Print intro, connection event, disconnect event
 *                 2 - All of level 1, and new job (block) event if the difficulty is different from the last job
 *                 3 - All of level 1, and new job (block) event in all cases, result submission event.
 *                 4 - All of level 3, and automatic hashrate report printing 
 */
"verbose_level" : 3,

/*
 * Automatic hashrate report
 *
 * h_print_time - How often, in seconds, should we print a hashrate report if verbose_level is set to 4.
 *                This option has no effect if verbose_level is not 4.
 */
"h_print_time" : 60,

/*
 * Output file
 *
 * output_file  - This option will log all output to a file.
 *
 */
"output_file" : "",

/*
 * Built-in web server
 * I like checking my hashrate on my phone. Don't you?
 * Keep in mind that you will need to set up port forwarding on your router if you want to access it from
 * outside of your home network. Ports lower than 1024 on Linux systems will require root.
 *
 * httpd_port - Port we should listen on. Default, 0, will switch off the server.
 */
"httpd_port" : 0,

/*
 * prefer_ipv4 - IPv6 preference. If the host is available on both IPv4 and IPv6 net, which one should be choose?
 *               This setting will only be needed in 2020's. No need to worry about it now.
 */
"prefer_ipv4" : true,
psychocrypt commented 7 years ago

@jonasacres There is a bug in the error message from the miner, I added a fix to find the real reason for this issue. Please try to compile the bug fix and run the miner again to get the correct error, than post the error.

# run the following commands to compile the bug fix before the fix is meged to the dev branch
cd $HOME
mkdir xmr-stak-nvidia-psychocrypt
cd xmr-stak-nvidia-psychocrypt
git clone https://github.com/psychocrypt/xmr-stak-nvidia.git .
mkdir build
cd build
cmake ..
make -j 4 install
cd bin
./xmr-miner-nvidia
jonasacres commented 7 years ago

My mistake. My CUDA driver was not working properly, and I was getting error 30 ("unknown error") on even the sample/ stuff in the CUDA directory. I re-installed CUDA and restarted and everything is working great now. Thanks for replying!

hanserasmus commented 6 years ago

Hi all.

I am still getting an issue, this time on my desktop.

System: CentOS Linux release 7.4.1708 (Core) uname -rm: 3.10.0-693.2.2.el7.x86_64 x86_64

Cuda installed from: https://developer.nvidia.com/cuda-80-ga2-download-archive

nvidia-smi output:

[root@hanspc cuda]# nvidia-smi Sun Oct 15 14:46:58 2017
+------------------------------------------------------+
| NVIDIA-SMI 340.104 Driver Version: 340.104 |
|-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 680 Off | 0000:07:00.0 N/A | N/A | | 30% 34C P8 N/A / N/A | 465MiB / 2047MiB | N/A Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Compute processes: GPU Memory | | GPU PID Process name Usage | |=============================================================================| | 0 Not Supported | +-----------------------------------------------------------------------------+

Output of lspci | grep -i vga 07:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 680] (rev a1)

No default config has been suggested. First time running of bin/xmr-stack-nvidia just shows: No CUDA devices found!

psychocrypt commented 6 years ago

Please try to run xmr-stak as root.

hanserasmus commented 6 years ago

Have compiled, and ran as root, still no change. Still only states no CUDA devices found, also no config suggested.

psychocrypt commented 6 years ago

Please install the cude driver again, this is a driver issue.

hanserasmus commented 6 years ago

Running the CUDA installation, installs the driver, but then GNOME does not start up. GNOME issue is fixed once I reinstall the latest NVIDIA driver for my GFX card. GFX driver version is 340, CUDA driver version is 327.

hanserasmus commented 6 years ago

Uninstalling the standalone NVIDIA driver, and reinstalling the CUDA package with the pre-packaged driver also does not work. System does not boot into GNOME session, and also, trying to xmr application from runlevel 3, also gives the error No CUDA devices found.

psychocrypt commented 6 years ago

Which gpu do you use?

Never the less this is still a driver issue.

hanserasmus commented 6 years ago

Installed the latest NVIDIA driver from their site, 384, and now at least I am getting that minimum config suggestion. Started it after adding the minimum config suggestion to config.txt. Launched without any errors, but see my questions below for the next issue I ran into.

So for anyone with the same issue, I would suggest first install CUDA toolkit, along with the driver that comes packaged with it, then install the newest NVIDIA driver from the NVIDIA site. Oh and this is based on CentOS7.4.

Quick last 2 questions: 1) Does this program honour system proxy settings? I am connecting through a proxy to the internet (have to), but I cannot seem to make a connection to a pool. Is there a way to force it to use a specific proxy setting? This a proxy as in SQUID. 2) Will CUDA 9 be supported anytime soon?

Thanks for sticking with me on this!

psychocrypt commented 6 years ago

Cuda 9 should run out of the box. If not than it will be supported with the next release. Do you have an issue with cuda 9?

I don't know which type of proxy do use but if it is a http proxy I am not sure.

hanserasmus commented 6 years ago

I use http proxy. So any ideas on this would be nice?

I tried with CUDA9 first but got some error about something_20 device not supported.

Will try again with cuda9 in a while. I am getting a GTX 1050 soon so will test again and log a bug of not working.

On Sun, 15 Oct 2017, 19:39 psychocrypt, notifications@github.com wrote:

Cuda 9 should run out of the box. If not than it will be supported with the next release. Do you have an issue with cuda 9?

I don't know which type of proxy do use but if it is a http proxy I am not sure.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fireice-uk/xmr-stak-nvidia/issues/39#issuecomment-336727821, or mute the thread https://github.com/notifications/unsubscribe-auth/AXIFEFPLgm0H5dFen8aj2toyYDueSXnqks5sskNHgaJpZM4Nh9Dm .

hanserasmus commented 6 years ago

What type of connection does xmr-stack-nvidia use to connect to the pools? http/https/socks or what?

On Sun, 15 Oct 2017, 19:58 Hans Erasmus, erasmushans27@gmail.com wrote:

I use http proxy. So any ideas on this would be nice?

I tried with CUDA9 first but got some error about something_20 device not supported.

Will try again with cuda9 in a while. I am getting a GTX 1050 soon so will test again and log a bug of not working.

On Sun, 15 Oct 2017, 19:39 psychocrypt, notifications@github.com wrote:

Cuda 9 should run out of the box. If not than it will be supported with the next release. Do you have an issue with cuda 9?

I don't know which type of proxy do use but if it is a http proxy I am not sure.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fireice-uk/xmr-stak-nvidia/issues/39#issuecomment-336727821, or mute the thread https://github.com/notifications/unsubscribe-auth/AXIFEFPLgm0H5dFen8aj2toyYDueSXnqks5sskNHgaJpZM4Nh9Dm .

psychocrypt commented 6 years ago

compile with 'cmake -DCUDA_ARCH=60;61;62' to avoud sm_20 errors during compiling with cuda 9.

Iosif commented 6 years ago

What about if i dont have CUDA at all, can i use ccminer with only CPU?

0x01h commented 5 years ago

This solution worked for me. I think your GPU card doesn't support some of the new versions of drivers.

Delete and purge all Nvidia and CUDA installations.

sudo apt purge nvidia*
sudo apt purge cuda*

Install Nvidia 375. (Older than 400 series) sudo apt install nvidia-375

Download and install CUDA 8.0 GA1. (Older than 10 and 9 series) Select "yes" to everything except Nvidia driver installation, because we already installed nvidia-375 driver! https://developer.nvidia.com/cuda-80-download-archive

Restart and it will work.