{"record":{"id":"430607b21a1d1dd9","repo":"gfx-rs/wgpu","slug":"failed-to-get-display-modes","errorCode":null,"errorMessage":"Failed to get display modes","messagePattern":"Failed to get display modes","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-hal/src/vulkan/drm.rs","lineNumber":216,"sourceCode":"\n        let display = unsafe {\n            acquire_drm_display_instance\n                .get_drm_display(physical_device, fd, connector_id)\n                .expect(\"Failed to get drm display\")\n        };\n\n        unsafe {\n            acquire_drm_display_instance\n                .acquire_drm_display(physical_device, fd, display)\n                .expect(\"Failed to acquire drm display\")\n        }\n\n        let display_instance = khr::display::Instance::new(&self.shared.entry, &self.shared.raw);\n\n        let modes = unsafe {\n            display_instance\n                .get_display_mode_properties(physical_device, display)\n                .expect(\"Failed to get display modes\")\n        };\n\n        let mut mode = None;\n\n        for current_mode in modes {\n            log::trace!(\n                \"Comparing mode {}x{}@{} with {width}x{height}@{refresh_rate}\",\n                current_mode.parameters.visible_region.width,\n                current_mode.parameters.visible_region.height,\n                current_mode.parameters.refresh_rate\n            );\n            if current_mode.parameters.refresh_rate == refresh_rate\n                && current_mode.parameters.visible_region.width == width\n                && current_mode.parameters.visible_region.height == height\n            {\n                mode = Some(current_mode)\n            }\n        }","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-hal/src/vulkan/drm.rs#L198-L234","documentation":"A panic from .expect() in create_surface_from_drm when vkGetDisplayModePropertiesKHR (VK_KHR_display) fails or returns an error result while enumerating the supported modes of the acquired DRM display. This happens after the display was successfully acquired, so it indicates the driver/display could not report its mode list at all (driver bug, display disconnected between acquire and query, or unsupported KHR_display usage) rather than merely a missing requested resolution. The panic aborts the process; no mode matching (width/height/refresh rate) has been attempted yet.","triggerScenarios":"Thrown at wgpu-hal/src/vulkan/drm.rs:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry after the display connection settles; verify the connector has an active mode","Use a different output/connector on the DRM device"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}