stride3d/stride · error · NotSupportedException
Only SDL is supported for the time being on Linux
Error message
Only SDL is supported for the time being on Linux
What it means
Stride's Vulkan SwapChainGraphicsPresenter.CreateSurface supports only SDL as a windowing surface backend on Linux; when the platform type is Linux but the active window/input backend is something else (e.g. X11/Wayland/GLFW-based presenter), it throws NotSupportedException. This is an explicit limitation: the Vulkan surface creation code path is only wired up for SDL2 on Linux.
Solutions
- Use the SDL2 windowing backend on Linux: create your game window via SDL2 (Stride's default SDL windowing on Linux) instead of a custom/native window handle.
- Switch the graphics API from Vulkan to Direct3D-independent backends available on Linux, e.g. request the Vulkan presenter only when SDL is in use, or fall back to a different GraphicsBackend in your Game settings.
- If you must use a native X11/Wayland window, add a branch in CreateSurface calling vkCreateXcbSurfaceKHR/vkCreateWaylandSurfaceKHR (patch Stride source).
- Ensure the SDL2 native libraries are installed (libsdl2) so the SDL path actually initializes; a missing SDL lib can push initialization down a non-SDL path.
Example fix
// before: custom non-SDL window on Linux
var window = new MyX11Window();
var presenter = new SwapChainGraphicsPresenter(device, new PresentationParameters { SourcePtr = window.Handle });
// after: use SDL2 window (Stride's supported Linux path)
using var sdlWindow = new GameWindow(Stride.Graphics.Sdl.Sdl2Window("App", 1280, 720));
var presenter = new SwapChainGraphicsPresenter(device, new PresentationParameters { SourcePtr = sdlWindow.NativeWindow.NativePtr }); Defensive patterns
Strategy: fallback
Validate before calling
if (Platform.Type == PlatformType.Linux && !(window is SdlWindow))
throw new InvalidOperationException("On Linux, Stride's Vulkan presenter requires an SDL2 window."); Try / catch
try
{
return new SwapChainGraphicsPresenter(device, parameters);
}
catch (NotSupportedException ex) when (Platform.Type == PlatformType.Linux && ex.Message.Contains("SDL"))
{
log.Warn("Non-SDL Vulkan window unsupported on Linux; falling back.");
return CreateFallbackPresenter(device, parameters);
} Prevention
- Always build Linux game windows through Stride's SDL2 GameWindow instead of raw X11/Wayland handles.
- Keep libsdl2 installed and verified at startup on Linux targets.
- Document the SDL-only Linux Vulkan constraint in your deployment checklist.
- Add a startup capability check that fails fast with a clear message before creating the swap chain.
When it happens
Trigger: Instantiating a Vulkan SwapChainGraphicsPresenter on Linux whose window handle is provided by anything other than an SDL window; the if/else chain in CreateSurface checks Platform.Type == PlatformType.Linux and throws because no non-SDL surface-creation branch (vkCreateXcbSurfaceKHR / vkCreateWaylandSurfaceKHR) exists.
Common situations: Running a Stride game under a bare X11 or Wayland desktop with the Vulkan renderer while using a native (non-SDL) game window; embedding Stride in a custom windowing toolkit; headless/CI Linux environments with no display server; distro builds that swapped SDL for another input library.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- None of the supported surface extensions VK_KHR_xcb_surface…
- Required Vulkan extension
- Could not acquire swapchain image
- DeviceWindowHandle cannot be null
- Cannot create a swapchain: Vulkan surface extensions are…
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/5c262890c521aa07.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Graphics/Vulkan/SwapChainGraphicsPresenter.Vulkan.cs:595
{
throw new NotSupportedException($"Form of type [{Description.DeviceWindowHandle.GetType().Name}] is not supported. Only System.Windows.Control are supported");
}
var surfaceCreateInfo = new VkWin32SurfaceCreateInfoKHR
{
sType = VkStructureType.Win32SurfaceCreateInfoKHR,
hinstance = Process.GetCurrentProcess().Handle,
hwnd = controlHandle,
};
GraphicsDevice.CheckResult(GraphicsDevice.NativeInstanceApi.vkCreateWin32SurfaceKHR(GraphicsDevice.NativeInstance, &surfaceCreateInfo, null, out surface));
}
else if (Platform.Type == PlatformType.Android)
{
throw new NotImplementedException();
}
else if (Platform.Type == PlatformType.Linux)
{
throw new NotSupportedException("Only SDL is supported for the time being on Linux");
}
else
{
throw new NotSupportedException();
}
}
private unsafe void CreateBackBuffers()
{
// Create the texture object
var backBufferDescription = new TextureDescription
{
ArraySize = 1,
Dimension = TextureDimension.Texture2D,
Height = Description.BackBufferHeight,
Width = Description.BackBufferWidth,
Depth = 1,
Flags = TextureFlags.RenderTarget,View on GitHub (pinned to 96fad776d2)