{"record":{"id":"f5cbe4934d719b5f","repo":"stride3d/stride","slug":"no-compatible-screen-mode-found","errorCode":null,"errorMessage":"No compatible screen mode found","messagePattern":"No compatible screen mode found","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Games/GraphicsDeviceManager.cs","lineNumber":689,"sourceCode":"                preferredParameters.PreferredBackBufferWidth = resizedBackBufferWidth;\n                preferredParameters.PreferredBackBufferHeight = resizedBackBufferHeight;\n            }\n\n            var devices = graphicsDeviceFactory.FindBestDevices(preferredParameters);\n            if (devices.Count == 0)\n            {\n                // Nothing was found; first, let's check if graphics profile was actually supported\n                // NOTE: We don't do this preemptively because in some cases it seems to take lot of time\n                //       (happened on a test machine, several seconds freeze on ID3D11Device.Release())\n                if (!IsPreferredProfileAvailable(preferredParameters.PreferredGraphicsProfile, out var availableGraphicsProfile))\n                {\n                    var notSupportedProfiles = string.Join(\", \", preferredParameters.PreferredGraphicsProfile);\n                    throw new InvalidOperationException($\"None of the graphics profiles [{notSupportedProfiles}] are supported by the Graphics Device. \" +\n                        $\"The highest available profile is [{availableGraphicsProfile}].\");\n                }\n\n                // Otherwise, there was just no screen mode\n                throw new InvalidOperationException(\"No compatible screen mode found\");\n            }\n\n            RankDevices(devices);\n\n            if (devices.Count == 0)\n            {\n                throw new InvalidOperationException(\"No compatible screen modes found after ranking\");\n            }\n            return devices[0];\n        }\n\n        /// <summary>\n        ///   Ranks a list of <see cref=\"GraphicsDeviceInformation\"/>s before creating a new Graphics Device.\n        /// </summary>\n        /// <param name=\"foundDevices\">A list of possible device configurations to be ranked and reordered.</param>\n        protected virtual void RankDevices(List<GraphicsDeviceInformation> foundDevices)\n        {\n            // Don't sort if there is a single device (mostly for XAML/UWP)","sourceCodeStart":671,"sourceCodeEnd":707,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Games/GraphicsDeviceManager.cs#L671-L707","documentation":"In FindBestDevice, when no device was found but the graphics profiles ARE supported, Stride concludes the hardware can run the profile but no screen mode/device configuration matched, and throws 'No compatible screen mode found'. This distinguishes a capability problem (1152) from a display-mode/mode-matching problem.","triggerScenarios":"FindBestDevice fails to produce a GraphicsDeviceInformation even though IsPreferredProfileAvailable returns true — e.g. requested resolution/refresh/backbuffer format or device settings match no available screen mode during device enumeration.","commonSituations":"Requesting a fullscreen resolution the monitor doesn't offer, unusual PreferredBackBufferWidth/Height combinations, multi-monitor setups with odd mode lists, or headless systems where no real display mode exists.","solutions":["Set PreferredBackBufferWidth/Height to a standard resolution supported by the monitor, or leave defaults instead of forcing exotic sizes.","Avoid forcing fullscreen during initialization; start windowed and switch to fullscreen after the device is created.","Verify a display is attached and enumeration works (real monitor, not headless server); retry with default GraphicsDeviceManager settings."],"exampleFix":"// before\ngdm.PreferredBackBufferWidth = 1366; // unsupported mode\ngdm.IsFullScreen = true;\n// after\ngdm.PreferredBackBufferWidth = 1920;\ngdm.PreferredBackBufferHeight = 1080;\ngdm.IsFullScreen = false;","handlingStrategy":"validation","validationCode":"if (gdm.IsFullScreen)\n{\n    var mode = GraphicsDevice.QueryScreenResolutions().FirstOrDefault(r =>\n        r.Width == gdm.PreferredBackBufferWidth && r.Height == gdm.PreferredBackBufferHeight);\n    if (mode == null) gdm.IsFullScreen = false; // fall back to windowed\n}","typeGuard":null,"tryCatchPattern":"try { game.Run(); }\ncatch (InvalidOperationException ex) when (ex.Message == \"No compatible screen mode found\")\n{\n    gdm.IsFullScreen = false;\n    gdm.PreferredBackBufferWidth = gdm.PreferredBackBufferHeight = 0; // defaults\n    game.Run();\n}","preventionTips":["Use standard resolutions and default back-buffer settings unless there is a specific need.","Start windowed; switch to fullscreen only after device creation.","Test on multi-monitor and headless setups."],"tags":["graphics","display-mode","screen-resolution"],"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"}