{"record":{"id":"2ccf07237ba673e5","repo":"stride3d/stride","slug":"vulkan-call-call-returned-vkresult","errorCode":null,"errorMessage":"Vulkan call {call} returned {vkResult}","messagePattern":"Vulkan call (.+?) returned (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Graphics/Vulkan/GraphicsDevice.Vulkan.cs","lineNumber":366,"sourceCode":"                    for (int i = 0; i < count; i++)\n                        DebugAggregateLocalCounters(commandLists[i].Builder.DebugScopeExtractLocalCounters());\n                }\n            }\n\n            // Collect resources\n            for (int i = 0; i < count; i++)\n            {\n                RecycleCommandListResources(commandLists[i], nextCommandListFenceValue);\n            }\n\n            nativeResourceCollector.Release();\n            graphicsResourceLinkCollector.Release();\n        }\n\n        internal void CheckResult(VkResult vkResult, [CallerArgumentExpression(\"vkResult\")] string call = null)\n        {\n            if (vkResult != VkResult.Success)\n                throw new InvalidOperationException($\"Vulkan call {call} returned {vkResult}\");\n        }\n\n        /// <summary>\n        ///   Initializes the platform-specific features of the Graphics Device once it has been fully initialized.\n        /// </summary>\n        private unsafe partial void InitializePostFeatures()\n        {\n            if (IsDebugMode)\n                DebugMessengerDevice = this;\n        }\n\n        // Vulkan messages fire synchronously through the messenger callback, which logs them\n        // inline. End-of-frame drain just dumps the scope tree if anything fired.\n        partial void DrainDebugMessages()\n        {\n            if (debugSawDrawIssue)\n                DebugDumpTree();\n            debugSawDrawIssue = false;","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Graphics/Vulkan/GraphicsDevice.Vulkan.cs#L348-L384","documentation":"GraphicsDevice.CheckResult converts any non-Success VkResult from a Vulkan API call into an InvalidOperationException naming the call and the raw result code (e.g. VK_ERROR_OUT_OF_DEVICE_MEMORY, VK_ERROR_DEVICE_LOST). It is the generic Vulkan error propagation point used by the whole Vulkan backend.","triggerScenarios":"Any Vulkan call checked via CheckResult returns a failure result — e.g. vkQueueSubmit2 during ExecuteCommandLists failing with OUT_OF_MEMORY or DEVICE_LOST, or device creation calls failing.","commonSituations":"Device lost after GPU driver reset/TDR; out-of-host/device memory from oversized resources; invalid usage causing VK_ERROR_INVALID_DEVICE_ADDRESS_EXT; driver bugs on certain GPU/driver combinations.","solutions":["Read the VkResult in the message: DEVICE_LOST → handle/reset the device, OUT_OF_*_MEMORY → reduce resource usage","Update GPU drivers to latest vendor release","Validate your scene resource sizes and reduce VRAM pressure (textures, buffers)","Enable Vulkan validation layers during development to catch the underlying API misuse","Handle device-lost in your engine loop by recreating the GraphicsDevice"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    GraphicsDevice.ExecuteCommandLists(count, commandLists);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"returned VkResult\"))\n{\n    if (ex.Message.Contains(\"ErrorDeviceLost\"))\n        RecreateGraphicsDevice();\n    else\n        Logger.Error(ex, \"Vulkan call failed.\");\n}","preventionTips":["Enable Vulkan validation layers in development builds","Keep GPU drivers updated on target machines","Monitor VRAM usage and cap resource sizes","Implement device-lost recovery (recreate device, resubmit frame)"],"tags":["vulkan","vkresult","device-lost","native-error"],"backgroundTag":"api-error-response","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}