dkogan / horizonator

Terrain renderer based on SRTM DEMs
Other
27 stars 4 forks source link

Running on remote machine, errors re: display #2

Closed bkj closed 3 years ago

bkj commented 3 years ago

Hi --

I'm trying to run the Python examples on a machine via SSH, but it's throwing an error indicating that a display cannot be found:

>>> import cv2
>>> import horizonator
>>> h = horizonator.horizonator(34.2884, -117.7134, 3600, 450)
freeglut (exec): failed to open display ''

Any suggestions on how to work around?

Thanks!

dkogan commented 3 years ago

Sure. It's using OpenGL, so it needs X, and you're not giving it that: your DISPLAY environment variable is ''.

As an OpenGL application, it can't run completely headlessly. Even when you're using the Python API to render images to disk, it still needs to talk to X to get access to the GPU.

Presumably you want to be using the graphics card of the machine you logged into, right? That machine needs to be running X with functional OpenGL. And you need to set your DISPLAY environment variable to point to it. Something like ":0.0" usually.

If that's set up, you should be able to run "xdpyinfo" to tell you things about the X display. Stuff like the displays that are connected, their resolution and so on.

If that's running, run "glxinfo" to tell you things about your OpenGL. It should say "direct rendering: Yes", and the device should be your actual GPU, not a software renderer. Once that's going, this should all work.