tambetm / gym-minecraft

Minecraft environment for Open AI Gym, based on Microsoft's Malmo.
272 stars 29 forks source link

Server without GUI #12

Closed Nicolas99-9 closed 6 years ago

Nicolas99-9 commented 7 years ago

I'm trying to run the code on my server. There is no GUI so I have tried to use : xvfb-run -a -e /dev/stdout -s '-screen 0 1400x900x24' ./launchClient.sh

but I have the following error :

[10:38:41] [Client thread/INFO]: Setting user: Player620
[10:38:44] [Client thread/WARN]: Skipping bad option: lastServer:
[10:38:44] [Client thread/INFO]: LWJGL Version: 2.9.4
[10:38:44] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: ---- Minecraft Crash Report ----
// Would you like a cupcake?

Time: 6/22/17 10:38 AM
Description: Initializing game

java.lang.ExceptionInInitializerError
        at net.minecraft.client.Minecraft.setWindowIcon(Minecraft.java:670)
        at net.minecraft.client.Minecraft.init(Minecraft.java:467)
        at net.minecraft.client.Minecraft.run(Minecraft.java:387)
        at net.minecraft.client.main.Main.main(Main.java:118)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
        at GradleStart.main(GradleStart.java:26)
Caused by: java.lang.RuntimeException: org.lwjgl.LWJGLException: No display mode extension is available
> Building 95% > :runClient6 XSELINUXs still allocated at reset
SCREEN: 0 objects of 256 bytes = 0 total bytes 0 private allocs
DEVICE: 0 objects of 96 bytes = 0 total bytes 0 private allocs
CLIENT: 0 objects of 144 bytes = 0 total bytes 0 private allocs
WINDOW: 0 objects of 48 bytes = 0 total bytes 0 private allocs
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 4 objects of 16 bytes = 64 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 6 objects, 88 bytes, 0 allocs
1 PIXMAPs still allocated at reset
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 4 objects of 16 bytes = 64 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 6 objects, 88 bytes, 0 allocs
4 GCs still allocated at reset
GC: 4 objects of 16 bytes = 64 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 5 objects, 72 bytes, 0 allocs
1 CURSORs still allocated at reset
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 1 objects, 8 bytes, 0 allocs
1 CURSOR_BITSs still allocated at reset
TOTAL: 0 objects, 0 bytes, 0 allocs
[dix] Could not init font path element /usr/share/fonts/X11/cyrillic, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/100dpi/:unscaled, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/75dpi/:unscaled, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/100dpi, removing from list!
[dix] Could not init font path element /usr/share/fonts/X11/75dpi, removing from list!
        at org.lwjgl.opengl.Display.<clinit>(Display.java:141)
        ... 16 more
Caused by: org.lwjgl.LWJGLException: No display mode extension is available
        at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:737)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
        ... 16 more

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
        at net.minecraft.client.Minecraft.setWindowIcon(Minecraft.java:670)
        at net.minecraft.client.Minecraft.init(Minecraft.java:467)

-- Initialization --
Details:
Stacktrace:
        at net.minecraft.client.Minecraft.run(Minecraft.java:387)
        at net.minecraft.client.main.Main.main(Main.java:118)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
        at GradleStart.main(GradleStart.java:26)

-- System Details --
Details:
        Minecraft Version: 1.11.2
        Operating System: Linux (amd64) version 3.13.0-113-generic
        Java Version: 1.8.0_111, Oracle Corporation
        Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation
        Memory: 870902560 bytes (830 MB) / 1061683200 bytes (1012 MB) up to 1908932608 bytes (1820 MB)
        JVM Flags: 1 total; -Xmx2G
        IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
        FML: 
        Loaded coremods (and transformers): 
OverclockingPlugin (MalmoMod-0.30.0.jar)
  com.microsoft.Malmo.OverclockingClassTransformer
        Launched Version: 1.11.2
        LWJGL: 2.9.4
        OpenGL: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
        GL Caps: 
        Using VBOs: No
        Is Modded: Definitely; Client brand changed to 'fml,forge'
        Type: Client (map_client.txt)
        Resource Packs: 
        Current Language: ~~ERROR~~ NullPointerException: null
        Profiler Position: N/A (disabled)
        CPU: <unknown>
[10:38:44] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:600]: #@!@# Game crashed! Crash report saved to: #@!@# /home/nicolas/.pyenv/versions/main/lib/python2.7/site-packages/minecraft_py-0.0.2-py2.7.egg/Malmo-0.30.0-Linux-Ubuntu-14.04-64bit_withBoost/Minecraft/run/./crash-reports/crash-2017-06-22_10.38.44-client.txt
:runClient FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runClient'.
> Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 255

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 11.556 secs

How to run gym-minecraft on a server ?

tambetm commented 7 years ago

I think you might be missing some libraries on the server, maybe OpenGL?

Nicolas99-9 commented 7 years ago

I installed all the libraries... I connected my computer to the GPU server via ssh and then launched the command : xvfb-run -a -e /dev/stdout -s '-screen 0 1400x900x24' ./launchClient.sh Is there something special to install or to do to use the gym-minecraft without GUI ?

tambetm commented 6 years ago

Currently the Dockerfile is the most comprehensive documentation of what needs to be installed for Minecraft: https://github.com/tambetm/gym-minecraft/blob/master/docker/Dockerfile

You can also try running the Minecraft via Docker, see https://github.com/tambetm/gym-minecraft/wiki/Docker.