# ERROR : Compiling shaders requires a valid Display

**URL:** <https://forum.logik.tv/t/error-compiling-shaders-requires-a-valid-display/2952>\
**Category:** Flame Questions\
**Tags:** matchbox\
**Created:** [April 26, 2021, 6:15pm UTC](https://forum.logik.tv/t/error-compiling-shaders-requires-a-valid-display/2952 "2021-04-26T18:15:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![KuleshovEffect](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/kuleshoveffect/32/4928_2.png) [@KuleshovEffect](https://forum.logik.tv/u/KuleshovEffect)\
**Post date:** [April 26, 2021, 6:15pm UTC](https://forum.logik.tv/t/error-compiling-shaders-requires-a-valid-display/2952/1 "2021-04-26T18:15:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ManChicken](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/manchicken/32/233_2.png) [@ManChicken](https://forum.logik.tv/u/ManChicken)\
**Post date:** [April 26, 2021, 11:06pm UTC](https://forum.logik.tv/t/error-compiling-shaders-requires-a-valid-display/2952/2 "2021-04-26T23:06:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ManChicken](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/manchicken/32/233_2.png) [@ManChicken](https://forum.logik.tv/u/ManChicken)\
**Post date:** [April 26, 2021, 11:08pm UTC](https://forum.logik.tv/t/error-compiling-shaders-requires-a-valid-display/2952/3 "2021-04-26T23:08:57Z")

</div>

(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…)

---

<div class="post-metadata">

**Author:** ![KuleshovEffect](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/kuleshoveffect/32/4928_2.png) [@KuleshovEffect](https://forum.logik.tv/u/KuleshovEffect)\
**Post date:** [April 27, 2021, 12:26am UTC](https://forum.logik.tv/t/error-compiling-shaders-requires-a-valid-display/2952/4 "2021-04-27T00:26:09Z")

</div>

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

> [@ManChicken](#):
>
> `env DISPLAY=:0`

that do?

---

<div class="post-metadata">

**Author:** ![ManChicken](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/manchicken/32/233_2.png) [@ManChicken](https://forum.logik.tv/u/ManChicken)\
**Post date:** [April 27, 2021, 3:08am UTC](https://forum.logik.tv/t/error-compiling-shaders-requires-a-valid-display/2952/5 "2021-04-27T03:08:17Z")

</div>

`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! 😃

---

<div class="post-metadata">

**Author:** ![miles](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@miles](https://forum.logik.tv/u/miles)\
**Post date:** [April 27, 2021, 6:41am UTC](https://forum.logik.tv/t/error-compiling-shaders-requires-a-valid-display/2952/6 "2021-04-27T06:41:24Z")

</div>

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