fireice-uk / xmr-stak-nvidia

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

"the launch timed out and was terminated" error on line 246 #40

Open fresheneesz opened 7 years ago

fresheneesz commented 7 years ago

When running this, I get an error on line 246 and windows 8.1 tells me my display driver "stopped responding and has recovered". Details:

Here's my gpu_threads_conf:

"gpu_threads_conf" : [{ "index" : 0, "threads" : 17, "blocks" : 60, "bfactor" : 0, "bsleep" :  0, "affine_to_cpu" : false}]
[2017-05-22 00:22:10] : Connecting to pool pool.usxmrpool.com:3333 ...
[2017-05-22 00:22:10] : Connected. Logging in...
[2017-05-22 00:22:10] : Difficulty changed. Now: 3000.
[2017-05-22 00:22:10] : New block detected.

GPU 0: the launch timed out and was terminated
C:/Users/MAIN/Documents/Visual Studio 2015/Projects/xmr-stak-nvidia/xmr-stak-nvi
dia/nvcc_code/cuda_extra.cu line 246

I have an NVIDIA GeForce GTX 870M and just updated to the latest driver for it (after it told me my driver didn't support CUDA 8.0 API)

fresheneesz commented 7 years ago

Ok, I lowered the threads to 7 and the blocks to 10 and it seems to work now. How can I determine the highest settings I can use for this?

fresheneesz commented 7 years ago

Hmm, after about 2 minutes of running, I get a different error:

...
[2017-05-22 00:28:17] : Result accepted by the pool.
[2017-05-22 00:28:17] : Difficulty changed. Now: 1776.
[2017-05-22 00:28:17] : New block detected.
[2017-05-22 00:29:17] : Difficulty changed. Now: 888.
[2017-05-22 00:29:17] : New block detected.
[2017-05-22 00:29:23] : Result accepted by the pool.

GPU 0: the launch timed out and was terminated
C:/Users/MAIN/Documents/Visual Studio 2015/Projects/xmr-stak-nvidia/xmr-stak-nvidia/nvcc_code/cuda_extra.cu line 248
psychocrypt commented 7 years ago

It could be that your window manager allocates gpu memory during the run. Please try to use 7 blocks and tune the parameter threads. Your GPU has 7 SMX (multiprocessors) therefore blocks should be a multiple of the SMX count.

fresheneesz commented 7 years ago

Changing to using 7 blocks seems to be working. Thanks! As far as closing out this ticket, perhaps the miner could detect how many blocks your gpu has and handling that a little more gracefully?

fresheneesz commented 7 years ago

After 4 minutes of successfully creating hashes, it crashes again with the error on line 246. This is using:

"gpu_threads_conf" : [{ "index" : 0, "threads" : 7, "blocks" : 7, "bfactor" : 0, "bsleep" : 0, "affine_to_cpu" : false}],

psychocrypt commented 7 years ago

Give my a few days I will take a deeper look to the issue. This line was reported in some other issue too. I will check our miner for memory leeks.


But I like leeks - fireice =)

psychocrypt commented 7 years ago

Ahh I think I get it: Please increase the value for bfactor in the file config.txt to 6, than everything should run.

The reason for the problem is that you get killed by windows because the miner kernel uses to much time on the gpu. By increasing bfactor the kernel is split into smaller chunks.

You have not used the suggested config by the miner. If you start the miner with the default config.txt from the repository than the miner will suggest a config for you. bfactor is always set to a value != 0 on windows, else your miner is stopped by windows. You should begin to tweak your config based on the suggested values.

fresheneesz commented 7 years ago

Ok cool thanks, I'll try that!

"You have not used the suggested config by the miner."

The miner didn't suggest config to me: https://github.com/fireice-uk/xmr-stak-nvidia/issues/39

fresheneesz commented 7 years ago

Its been up and running for 20 minutes now, so seems to be working! Thanks! Perhaps on windows it should automatically set the bfactor setting? Or maybe #39 will cover this

psychocrypt commented 7 years ago

If you start with in a clean unzipped folder without changing config.txt the miner suggest the settings for the gpu. Maybe you habe not downloaded the newest vesion latest download

fresheneesz commented 7 years ago

Hmm, well I tried it again and it seems to have worked. I could have sworn I didn't edit the gpu_threads_conf... Perhaps there should be a key you can press in regular usage that will print that recommendation again.

psychocrypt commented 7 years ago

It must be an error in cryptonight_extra_gpu_final(), maybe a memory access outside of the array bounces. I can't find such an error therefore I hope #50 solve the issue.

MutonUfoAI commented 7 years ago

@psychocrypt

Can you please cross compile the miner with these changes because my tests using a 1080 show this error over and over again. Not even my 1070 has revealed its full potential { "index" : 0, "threads" : 19, "blocks" : 60, "bfactor" : 0, "bsleep" : 0, "affine_to_cpu" : true}, ~758h/s The 1080 does reach 640h/s max ....

"threads" : 20, "blocks" : 60 GPU 0: an illegal instruction was encountered C:/Users/MAIN/Documents/Visual Studio 2015/Projects/xmr-stak-nvidia/xmr-stak-nvidia/nvcc_code/cuda_extra.cu line 246

I'm using the iGPU to use the desktop, btw.

thx

psychocrypt commented 7 years ago

@MutonUfoAI What is iGPU?

@fresheneesz Could you please set bfactor to 6 in your config. We figured out that this solve the same issue for someone on reddit

MutonUfoAI commented 7 years ago

iGPU integratedGPU AMD's APU Intel HD grafic

I've found an article about that "the launch timed out and was terminated" https://devtalk.nvidia.com/default/topic/931115/fatal-error-the-launch-timed-out-and-was-terminated-/ https://devtalk.nvidia.com/default/topic/459869/cuda-programming-and-performance/-quot-display-driver-stopped-responding-and-has-recovered-quot-wddm-timeout-detection-and-recovery-/%5B/url%5D https://docs.microsoft.com/de-de/windows-hardware/drivers/display/tdr-registry-keys


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers] "TdrLevel"=dword:00000003 "TdrDelay"=dword:00000064 "TdrDdiDelay"=dword:00000064 "TdrLimitCount"=dword:00000064

I can now push my card a bit further, but i'll get get this error soon GPU 0: an illegal instruction was encountered C:/Users/MAIN/Documents/Visual Studio 2015/Projects/xmr-stak-nvidia/xmr-stak-nvidia/nvcc_code/cuda_extra.cu line 246