Hello Guest

AWS environment/OpenGL difficulties

  • 5 Replies
  • 5714 Views
AWS environment/OpenGL difficulties
« on: November 28, 2016, 22:54:11 »
Hi guys. This question falls doubtless under the heading of "duh" and may be answered by "You can't get there from here".

Here's the situation:
-I'm trying to port an app that utilizes LWJGL from Windows to Linux.
-It works in a VMWare Ubuntu Linux environment swimmingly once I install the LWJGL natives, but that environment has full XWindows and a virtual GPU.
-Operating in AWS is preferred.
-AWS environments with a GPU are very expensive.

So. I'm trying to get LWJGL to work in a truly headless, no-GPU Ubuntu Linux environment. I'm trying to use Xvfb, or Xdummy, as the display. I'm trying to use Mesa for the OpenGL display.

I've tried a number of configurations to get this work, and this is where I get stuck, calling org.lwjgl.opengl.Display.create():

Code: [Select]
java.lang.UnsatisfiedLinkError: org.lwjgl.opengl.GLContext.getFunctionAddress(Ljava/lang/String;)J
This function basically renders a static image from a 3D file.

So am I doing something basic wrong, or am I truly trying to do the impossible?

--Note, I'm not a very experienced person with LWJGL and with OpenGL in general, but I've been working on this for over a week and just failing miserably.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: AWS environment/OpenGL difficulties
« Reply #1 on: November 29, 2016, 10:05:39 »
Afaik both LWJGL 2 and GLFW in LWJGL 3 do not work with Xvfb/Xdummy. I haven't done any testing and don't know the technical details, though. If someone finds a complete working solution, I'll see about adding something to LWJGL 3 that supports it (which may require anything from GLFW fixes to new bindings).

I've had nice success with GPU instances on AWS though. Depending on your needs, it might not be too expensive to fire up the instance, run your workload, bring it down again. This can be scripted and should be pretty painless.

Re: AWS environment/OpenGL difficulties
« Reply #2 on: November 29, 2016, 14:13:32 »
I'll take that as an authoritative answer. :) And I'm using LWJGL 2 right now; using LWJGL 3 would require a minor rewrite of the code.

Unfortunately, this is for a web application that needs 24/7 uptime. Long story short, this is part of model analysis of 3d files that rapidly figures out how much it'll cost to produce on a 3d printer, for online quoting and ordering.

So my options are to remain on Windows or put up for the more expensive GPU instance. At least I know that now. :)

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: AWS environment/OpenGL difficulties
« Reply #3 on: November 30, 2016, 17:35:44 »

Re: AWS environment/OpenGL difficulties
« Reply #4 on: November 30, 2016, 19:00:24 »
Wow, nice.

So now I just need to figure out how to configure an EC2 GPU instance with an active DISPLAY that LWJGL plays nice with. So far, failing miserably.

Re: AWS environment/OpenGL difficulties
« Reply #5 on: December 16, 2016, 20:49:35 »
Hey, follow-up:

I did manage to get LWJGL 2.9.3 to work in a Linux headless (non-GPU) environment.

Installing Xvfb and X11 xserver utils are all you need, and it will render images.

Yay!