Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › DRM KMS

How to Render Graphics on Linux Without Wayland or Xorg

By Freedom251 Team · · 9 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no single replacement for Wayland or Xorg because “display graphics” can mean three different outcomes: render pixels into memory or an image file, provide a virtual screen to an application test, or scan pixels out to a real monitor. Use OSMesa or a surfaceless EGL/Vulkan context for the first outcome, direct display APIs such as Vulkan VK_KHR_display for the third, and treat Xvfb as an X-dependent testing tool rather than a strict no-X solution.

The correct path depends on your graphics API, application support, driver, hardware acceleration needs and who owns the display device. A successful CPU render proves only that off-screen rendering works; it does not prove that the same process can take control of a physical monitor.

As an Amazon Associate I earn from qualifying purchases.

Start by defining what “display” means

Before changing environment variables or installing libraries, identify the output your program must produce. These targets use different APIs and have different permissions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Required result Best-fit route What it provides Main limitation
Pixels for an encoder, test artifact or image file OSMesa An OpenGL color buffer allocated by your application in ordinary memory It is software-oriented and does not present a monitor image
Off-screen OpenGL or GLES rendering with EGL EGL surfaceless platform A context without a native window-system surface The target driver and application must support surfaceless EGL
Headless Vulkan rendering Vulkan images and framebuffers without a WSI swapchain GPU or software-generated images under application control More setup than a windowed swapchain; support is implementation-specific
Pixels on a physical monitor with no compositor Vulkan VK_KHR_display or a lower-level DRM/KMS design Direct display enumeration, mode selection and scan-out Exclusive ownership of the display hardware is required
A virtual screen for an old X application Xvfb An X server whose framebuffer lives in virtual memory It still runs X, so it fails a strict no-Xorg/X11 requirement

Make this choice first. Installing a virtual X server will not help a renderer that needs an EGL context, and creating an off-screen image will not put anything on a monitor.

Render into application memory with OSMesa

OSMesa is Mesa’s off-screen interface for OpenGL. Instead of creating a window, it renders into a color buffer supplied by your program. The buffer can then be copied to an encoder, saved as PNG or another image format, compared in a test, or passed to computer-vision code. No X server, Wayland compositor or native window is needed.

When OSMesa is the right choice

  • Use it for deterministic image generation on a headless server or build worker.
  • Use it when the application already targets the OSMesa API or can abstract its context creation.
  • Use it when the final product is a memory buffer or file, not a live monitor signal.

Mesa documents software renderers including llvmpipe, softpipe and swrast for this route. Llvm­pipe is Mesa’s high-performance Gallium LLVM driver; softpipe is its reference Gallium software driver. Their speed and feature coverage depend on the workload and build, so do not treat the renderer names as a universal performance ranking.

Typical integration sequence

  1. Create an OSMesa context with the color format and depth/stencil requirements your renderer needs.
  2. Allocate a correctly sized application-owned color buffer, taking account of row order and bytes per pixel.
  3. Make the context current against that buffer.
  4. Run the normal OpenGL setup and draw calls.
  5. Read or encode the completed buffer, then release the context and memory.

Libraries that assume a window, GLX, or a GLFW display may need a dedicated OSMesa backend. A program starting successfully with OSMesa does not demonstrate that its windowed backend can run without modification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use EGL without a native window

Mesa’s EGL platform support includes surfaceless and drm, alongside X11 and Wayland. A surfaceless EGL context is appropriate when rendering does not require a native display surface. The DRM platform is a separate, lower-level integration path for Linux device and display work; it is not interchangeable with surfaceless rendering.

Surfaceless EGL workflow

  1. Initialize EGL using the target implementation and request the client API your program uses, such as OpenGL ES or desktop OpenGL where supported.
  2. Select a configuration compatible with your context. Some implementations expose EGL_KHR_no_config_context, allowing context creation without a traditional configuration.
  3. Create a context and make it current without creating a window surface.
  4. Render to framebuffer objects (FBOs) that your application creates, then read back or process the attachments.
  5. Destroy the context and release EGL resources when the job ends.

Do not assume that every EGL loader offers every platform. Confirm the target driver’s extensions and the application’s context-creation code. Mesa notes that driver initialization can retry with software components; setting LIBGL_ALWAYS_SOFTWARE=1 can force software components when diagnosing a missing or unusable GPU path.

Rank #2
Linux 3-D Graphics Programming
  • Used Book in Good Condition

Surfaceless is not direct scan-out

A surfaceless context has no window-system surface to present. It is therefore useful for rendering an image, but it cannot by itself select a monitor, negotiate a mode or own a scan-out plane. If a monitor must light up, use a direct-display design instead.

Headless Vulkan: images instead of a swapchain

Vulkan applications normally present through a window-system integration (WSI) swapchain. Headless rendering removes that dependency: create VkImage objects yourself, attach them to framebuffers, render, and export or consume the image without creating a WSI surface.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This approach is useful for render farms, CI jobs and embedded pipelines that need Vulkan features but no desktop window. It requires application changes because code that unconditionally creates a swapchain, acquires a presentable image and calls present cannot become headless through an environment variable alone.

Platform-specific GLES and Vulkan example

AMD’s Versal AI Edge/Prime Gen 2 documentation (UG1784, revision 1.1, released 2026-01-14) describes a GLES headless design using EGL_KHR_no_config_context and EGL_KHR_surfaceless_context. The application creates and binds an off-screen framebuffer before issuing graphics commands. The same guide describes Vulkan headless rendering by manually creating VkImage instances and framebuffer attachments instead of following the WSI swapchain route.

Those instructions are specific to that platform and software stack. Use them as a model for the object lifetime and framebuffer setup, not as a universal command sequence for desktop Linux or another GPU vendor.

Open3D on a Linux host with no display variables

Open3D 0.20’s legacy OpenGL visualizer checks for DISPLAY and WAYLAND_DISPLAY on Linux. When neither variable is present, its documented behavior is to create an EGL off-screen context rather than a visible GLFW window. The documented path requires no special build flag or additional environment variable.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run the documented EGL off-screen path

  1. Ensure the Mesa EGL implementation and the Open3D 0.20 runtime are installed in the environment that will execute the script.
  2. Remove inherited desktop-display variables before launching the program: unset DISPLAY WAYLAND_DISPLAY.
  3. Run the Python rendering script through the legacy visualizer path.
  4. Write the resulting color and depth buffers to PNG files or another application-owned output.

If no GPU is available, Open3D documents that a software fallback can work when Mesa’s EGL implementation is installed. Its documentation recommends the Filament-based rendering stack for new applications; the EGL behavior described here is for the legacy OpenGL visualizer.

Use Lavapipe for a CPU Vulkan path

Open3D’s separate CPU software-rendering guidance uses Mesa Lavapipe through the Vulkan loader and sets EGL_PLATFORM=surfaceless for headless or off-screen work. A representative launch pattern is:

unset DISPLAY WAYLAND_DISPLAY
VK_DRIVER_FILES=/path/to/lavapipe-driver.json EGL_PLATFORM=surfaceless python render.py

The exact driver-file path is installation-specific. These variables are Open3D/Mesa/Vulkan-loader configuration examples, not universal flags for arbitrary graphics programs. CPU rendering is slower and less responsive than GPU rendering, so use it when portability or hardware independence matters more than throughput.

Present directly on a physical monitor

If the required result is an image on a real display, use a direct-display API rather than an off-screen context. Vulkan’s VK_KHR_display extension can enumerate physical displays and modes, choose a display plane, and create a surface with vkCreateDisplayPlaneSurfaceKHR. The Vulkan Guide describes this workflow for embedded systems that have no window manager, including industrial devices.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Direct-display sequence

  1. Enumerate physical devices and confirm that the required display extension is exposed.
  2. Enumerate connected displays and their supported modes.
  3. Choose a mode whose resolution, refresh rate and format match the target output.
  4. Inspect display planes and select one compatible with the image format and transform.
  5. Create the display-plane surface, then create a Vulkan swapchain or image path appropriate to that surface.
  6. Submit frames while handling mode changes, hot-plug events and device-loss recovery for the target platform.

Direct display is an ownership problem as much as an API problem. On normal Linux systems, an active Wayland or X11 compositor already controls scan-out. Another process cannot simply open the same monitor and take over. The usual DRM/KMS design requires the application to run where no compositor owns the device, such as a bare virtual terminal, a dedicated boot target, or an embedded system that never starts a compositor.

Stopping a compositor is therefore a deployment decision, not a per-window setting. It can disrupt local sessions and requires appropriate device permissions. Test on a dedicated console or embedded image before using this model in production.

Why Xvfb does not satisfy a strict no-X requirement

Xvfb performs X operations in virtual memory without sending output to a physical screen. That makes it useful for legacy applications and automated tests that require an X display. However, Xvfb is still an X server. If the requirement is specifically “no Xorg/X11,” deploying Xvfb changes the output device but not the window-system dependency.

Choose Xvfb only when the real requirement is a virtual screen for an X-dependent test. For a genuinely window-system-free renderer, use OSMesa, surfaceless EGL or headless Vulkan instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

GPU acceleration versus software rendering

Path Acceleration source Operational trade-off
OSMesa with llvmpipe, softpipe or swrast CPU Simple deployment and no display ownership; throughput depends on the scene and CPU
Surfaceless EGL on a working GPU driver GPU, when the driver exposes the required EGL platform Can preserve hardware acceleration without a desktop compositor; driver support must be verified
Open3D Lavapipe configuration CPU Vulkan implementation Useful on machines without a usable GPU; Open3D warns it is slower and less responsive
Direct Vulkan display Display-capable GPU or embedded graphics device Lowest-level presentation path, but requires exclusive display access and compatible modes

Force software only for a deliberate reason, such as a missing GPU, reproducible CI output or a driver diagnosis. A software fallback can hide a deployment problem if production requires hardware acceleration, so record the initialized renderer and context during startup.

Troubleshooting by symptom

The application says no display is available

That message usually means the program is trying to create a window through GLFW, GLX or another native backend. Switch the application to an OSMesa, EGL-surfaceless or Vulkan-headless backend; merely unsetting DISPLAY does not rewrite window-creation code.

EGL initialization fails

Check whether the selected driver exposes surfaceless EGL and whether the loader can find it. Try a software diagnostic with LIBGL_ALWAYS_SOFTWARE=1. If software initialization succeeds but the GPU path fails, investigate driver permissions, device nodes and extension support rather than assuming the rendering code is incorrect.

Open3D still opens a window

Confirm that both DISPLAY and WAYLAND_DISPLAY are unset in the process environment, and verify that the code is using Open3D 0.20’s documented legacy OpenGL visualizer path. A different visualization stack may have different context requirements.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The image renders but the monitor remains blank

Off-screen rendering intentionally produces no scan-out. Use a direct-display surface and run without another compositor owning DRM/KMS. Also verify mode, plane, format and permissions; a valid Vulkan image alone does not guarantee that a display controller can present it.

CPU rendering is unexpectedly slow

Identify whether llvmpipe, softpipe, swrast or Lavapipe was selected and compare the workload on the target machine. The available documentation provides no cross-application benchmark or universal ranking, so measure your own scene and resolution before choosing hardware or changing APIs.

A practical selection checklist

  • Need a file or memory buffer: start with OSMesa, or use surfaceless EGL/Vulkan if the application already supports those APIs.
  • Need an OpenGL ES context without a window: test EGL surfaceless and the required context extensions.
  • Need Vulkan features without presentation: create images and framebuffer attachments directly; avoid WSI swapchain assumptions.
  • Need a physical monitor: plan for VK_KHR_display or DRM/KMS and exclusive device ownership.
  • Need a virtual X screen for an old test: Xvfb is appropriate, but document that X remains part of the stack.
  • Need GPU acceleration: verify driver and extension support on the exact target system; do not infer it from a successful software render.
  • Need repeatable CI: log the selected renderer, unset inherited display variables, and save representative color/depth artifacts.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

DRM KMSEGLheadless renderingLinux GraphicsOpen3DOSMesaVulkan

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.