{"record":{"id":"f5751ce70624701c","repo":"stride3d/stride","slug":"no-vulkan-physical-device","errorCode":null,"errorMessage":"No Vulkan physical device","messagePattern":"No Vulkan physical device","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Tests/FrameRenderer.Vulkan.cs","lineNumber":145,"sourceCode":"            pApplicationInfo = &appInfo,\n        };\n        var result = vkCreateInstance(&createInfo, out VkInstance createdInstance);\n        if (result == VkResult.ErrorIncompatibleDriver)\n        {\n            appInfo.apiVersion = VkVersion.Version_1_2;\n            result = vkCreateInstance(&createInfo, out createdInstance);\n        }\n        Check(result, \"vkCreateInstance\");\n        instance = createdInstance;\n        instanceApi = GetApi(instance);\n    }\n\n    private static void PickPhysicalDevice()\n    {\n        uint count = 0;\n        Check(instanceApi.vkEnumeratePhysicalDevices(instance, &count, null));\n        if (count == 0)\n            throw new InvalidOperationException(\"No Vulkan physical device\");\n        var devices = new VkPhysicalDevice[count];\n        fixed (VkPhysicalDevice* devicesPtr = devices)\n            Check(instanceApi.vkEnumeratePhysicalDevices(instance, &count, devicesPtr));\n\n        // SPIR-V 1.4 modules require a Vulkan 1.2+ device.\n        // Software rendering (see Module) selects a CPU device (Lavapipe); otherwise prefer real GPUs.\n        var softwareRendering = Environment.GetEnvironmentVariable(\"STRIDE_GRAPHICS_SOFTWARE_RENDERING\") == \"1\";\n        var best = -1;\n        var bestScore = -1;\n        for (int i = 0; i < count; i++)\n        {\n            instanceApi.vkGetPhysicalDeviceProperties(devices[i], out var properties);\n            if (properties.apiVersion < VkVersion.Version_1_2)\n                continue;\n            var isCpu = properties.deviceType == VkPhysicalDeviceType.Cpu;\n            var score = softwareRendering\n                ? (isCpu ? 3 : 0)\n                : properties.deviceType switch","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Tests/FrameRenderer.Vulkan.cs#L127-L163","documentation":"PickPhysicalDevice enumerates Vulkan physical devices after instance creation and throws when vkEnumeratePhysicalDevices reports count == 0 — the Vulkan loader works but no ICD provided any device. Thrown from the test harness's EnsureSharedContext path, so the whole Vulkan rendering test cannot run.","triggerScenarios":"vkEnumeratePhysicalDevices(instance, &count, null) returns Success but count stays 0 — no driver/ICD installed, or all ICDs were filtered out (bad VK_ICD_FILENAMES, headless container, broken driver install).","commonSituations":"CI containers without mesa-vulkan-drivers or GPU ICDs; Windows machines without a GPU vendor driver; broken Vulkan loader configuration; running inside WSL without GPU passthrough configured.","solutions":["Install a Vulkan ICD: on Linux e.g. mesa-vulkan-drivers (Lavapipe) or the vendor driver package","Verify with `vulkaninfo --summary` that at least one physical device appears","Fix VK_ICD_FILENAMES / VK_DRIVER_FILES pointing at valid .icd.json files","Enable softwareRendering so the harness accepts a CPU (Lavapipe) device","Skip the Vulkan test path when no device exists (the harness's `available` check)"],"exampleFix":"// before\nvar devices = frameRenderer.RunVulkanTest();\n// after\nif (FrameRenderer.VulkanAvailable == false)\n{\n    Assert.Skip(\"No Vulkan device available\");\n    return;\n}\nvar devices = frameRenderer.RunVulkanTest();","handlingStrategy":"fallback","validationCode":"uint count = 0;\nbool HasVulkanDevice() => instanceApi.vkEnumeratePhysicalDevices(instance, &count, null) == VkResult.Success && count > 0;","typeGuard":null,"tryCatchPattern":"try { EnsureSharedContext(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"No Vulkan physical device\"))\n{\n    Assert.Skip(\"No Vulkan device; skipping Vulkan rendering test\");\n}","preventionTips":["Install an ICD (mesa-vulkan-drivers or vendor driver) in test environments","Verify with vulkaninfo before running the suite","Set VK_ICD_FILENAMES correctly in containers","Offer a software-rendering fallback path"],"tags":["vulkan","environment","gpu"],"backgroundTag":"resource-not-found","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"}