ERROR : Compiling shaders requires a valid Display

I get this error when trying to compile a shader with

./shader_builder -m -x ~/glsl/shader.glsl

I get the same error in both the Flame 2020.2 & Flame 2021.1 directories.
One other person on the internet has had this problem.
You can guess who answered.

-Ted

Yes, you do need a GUI display (IE logged into KDE) to compile, you can’t do it if you’re just SSH’d into a shell for instance. For whatever reason shader_builder opens a tiny little window briefly so it needs an X environment.

If you’re trying to do this remote via SSH, if the workstation is sitting there logged into KDE as a user or even sitting at the login window, try doing:

env DISPLAY=:0 ./shader_builder -m -x ~/glsl/shader.glsl

and see if that works.

(I should also point out that if you’re trying to do this in the background on a system that someone else is using, you might annoy them as the little window pops up and steals focus briefly…)

I was on my Mac Pro at home, no SSH involved, but your fix seems to work anyway!
What does

that do?

env sets environment variables, in this case just one called DISPLAY set to :0 and then runs whatever’s after it in that environment, which, on Linux, tells a GUI app you’re wanting it to use display 0 which is your main monitor.

Why that works (or even means anything) on Mac, I’m not really sure! :smiley:

1 Like

if your having trouble and on a mac. You need this:
https://www.xquartz.org