在驱动程序开发期间测试和调试 TDR

本文介绍图形显示驱动程序开发人员的 TDR(超时检测和恢复)测试和调试策略。

WHLK 中的 TDR 测试

Windows Hardware Lab Kit (WHLK) 包含驱动程序开发人员可用于测试和调试目的的特定于 TDR 的测试。 例如,开发人员可以使用 SimulatePreemption TDR 手动触发 GPU TDR。 有关各种 TDR 相关测试的详细信息,请参阅 Device.Graphics

用于测试和调试的 TDR 注册表项

开发人员只能在驱动程序开发过程中使用以下 TDR 相关的注册表项进行测试或调试。

重要

建议最终用户不要操作这些注册表项。 在驱动程序开发期间,它们也不应被目标测试或调试之外的应用程序操纵。

TdrLevel

指定恢复的初始级别。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrLevel
ValueType : REG_DWORD
ValueData : TdrLevelXxx (see the following table)

其中 TdrLevelXxx 可以是以下值之一:

含义
TdrLevelOff (0) 检测已禁用
TdrLevelBugcheck (1) 对检测到的超时进行错误检查;例如没有恢复。
TdrLevelRecoverVGA (2) 恢复到 VGA(未实现)。
TdrLevelRecover (3) 超时时恢复(默认值)。

TdrDelay

指定 GPU 可以延迟来自 GPU 计划程序抢占请求的秒数。 TdrDelay 实际上是超时阈值。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrDelay
ValueType : REG_DWORD
ValueData : Number of seconds to delay. The default value is 2 seconds.

TdrDdiDelay

指定 OS 允许线程离开驱动程序的秒数。 指定时间后,OS 用代码 VIDEO_TDR_FAILURE (0x116) 对计算机进行错误检查。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrDdiDelay
ValueType : REG_DWORD
ValueData : Number of seconds to leave the driver. The default value is 5 seconds.

TdrDebugMode

指定 TDR 进程的调试相关行为。 默认值为 TDR_DEBUG_MODE_RECOVER_NO_PROMPT,指示不中断调试器。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrDebugMode
ValueType : REG_DWORD
ValueData : TDR_DEBUG_MODE_XXX (see the following table)
含义
TDR_DEBUG_MODE_OFF (0) 在恢复之前中断内核调试器,以便调查超时情况。
TDR_DEBUG_MODE_IGNORE_TIMEOUT (1) 忽略任何超时。
TDR_DEBUG_MODE_RECOVER_NO_PROMPT (2) 在不中断调试器的情况下恢复(默认值)。
TDR_DEBUG_MODE_RECOVER_UNCONDITIONAL (3) 即使不满足某些恢复条件也能恢复(例如,在连续超时时恢复)。

TdrLimitTime

指定默认时间,在该时间内允许特定数量的 TDR(由 TdrLimitCount 键指定),而不会使计算机崩溃。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrLimitTime
ValueType : REG_DWORD
ValueData : Number of seconds before crashing. The default value is 60 seconds.

TdrLimitCount

指定在 TdrLimitTime 键指定的时间内允许的默认 TDR 数量 (0x117),而不会使计算机崩溃。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrLimitCount
ValueType : REG_DWORD
ValueData : Number of TDRs before crashing. The default value is 5.

TdrTestMode

保留。 请不要使用。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrTestMode
ValueType : REG_DWORD
ValueData : Do not use.

TdrDodPresentDelay

指定内核模式仅显示驱动程序 (KMDOD) DxgkDdiPresentDisplayOnly 函数通过向 pfnPresentDisplayOnlyProgress 报告进度来完成异步显示所允许的秒数(该值在 DXGKARG_PRESENT_DISPLAYONLY 结构中传递)。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrDodPresentDelay
ValueType : REG_DWORD
ValueData : Number of seconds allowed for **DxgkDdiPresentDisplayOnly** to complete an asynchronous present. The default value is 2 seconds. (Min: 1, Max: 15 * 60 = 15 minutes). This value is for debugging purposes only.

TdrDodVSyncDelay

指定 V 同步监视器在触发 KMDOD 中的 TDR 之前等待 V 同步信号报告的秒数。

KeyPath   : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers
KeyValue  : TdrDodVSyncDelay
ValueType : REG_DWORD
ValueData : Number of seconds that the V-sync watchdog waits for a V-sync to be reported before a TDR occurs with Kernel Mode Display-Only Drivers. Drivers are expected to report V-sync interrupts at the cadence of the display mode refresh rate. The default value is 2 seconds. (Min: 1s, Max: 15 * 60 = 15 minutes). This value is for debugging purposes only.