I want to run headless on a VPS, running Ubuntu Linux. So no GPU.
It is running vncserver as the display server
SDK works, but I get an exception trying to run the simple HelloWorld example.
It appears LWJGL is not recognizing a Virtual GPU and connecting to vncserver display
Caused by: java.lang.RuntimeException: org.lwjgl.LWJGLException: No modes available
I know it is probably a long shot, but anyone else try to do this?
I tried various simple tools-options-opengl buttons. No luck.
Thanks!
---- ERROR—
INFO: Running on jMonkeyEngine 3.2-stable
Branch: HEAD
Git Hash: 8291d61
Build Date: 2019-07-27
Aug 15, 2019 4:43:34 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.ExceptionInInitializerError
at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:112)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:113)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: org.lwjgl.LWJGLException: No modes available
at org.lwjgl.opengl.Display.(Display.java:141)
… 4 more
Caused by: org.lwjgl.LWJGLException: No modes available
at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:740)
at org.lwjgl.opengl.Display.(Display.java:138)
… 4 more
Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread “jME3 Main”
Let’s step back and do some basic troubleshooting before we worry about the JME stuff.
Can you successfully run glxgears with your setup?
If not, that’s the first thing to take care of. You do need to have OpenGL available for JME to work the way you are hoping, so your VPS must have a GL-capable GPU, even if it is a virtual GPU shared with other tenants on the hardware.
I’m slightly more confused as to what you’re trying to achieve. Servers are usually providers of data, and the engine is usually a visual representation of that data.
Are you sure you even want the engine running on the server?
I guess he wants to work(?) on a remote VPS using VNC Server.
The Problem is that the Server doesn’t provide any Hardware Acceleration, so also glxinfo shouldn’t work and everything, because there is no GPU (“virtual GPU” here is actually the CPU).
This however does no rendering and you won’t see anything via vnc but a console window. You don’t actually need VNC for this, ssh is enough.
What is it that you are trying to achieve? Because for a multiplayer game you better start developing locally first (sim-eth-es as the most complex example).
BTW: The SDK also only works partially, opening a model will crash just the same
First, thanks for the replies, and sorry it was not clear.
I am doing a multi-player real time strategy game.
The main user client will have full 3D graphics running on a PC/Mac desktop.
A persistent server will be on a VPS in the cloud.
Yes, I do intend for the server to have graphics!
But really just limited 2D, for debug.
I want an overview map, entity state, and a couple of other things.
Prefer not to debug through client, or through text log files.
The likely server alternative is to run simple NetBeans and X11 graphics.
But obviously it would be much better if both server and client ran the
same language, SDK, libraries, and so on.
As background, the game is about 1/10 coded (1/100 done), but using
Unity/C# for client, and X11/C++ for server. Switching to Java.
–
I think @sailsman63 has it correct - go back to basic troubleshooting.
I was using X11, not OpenGL before. It might not be set up correctly.
Will do that first.
glxgears does work.
gears show up and rotate nicely
GL_RENDERER = Mesa GLX Indirect
glxinfo does work
16 bit depth only rgb-655
I did match that on JME
direct rendering: No
(expected)
BUT : I tried a simple C++ opengl code, and it failed.
freeglut is not working either.
ERROR: Internal error in function fgOpenWindow
And looks like others have hit similar issues.
Not directly LWJGL related though.
Really no offense meant!
Maybe take a look at @pspeed examples for network related games, with and without zay-es (ECS is another story, also worth it and cuts down development effort by factors!). I don’t have the links to the examples at my finger tips, but google for sim-eth-es, might lead you in the right direction.
And yes like any other client server software, I highly suggest to split that, you can of course use the same IDE as it is all java (or I didn’t get that point correctly maybe).
You CAN use jme on the server (so all your points work), but you may have to think about the “debug” methology.
You don’t need to use jme’s lwjgl stuff (openGL for that matter) to draw 2D Stuff, use Swing instead.
Debugging doesn’t need openGL. As I said most debugging should happen when you run the server locally and connect to it locally. Apart from that there is “real” java debugging over TCP, so you don’t need any graphics. Apart from that you could even use “debugging” over the console, so you don’t even need X11 and all that stuff.
So that’s where you’re doing “useless” work. Also think of the future of your game: You don’t want everyone to need a real gpu just to run your game server. noone wants that. You could even think about a website to debug.
The client doesn’t actually use JME to display anything, but it does create a connection, join and close it, so it’s pretty easy to create a GUI yourself and connect with that.