taichi-dev / taichi

Productive, portable, and performant GPU programming in Python.
https://taichi-lang.org
Apache License 2.0
25.48k stars 2.28k forks source link

EGL related issues #3853

Open ailzhang opened 2 years ago

ailzhang commented 2 years ago

This is a bit confusing so I'm opening an issue to track here:

  1. Linux On linux I found out that if DISPLAY is set (e.g localhost:10.0) in my ssh window, EGL will use that and can only load up to EGL1.0. But if I do unset DISPLAY then EGL can correctly find 1.5 and pass all tests.

Maybe relevant:

  1. Windows Does windows require special installation for EGL, sshing into a windows powershell cannot find a EGLDisplay.
bobcao3 commented 2 years ago

Don't think there's a good way to fix this. The true-headless EGL support is a feature of Nvidia's linux driver as a server visualization package. When DISPLAY is set, the driver will try to find a proper display output that matches the env settings. (Maybe it's because the terminal have X over SSH support and it set up the X DISPLAY settings?)

bobcao3 commented 2 years ago

X11 is a huge mess of spaghetti, I think the best we can do is try to unset DISPLAY if we failed to initialize EGL and retry?

ailzhang commented 2 years ago

Yea for Linux one we can simply try unsetting DISPLAY to workaround. I'm not sure about whether it's expected to work on windows tho (it didn't work when I tested but maybe I did it wrong?

ailzhang commented 2 years ago

@bobcao3 Do you happen to have any idea why our EGL setup doesn't work on windows? :D