Page 1 of 1

Handling of device remove event

Posted: 17 Apr 2007, 23:06
by AF
Sometimes windows will remove the graphics device in order to reset the graphics drivers then re-initialize the drivers and device in order to remedy a suspected driver crash.

An example of such a crash is a Time Delay Reset crash, one of the main issues bugging users of nvidias vista drivers.

Well written directx programs handle this event and recover, however spring doesnt recreate its graphic context and crashes, spending as much as 20 seconds idling on a pitch black screen before it does so.

Posted: 18 Apr 2007, 13:43
by Tobi
What kind of events are sent when it does that?
Or rather, which exact WM_blahblah message...

Posted: 19 Apr 2007, 03:34
by AF
In Vista the handling of memory extends to video memory, allowing it to detect timeouts which are likely to point to gpu crashes. Graphics commands that take longer than 2 seconds will cause Vista to reset the gpu and tell the suer the driver has crashed.

Here is an explanation of the windows side of thigns:
http://www.microsoft.com/whdc/device/di ... meout.mspx

Here is a reference on OpenGL and changes in Vista to be aware of mainly referring to TDR and the use of mixed 3d accelaration and GDI:
http://www.opengl.org/pipeline/article/vol003_7/
If the application performs extremely GPU intensive and lengthy operations, for example rendering hundreds of fullscreen quads using a complex pixel shader all in a single glDrawElements call, in order to avoid exceeding the 2 second timeout and having an application being killed by Windows Vista's Timeout Detection and Recovery, split the call into chunks and call glFlush/glFinish between them. The driver may be able to split long chunks of work for the application, but there will always be corner cases it cannot control, so don't rely solely on the driver to keep rendering from exceeding the two second limit. Instead, anticipate these cases in your application and consider throttling the most intense rendering loads yourself.
In the mean time I will continue to search for a method of detecting device reset events that dont require directx and managed c++/.Net

Posted: 08 May 2007, 05:55
by AF