{"record":{"id":"c5cea87ff365956c","repo":"niri-wm/niri","slug":"no-mode","errorCode":null,"errorMessage":"no mode","messagePattern":"no mode","errorType":"console","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/backend/tty.rs","lineNumber":1291,"sourceCode":"            .unwrap_or_default();\n\n        for m in connector.modes() {\n            trace!(\"{m:?}\");\n        }\n\n        let mut mode = None;\n        if let Some(modeline) = &config.modeline {\n            match calculate_drm_mode_from_modeline(modeline) {\n                Ok(x) => mode = Some(x),\n                Err(err) => {\n                    warn!(\"invalid custom modeline; falling back to advertised modes: {err:?}\");\n                }\n            }\n        }\n\n        let (mode, fallback) = match mode {\n            Some(x) => (x, false),\n            None => pick_mode(&connector, config.mode).ok_or_else(|| anyhow!(\"no mode\"))?,\n        };\n\n        if fallback {\n            let target = config.mode.unwrap();\n            warn!(\n                \"configured mode {}x{}{} could not be found, falling back to preferred\",\n                target.mode.width,\n                target.mode.height,\n                if let Some(refresh) = target.mode.refresh {\n                    format!(\"@{refresh}\")\n                } else {\n                    String::new()\n                },\n            );\n        }\n\n        debug!(\"picking mode: {mode:?}\");\n","sourceCodeStart":1273,"sourceCodeEnd":1309,"githubUrl":"https://github.com/niri-wm/niri/blob/606284464d4a99bb35710fee68192bc71085ee7c/src/backend/tty.rs#L1273-L1309","documentation":"When enabling a DRM connector, niri picks a mode with pick_mode(): it first tries an exact non-interlaced match for the configured mode, then the connector's PREFERRED mode, and as a last resort connector.modes().first(). 'no mode' means the KMS connector advertised ZERO modes, so even the last-resort lookup failed and output setup cannot continue. This is almost always a physical/EDID problem (the kernel has no mode list for the connector), not a config typo.","triggerScenarios":"Calling the output-setup path with a connector whose modes() list is empty: monitor disconnected but connector force-enabled, a KVM switch or docking station that fails the EDID read, a corrupted/missing EDID blob, or a VM's virtual connector with no modes created yet. A configured resolution that merely does not match would only set fallback=true and use the preferred mode, not this error.","commonSituations":"Monitor/cable/dock flakeliness where DDC/EDID negotiation fails; switching a KVM while the compositor starts; amdgpu/i915 driver bugs or old kernels reporting empty mode lists on eDP/DP; running niri in QEMU without a virtual display with modes; forcing an output on (output-connectors) for a connector with nothing attached.","solutions":["Check what the kernel sees: 'cat /sys/class/drm/card-*-DP-1/modes' and 'edid-decode /sys/class/drm/card-DP-1/edid' — if the modes list is empty or EDID is invalid, reseat the cable/dock or power-cycle the monitor.","Provide a custom mode that does not depend on advertised modes: a modeline in the output config (computed via calculate_drm_mode_from_modeline) or 'mode custom WxH@refresh' (computed via CVT), both of which bypass pick_mode's dependency on connector.modes().","If a KVM or dock is involved, plug the display directly to rule it out, and update dock/KVM firmware; for docks known to break EDID, force the EDID via kernel drm_kms_helper edid_firmware parameter.","Update the kernel/DRM driver and re-test; empty mode lists on connected panels are usually fixed driver-side."],"exampleFix":"// before: connector advertises no modes, startup fails with \"no mode\"\noutput DP-1 {\n}\n\n// after: supply a modeline so niri computes a mode without advertised modes\noutput DP-1 {\n    modeline \"241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync\"\n}","handlingStrategy":"fallback","validationCode":"// Rust (smithay): check the connector before enabling the output\nlet modes = connector.modes();\nif modes.is_empty() {\n    warn!(\"connector {} advertises no modes (EDID read failed?)\", connector.interface());\n    // skip or fall back to a custom/modeline mode computed offline\n}","typeGuard":null,"tryCatchPattern":"let (mode, fallback) = match pick_mode(&connector, config.mode) {\n    Some(x) => x,\n    None => {\n        warn!(\"no mode on {}; falling back to a computed CVT mode\", name);\n        calculate_mode_cvt(1920, 1080, 60.0) // user-approved default\n    }\n};","preventionTips":["After docking/KVM switches, re-check 'cat /sys/class/drm/card-*/modes' before starting the compositor.","Prefer 'mode WxH@R' or 'mode custom WxH@R' over nothing on flaky connectors — the custom path never consults advertised modes.","Keep a known-good modeline in the config for docks whose EDID negotiation is unreliable.","Watch the niri log for the 'no mode' connector name; it identifies which physical port to reseat."],"tags":["drm","kms","mode","edid","output","monitor","connector"],"backgroundTag":"display-mode-unavailable","analyzedSha":"606284464d4a99bb35710fee68192bc71085ee7c","analyzedAt":"2026-08-16T21:48:00.228Z","schemaVersion":2},"datasetVersion":"2026-08-18T00:17:09.346Z"}