GPU crash detected: - Device 0 Removed: DXGI_ERROR_DEVICE_HUNG [2026.04.19-03.04...

2026年04月20日 00:04 processing

错误信息

[2026.04.19-03.04.46:495][691]LogAbilitySystem: Display: GameplayCueNotify /Game/DungeonCrawler/FX/GameplayCue/OceanStorm/GC_OceanStormStatus.GC_OceanStormStatus_C was not loaded when GameplayCue was invoked. Starting async loading. [2026.04.19-03.04.46:496][691]LogAbilitySystem: Display: GameplayCueNotify /Game/DungeonCrawler/FX/GameplayCue/OceanStorm/GC_OceanStormStatus.GC_OceanStormStatus_C was not loaded when GameplayCue was invoked. Starting async loading. [2026.04.19-03.04.57:621][732]LogD3D12RHI: Error: GPU crash detected: - Device 0 Removed: DXGI_ERROR_DEVICE_HUNG [2026.04.19-03.04.57:622][732]LogD3D12RHI: Error: Shader diagnostic messages and asserts: Device: 0, Queue 3D: No shader diagnostics found for this queue. Device: 0, Queue Copy: No shader diagnostics found for this queue. Device: 0, Queue Compute: No shader diagnostics found for this queue. [2026.04.19-03.04.57:622][732]LogD3D12RHI: Error: DRED: No breadcrumb head found. [2026.04.19-03.04.57:623][732]LogD3D12RHI: Error: DRED: No PageFault data. [2026.04.19-03.04.57:623][732]LogD3D12RHI: Error: Video Memory Stats from frame ID 8: [2026.04.19-03.04.57:623][732]LogD3D12RHI: Error: Local Budget: 0.00 MB [2026.04.19-03.04.57:624][732]LogD3D12RHI: Error: Local Used: 0.00 MB [2026.04.19-03.04.57:624][732]LogD3D12RHI: Error: System Budget: 0.00 MB [2026.04.19-03.04.57:624][732]LogD3D12RHI: Error: System Used: 0.00 MB [2026.04.19-03.04.57:627][732]LogD3D12RHI: Error: GPU发生崩溃,或D3D设备已移除。 检查日志中的GPU状态信息。

AI 解决方案

报错分析报告

1.错误翻译


原文:GPU crash detected: Device 0 Removed: DXGI_ERROR_DEVICE_HUNG
译文:检测到GPU崩溃:设备0已移除,错误码DXGI_ERROR_DEVICE_HUNG

2.原因分析


  • 根本原因:GPU设备因挂起(HUNG)被系统移除,触发DXGI_ERROR_DEVICE_HUNG错误。

  • 具体位置:D3D12 RHI层(Direct3D 12渲染硬件接口),上下文为GameplayCue异步加载资源后GPU执行异常。

  • 触发场景:可能是Shader执行错误、显存溢出、硬件过热或驱动兼容性问题导致GPU停止响应。
  • 3.解决方案


    // 1. D3D12设备移除错误处理(C++示例)
    #include <dxgi.h>
    
    void HandleDeviceRemoved(HRESULT hr, ID3D12Device* device) {
        if (hr == DXGI_ERROR_DEVICE_HUNG || hr == DXGI_ERROR_DEVICE_RESET) {
            // 释放旧设备资源
            ReleaseAllD3D12Resources(device);
            // 重新初始化设备与资源
            InitializeD3D12Device();
            LogWarning("[D3D12] Device reset due to HUNG error");
        }
    }
    
    // 2. 调用处示例(执行命令队列后检查)
    HRESULT ExecuteCommands(ID3D12CommandQueue* cmdQueue) {
        HRESULT hr = cmdQueue->ExecuteCommandLists(...);
        HandleDeviceRemoved(hr, m_d3d12Device); // 传入当前设备
        return hr;
    }
    

    4. 预防措施


  • 最佳实践1:用RenderDoc/PIX工具捕获GPU帧,排查Shader编译错误或显存越界(如纹理采样越界)。

  • 最佳实践2:对大资源(如OceanStorm特效)采用异步加载+LOD分级,避免显存峰值超过GPU预算。

  • 工具推荐:NVIDIA Nsight Graphics(调试GPU崩溃)、Unreal Engine的stat gpu命令实时监控显存。
  • :日志中GameplayCueNotify未加载的警告是异步加载的正常提示,非核心错误根源。核心问题是GPU设备挂起。