Skip to content

Commit

Permalink
πŸ“ Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Dec 21, 2023
1 parent 31203e7 commit 2558f18
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# fix_tdr_delay

On Windows, there is a rule that says that if your program makes on operation on the GPU (like running a compute shader or a draw call) that takes more than X seconds, Windows will kill your program. By default this delay is set to 2 seconds, which can be very limiting for applications that make heavy use of the GPU. A much more sensible default would be something like 60 seconds. This can be changed with this library:

```cpp
#include <fix_tdr_delay/fix_tdr_delay.hpp>

int main()
{
auto const result = fix_tdr_delay::set_minimum_delay(60);
if(!result.has_succeeded)
// Display an error message
if(result.needs_to_restart)
// Prompt the user to restart their computer
}
```

Note that for the changes to take effect, the user needs to restart their computer.

More precisely, what `set_minimum_delay()` does is change the `TdrDelay` and `TdrDdiDelay` registry keys on Windows. For more information, you can [read this article](https://helpx.adobe.com/substance-3d-painter/technical-support/technical-issues/gpu-issues/gpu-drivers-crash-with-long-computations-tdr-crash.html).

You can also get and set the values of the individual keys with `get_tdr_delay()`, `set_tdr_delay()`, `get_tdr_ddi_delay()` and `set_tdr_ddi_delay()`.

## Including

To add this library to your project, simply add these two lines to your *CMakeLists.txt*:
Expand Down

0 comments on commit 2558f18

Please sign in to comment.