{"record":{"id":"b76fe5752f466cbb","repo":"stride3d/stride","slug":"software-rendering-requested-but-no-cpu-vulkan-device","errorCode":null,"errorMessage":"Software rendering requested but no CPU Vulkan device (Lavapipe) found","messagePattern":"Software rendering requested but no CPU Vulkan device \\(Lavapipe\\) found","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Tests/FrameRenderer.Vulkan.cs","lineNumber":178,"sourceCode":"            var isCpu = properties.deviceType == VkPhysicalDeviceType.Cpu;\n            var score = softwareRendering\n                ? (isCpu ? 3 : 0)\n                : properties.deviceType switch\n                {\n                    VkPhysicalDeviceType.DiscreteGpu => 3,\n                    VkPhysicalDeviceType.IntegratedGpu => 2,\n                    _ => 1,\n                };\n            if (score > bestScore)\n            {\n                bestScore = score;\n                best = i;\n            }\n        }\n        if (best < 0)\n            throw new InvalidOperationException(\"No Vulkan 1.2+ physical device\");\n        if (softwareRendering && bestScore < 3)\n            throw new InvalidOperationException(\"Software rendering requested but no CPU Vulkan device (Lavapipe) found\");\n        physicalDevice = devices[best];\n    }\n\n    private static void CreateDevice()\n    {\n        uint familyCount = 0;\n        instanceApi.vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, &familyCount, null);\n        var families = new VkQueueFamilyProperties[familyCount];\n        fixed (VkQueueFamilyProperties* familiesPtr = families)\n            instanceApi.vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, &familyCount, familiesPtr);\n        queueFamily = uint.MaxValue;\n        for (uint i = 0; i < familyCount; i++)\n        {\n            if ((families[i].queueFlags & (VkQueueFlags.Graphics | VkQueueFlags.Compute)) == (VkQueueFlags.Graphics | VkQueueFlags.Compute))\n            {\n                queueFamily = i;\n                break;\n            }","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Tests/FrameRenderer.Vulkan.cs#L160-L196","documentation":"PickPhysicalDevice throws this when softwareRendering was requested but the best-scoring device is not a CPU device (score < 3 means no Lavapipe/CPU device was found). The harness explicitly asked for software rendering — e.g. for deterministic CI behavior — and the environment cannot satisfy it.","triggerScenarios":"Calling the FrameRenderer with softwareRendering = true while only GPU devices (or no usable devices) are present; forcing the software path via env/flag on a machine with only hardware ICDs.","commonSituations":"CI configured for Lavapipe but mesa-vulkan-drivers not installed; a GPU is present so the harness finds it but software mode demands a CPU device; mixed environments where Lavapipe ICD json is missing from VK_ICD_FILENAMES.","solutions":["Install Lavapipe (mesa-vulkan-drivers on Linux) so a CPU Vulkan device exists","Ensure the Lavapipe .icd.json is listed in VK_ICD_FILENAMES/VK_DRIVER_FILES and is being loaded","Disable softwareRendering to allow using the real GPU device instead","Verify with vulkaninfo that a device with type CPU appears"],"exampleFix":"// before\nvar ok = FrameRenderer.TryRender(softwareRendering: true);\n// after\nif (!FrameRenderer.CpuDeviceAvailable)\n{\n    Assert.Skip(\"Lavapipe not installed; cannot force software rendering\");\n    return;\n}\nvar ok = FrameRenderer.TryRender(softwareRendering: true);","handlingStrategy":"fallback","validationCode":"bool CpuDeviceAvailable(VkPhysicalDevice d) { api.vkGetPhysicalDeviceProperties(d, out var p); return p.DeviceType == VkPhysicalDeviceType.Cpu; }","typeGuard":null,"tryCatchPattern":"try { EnsureSharedContext(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Lavapipe\"))\n{\n    Assert.Skip(\"Software rendering requested but no CPU Vulkan device\");\n}","preventionTips":["Install mesa-vulkan-drivers (Lavapipe) wherever softwareRendering=true is used","Verify a CPU-type device appears in vulkaninfo","Include the Lavapipe ICD in VK_ICD_FILENAMES","Only force software rendering on images provisioned for it"],"tags":["vulkan","software-rendering","lavapipe"],"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"}