Handling of device remove event

Handling of device remove event

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Handling of device remove event

Post 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.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

What kind of events are sent when it does that?
Or rather, which exact WM_blahblah message...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Post Reply

Return to “Feature Requests”