{"record":{"id":"b7012498b2fcd185","repo":"stride3d/stride","slug":"vulkan-failed-to-find-gpus-with-vulkan-support","errorCode":null,"errorMessage":"Vulkan: Failed to find GPUs with Vulkan support","messagePattern":"Vulkan: Failed to find GPUs with Vulkan support","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"sources/engine/Stride.Graphics/Vulkan/GraphicsAdapterFactory.Vulkan.cs","lineNumber":48,"sourceCode":"            // If no loader is available, fall back to the bundled MoltenVK at runtimes/<rid>/native/.\n            // On iOS, MoltenVK is statically linked into the app binary: dlopen the executable itself,\n            // which exports vkGetInstanceProcAddr (see Stride.Core.NativeLibraries.targets).\n            string vkLibraryName = Platform.Type switch\n            {\n                PlatformType.macOS => ResolveMacOSVulkanLibrary(),\n                PlatformType.iOS => Environment.ProcessPath,\n                _ => null,\n            };\n            var result = vkInitialize(vkLibraryName);\n            result.CheckResult();\n\n            // Create the default instance to enumerate physical devices\n            defaultInstance = new GraphicsAdapterFactoryInstance(false);\n            uint physicalDevicesCount = 0;\n            defaultInstance.NativeInstanceApi.vkEnumeratePhysicalDevices(defaultInstance.NativeInstance, &physicalDevicesCount, null).CheckResult();\n\n            if (physicalDevicesCount == 0)\n                throw new Exception(\"Vulkan: Failed to find GPUs with Vulkan support\");\n\n            Span<VkPhysicalDevice> nativePhysicalDevices = stackalloc VkPhysicalDevice[(int)physicalDevicesCount];\n            defaultInstance.NativeInstanceApi.vkEnumeratePhysicalDevices(defaultInstance.NativeInstance, nativePhysicalDevices).CheckResult();\n            \n            var adapterList = new List<GraphicsAdapter>();\n            for (int index = 0; index < nativePhysicalDevices.Length; index++)\n            {\n                VkPhysicalDeviceProperties properties;\n                defaultInstance.NativeInstanceApi.vkGetPhysicalDeviceProperties(nativePhysicalDevices[index], out properties);\n\n                // VK_KHR_driver_properties (core in 1.2) exposes driver identity strings the packed driverVersion can't carry.\n                VkPhysicalDeviceDriverProperties driverProps = new() { sType = VkStructureType.PhysicalDeviceDriverProperties };\n                VkPhysicalDeviceProperties2 properties2 = new() { sType = VkStructureType.PhysicalDeviceProperties2, pNext = &driverProps };\n                if (properties.apiVersion >= VkVersion.Version_1_2)\n                    defaultInstance.NativeInstanceApi.vkGetPhysicalDeviceProperties2(nativePhysicalDevices[index], &properties2);\n\n                var adapter = new GraphicsAdapter(nativePhysicalDevices[index], properties, driverProps, index);\n                staticCollector.Add(adapter);","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Graphics/Vulkan/GraphicsAdapterFactory.Vulkan.cs#L30-L66","documentation":"During adapter initialization Stride creates a Vulkan instance and enumerates physical devices via vkEnumeratePhysicalDevices. If the count is zero, no Vulkan-capable GPU/driver is present, so initialization throws a generic Exception.","triggerScenarios":"Calling GraphicsAdapterFactory.Initialize (or creating any GraphicsDevice) on a machine where the Vulkan ICD/driver reports zero physical devices — no Vulkan driver installed, headless server, VM without GPU passthrough, or a broken loader.","commonSituations":"Linux servers without mesa-vulkan/nvidia-vulkan drivers; Windows machines with outdated GPU drivers; CI containers without GPU; remote desktop sessions masking the GPU.","solutions":["Install a Vulkan-capable GPU driver (e.g. mesa-vulkan-drivers / vulkan-intel / nvidia driver with Vulkan on Linux)","Run vulkaninfo to verify the loader detects a GPU before launching the app","On headless/CI, use a CPU fallback renderer or enable a software Vulkan implementation (e.g. lavapipe/SwiftShader)","Update GPU drivers and the Vulkan runtime (vulkan-headers/loader) to current versions"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":"bool vulkanAvailable = GraphicsAdapterFactory.Adapters != null && GraphicsAdapterFactory.Adapters.Count > 0;","tryCatchPattern":"try { GraphicsAdapterFactory.Initialize(); } catch (Exception ex) when (ex.Message.Contains(\"Failed to find GPUs\")) { /* fall back to another renderer or show setup instructions */ }","preventionTips":["Precheck with vulkaninfo or a Vulkan loader probe before launch","Install GPU/Vulkan drivers as part of deployment (mesa-vulkan-drivers, nvidia-vulkan)","Document GPU requirements; support software Vulkan (lavapipe) in CI/headless environments"],"tags":["vulkan","gpu-driver","initialization","environment"],"backgroundTag":"unsupported-platform","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}