问题
I have an OpenCL kernel with two nested loops. It works fine up to a certain number of iterations, but crashes when the number of iterations is increased. The loop essentially does not create any new data (i.e., there is no global memory overflow etc.), it just iterates more number of time. What can I do to allow more iterations? Has anyone encountered this problem? Thanks a lot
回答1:
Are you running this on Windows? Windows has a watchdog timer mechanism that restarts the display driver if it appears to become unresponsive. I find that if my kernel runs for more than a few seconds, the timer will trip and restart the display driver. The only solution I know of is to break up the kernel execution into segments of one or two seconds each and run them sequentially.
回答2:
As @ScottD said the watchdog would be a good explanation. You can modify the time duration after which the watchdog will trigger. You have to modify/create a value in the registry as explain in this question. Note that there is an answer that explains how to do it for linux as well.
来源:https://stackoverflow.com/questions/17939843/large-for-loop-crashing-in-geforce-nvidia-gt-610