-
Notifications
You must be signed in to change notification settings - Fork 33
How to Deal with Out of Resources?
It is common to see the out of resources error with open cl. There are a lot of reasons causing out of resources. In this post, we will discuss those out of resources we found through the implementation of oclGA.
There is a feature call Timeout Detection and Recovery(TDR) in Microsoft Windows. It's not easy to notice it if you only run the code under CPU. But it is very common to see it when you run the code at GPU. The main reason to have this feature is to give responsiveness to users. If we occupy the GPU for 2 seconds without sleep, windows stops the code running to protect the malfunctioning GPU operations.
If you runs OpenCLGA with one of the following arguments, you may see this feature:
- Large population.
- High mutate ratio, like > 0.5.
- High crossover ratio, like > 0.9.
- Complex fitness function, like what you can think.
- Everything works if runs simpler or smaller values, see previous 4 rules.
Please follow the URL: https://msdn.microsoft.com/en-us/library/windows/hardware/ff569918(v=vs.85).aspx to disable the TDR.
There is a registry key called TdrLevel which is 3 (restore on timeout). You can add or change this value to 0. This is the most common way. If you don't want to disable it, you need to create the registry as 3 and add/enlarge the value of TdrDelay to have any value you feel better.
Please note that this value will be reset after every Windows update.