Skip to content

Skip save_images on headless machines without display#3944

Merged
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
harsh-kumar-patwa:fix-headless-save-images
Mar 2, 2026
Merged

Skip save_images on headless machines without display#3944
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
harsh-kumar-patwa:fix-headless-save-images

Conversation

@harsh-kumar-patwa
Copy link
Contributor

Summary

Resolves #3034

The flow crashes during final_report.tcl on headless machines (no X display) because gui::show tries to initialize a Qt platform plugin, which fails with a fatal std::runtime_error abort when no display is available.

Changes

flow/scripts/final_report.tcl

Added a DISPLAY environment check alongside the existing ord::openroad_gui_compiled check before calling gui::show to run save_images.tcl. On headless machines where DISPLAY is unset/empty, image generation is now gracefully skipped instead of crashing the flow.

Uses the existing env_var_exists_and_non_empty helper (already used 3 times in the same file for RCX_RULES, PWR_NETS_VOLTAGES, GND_NETS_VOLTAGES).

Context

  • variables.mk already sets QT_QPA_PLATFORM=offscreen when DISPLAY is empty, but the Tcl script never checked DISPLAY before attempting GUI operations
  • The generated images (final_*.webp, cts_*.webp) are optional visualization output — no CI tests or Makefile targets depend on them
  • Machines with a display are unaffected — behavior is identical to before

Resolves The-OpenROAD-Project#3034

final_report.tcl only checks if OpenROAD was compiled with GUI
support before calling gui::show to run save_images.tcl. On
headless machines without a display, this causes a fatal crash
(std::runtime_error abort from Qt platform plugin initialization).

Add a DISPLAY environment check alongside the existing GUI
compilation check so image generation is gracefully skipped
on headless systems.

Signed-off-by: Harsh Kumar Patwa <harshkumarpatwa@gmail.com>
Signed-off-by: Harsh Kumar <harshkumar3446@gmail.com>
@maliberty
Copy link
Member

@fredowski @stefanottili is DISPLAY set on MacOS?

@stefanottili
Copy link

default zsh: env | grep DISPLAY
DISPLAY=:0

@maliberty maliberty enabled auto-merge March 2, 2026 18:36
@fredowski
Copy link

not for me:

MacBookProM4-2:~ fritz$ echo $HOME
/Users/fritz
MacBookProM4-2:~ fritz$ echo $DISPLAY

MacBookProM4-2:~ fritz$

@maliberty maliberty merged commit ae6310e into The-OpenROAD-Project:master Mar 2, 2026
7 of 8 checks passed
@maliberty
Copy link
Member

@fredowski is there some other way to detect the presence of a gui capable display? This PR checks for DISPLAY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flow finishing fails without GUI

4 participants