minerllabs / minerl

MineRL Competition for Sample Efficient Reinforcement Learning - Python Package
http://minerl.io/docs/
Other
711 stars 153 forks source link

Wslg fails to run MineRL - Windows 11/ Wsl/ wslg - Ubuntu-20.04 #614

Closed gl33mer closed 2 years ago

gl33mer commented 2 years ago

On Windows 11 - graphical applications are supposed to work out of the box using Wslg.

I've just installed Windows 11 - specifically for that reason as I have been failing to run MineRL on Windows 10 machines (using Wsl 2 and all the different methods mentioned in the different threads).

So, on the Windows 11 machine - When I run xeyes - it runs fine and window shows up.

When I run MineRl - I get the same errors:

/home/shva/.local/lib/python3.8/site-packages/gym/logger.py:34: UserWarning: WARN: Box bound precision lowered by casting to float32
  warnings.warn(colorize("%s: %s" % ("WARN", msg % args), "yellow"))
INFO:minerl.env.malmo.instance.0f80fc:Starting Minecraft process: ['/tmp/tmprzdq48oj/Minecraft/launchClient.sh', '-port', '10831', '-env', '-runDir', '/tmp/tmprzdq48oj/Minecraft/run']
INFO:process_watcher:Launhing process watcher daemonizer.
/home/shva/.local/lib/python3.8/site-packages/gym/logger.py:34: UserWarning: WARN: Box bound precision lowered by casting to float32
  warnings.warn(colorize("%s: %s" % ("WARN", msg % args), "yellow"))
/usr/lib/python3.8/runpy.py:127: RuntimeWarning: 'minerl.utils.process_watcher' found in sys.modules after import of package 'minerl.utils', but prior to execution of 'minerl.utils.process_watcher'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
INFO:process_watcher:Process watcher daemonizer launched successfully.
DEBUG:minerl.env.malmo.instance.0f80fc:/tmp/tmprzdq48oj/Minecraft
DEBUG:minerl.env.malmo.instance.0f80fc:# Configuration file
DEBUG:minerl.env.malmo.instance.0f80fc:# Autogenerated from command-line options
DEBUG:minerl.env.malmo.instance.0f80fc:
DEBUG:minerl.env.malmo.instance.0f80fc:malmoports {
DEBUG:minerl.env.malmo.instance.0f80fc:  I:portOverride=10831
DEBUG:minerl.env.malmo.instance.0f80fc:}
DEBUG:minerl.env.malmo.instance.0f80fc:malmoscore {
DEBUG:minerl.env.malmo.instance.0f80fc:  I:policy=0
DEBUG:minerl.env.malmo.instance.0f80fc:}
DEBUG:minerl.env.malmo.instance.0f80fc:
DEBUG:minerl.env.malmo.instance.0f80fc:malmoperformance {
DEBUG:minerl.env.malmo.instance.0f80fc:  I:outDir=NONE
DEBUG:minerl.env.malmo.instance.0f80fc:}
DEBUG:minerl.env.malmo.instance.0f80fc:
DEBUG:minerl.env.malmo.instance.0f80fc:malmoseed {
DEBUG:minerl.env.malmo.instance.0f80fc:  I:seed=NONE
DEBUG:minerl.env.malmo.instance.0f80fc:}
DEBUG:minerl.env.malmo.instance.0f80fc:
DEBUG:minerl.env.malmo.instance.0f80fc:runtype {
DEBUG:minerl.env.malmo.instance.0f80fc:  B:replaceable=true
DEBUG:minerl.env.malmo.instance.0f80fc:}
DEBUG:minerl.env.malmo.instance.0f80fc:
DEBUG:minerl.env.malmo.instance.0f80fc:envtype {
DEBUG:minerl.env.malmo.instance.0f80fc:  B:env=true
DEBUG:minerl.env.malmo.instance.0f80fc:}
DEBUG:minerl.env.malmo.instance.0f80fc:
DEBUG:minerl.env.malmo.instance.0f80fc:/tmp/tmprzdq48oj/Minecraft/run
DEBUG:minerl.env.malmo.instance.0f80fc:
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Extra: []
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Found and added coremod: com.microsoft.Malmo.OverclockingPlugin
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Running with arguments: [--userProperties, {}, --assetsDir, /tmp/tmprzdq48oj/Minecraft/run/gradle/caches/minecraft/assets, --assetIndex, 1.11, --accessToken{REDACTED}, --version, 1.11.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, com.microsoft.Malmo.Launcher.tweakers.CoremodTweaker]
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Loading tweak class name com.microsoft.Malmo.Launcher.tweakers.CoremodTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Forge Mod Loader version 13.20.1.2588 for Minecraft 1.11.2 loading
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Java is OpenJDK 64-Bit Server VM, version 1.8.0_312, running on Linux:amd64:5.10.16.3-microsoft-standard-WSL2, installed at /usr/lib/jvm/java-8-openjdk-amd64/jre
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/INFO]: Found a command line coremod : com.microsoft.Malmo.OverclockingPlugin
WARNING:minerl.env.malmo.instance.0f80fc:[14:20:22] [main/WARN]: The coremod com.microsoft.Malmo.OverclockingPlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:33] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.7.5 Source=file:/tmp/tmprzdq48oj/Minecraft/build/libs/MalmoMod-0.37.0-fat.jar Service=LaunchWrapper Env=CLIENT
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Compatibility level set to JAVA_8
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Calling tweak class com.microsoft.Malmo.Launcher.tweakers.CoremodTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Injecting location in coremod com.microsoft.Malmo.OverclockingPlugin
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Loading tweak class name org.spongepowered.asm.mixin.EnvironmentStateTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Loading tweak class name com.microsoft.Malmo.Launcher.tweakers.AccessTransformerTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
ERROR:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/ERROR]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
ERROR:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/ERROR]: FML appears to be missing any signature data. This is not a good thing
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Calling tweak class org.spongepowered.asm.mixin.EnvironmentStateTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Initialised Mixin FML Remapper Adapter with net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper@1edb61b1
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:38] [main/INFO]: Calling tweak class com.microsoft.Malmo.Launcher.tweakers.AccessTransformerTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:38] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:38] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
WARNING:minerl.env.malmo.instance.0f80fc:[14:20:38] [main/WARN]: Reference map 'mixins.malmo.refmap.json' for mixins.overclocking.malmomod.json could not be read. If this is a development environment you can ignore this message
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:38] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:39] [main/INFO]: [com.microsoft.Malmo.OverclockingClassTransformer:insertTextureHandler:120]: MALMO: Found GlStateManager, attempting to transform it
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:39] [main/INFO]: [com.microsoft.Malmo.OverclockingClassTransformer:insertTextureHandler:126]: MALMO: Found GlStateManager.bindTexture() method, attempting to transform it
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:39] [main/INFO]: [com.microsoft.Malmo.OverclockingClassTransformer:insertTextureHandler:139]: MALMO: Hooked into call to GlStateManager.bindTexture()
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:39] [main/INFO]: A re-entrant transformer '$wrapper.com.microsoft.Malmo.OverclockingClassTransformer' was detected and will no longer process meta class data
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:39] [main/INFO]: [com.microsoft.Malmo.OverclockingClassTransformer:transform:42]: Transformed Name: net.minecraft.client.entity.EntityPlayerSP
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:39] [main/INFO]: [com.microsoft.Malmo.OverclockingClassTransformer:transform:42]: Transformed Name: net.minecraft.client.entity.AbstractClientPlayer
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:41] [Client thread/INFO]: Setting user: Player598
WARNING:minerl.env.malmo.instance.0f80fc:[14:20:46] [Client thread/WARN]: Skipping bad option: lastServer:
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:46] [Client thread/INFO]: LWJGL Version: 2.9.4
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:46] [Client thread/INFO]: [STDOUT]: MALMO: Found GlStateManager, attempting to transform it
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:46] [Client thread/INFO]: [STDOUT]: MALMO: Found GlStateManager.bindTexture() method, attempting to transform it
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:46] [Client thread/INFO]: [STDOUT]: MALMO: Hooked into call to GlStateManager.bindTexture()
DEBUG:minerl.env.malmo.instance.0f80fc:[14:20:46] [Client thread/INFO]: [net.minecraft.init.Bootstrap:printToSYSOUT:523]: ---- Minecraft Crash Report ----
DEBUG:minerl.env.malmo.instance.0f80fc:// Shall we play a game?
DEBUG:minerl.env.malmo.instance.0f80fc:
DEBUG:minerl.env.malmo.instance.0f80fc:Time: 2/10/22 2:20 PM
DEBUG:minerl.env.malmo.instance.0f80fc:Description: Initializing game
DEBUG:minerl.env.malmo.instance.0f80fc:
ERROR:minerl.env.malmo.instance.0f80fc:java.lang.ExceptionInInitializerError
DEBUG:minerl.env.malmo.instance.0f80fc: at net.minecraft.client.Minecraft.setWindowIcon(Minecraft.java:629)
DEBUG:minerl.env.malmo.instance.0f80fc: at net.minecraft.client.Minecraft.init(Minecraft.java:429)
DEBUG:minerl.env.malmo.instance.0f80fc: at net.minecraft.client.Minecraft.run(Minecraft.java:352)
DEBUG:minerl.env.malmo.instance.0f80fc: at net.minecraft.client.main.Main.main(SourceFile:124)
DEBUG:minerl.env.malmo.instance.0f80fc: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DEBUG:minerl.env.malmo.instance.0f80fc: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
DEBUG:minerl.env.malmo.instance.0f80fc: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
DEBUG:minerl.env.malmo.instance.0f80fc: at java.lang.reflect.Method.invoke(Method.java:498)
DEBUG:minerl.env.malmo.instance.0f80fc: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
DEBUG:minerl.env.malmo.instance.0f80fc: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
DEBUG:minerl.env.malmo.instance.0f80fc: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DEBUG:minerl.env.malmo.instance.0f80fc: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
DEBUG:minerl.env.malmo.instance.0f80fc: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
DEBUG:minerl.env.malmo.instance.0f80fc: at java.lang.reflect.Method.invoke(Method.java:498)
DEBUG:minerl.env.malmo.instance.0f80fc: at com.microsoft.Malmo.Launcher.GradleStartCommon.launch(GradleStartCommon.java:98)
DEBUG:minerl.env.malmo.instance.0f80fc: at com.microsoft.Malmo.Launcher.GradleStart.main(GradleStart.java:27)
ERROR:minerl.env.malmo.instance.0f80fc:Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
DEBUG:minerl.env.malmo.instance.0f80fc: at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:951)
DEBUG:minerl.env.malmo.instance.0f80fc: at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
Traceback (most recent call last):
  File "Navigate_1.py", line 8, in <module>
    obs = env.reset()
  File "/home/shva/.local/lib/python3.8/site-packages/gym/wrappers/time_limit.py", line 27, in reset
    return self.env.reset(**kwargs)
  File "/home/shva/.local/lib/python3.8/site-packages/minerl/env/_singleagent.py", line 22, in reset
    multi_obs = super().reset()
  File "/home/shva/.local/lib/python3.8/site-packages/minerl/env/_multiagent.py", line 455, in reset
    self._setup_instances()
  File "/home/shva/.local/lib/python3.8/site-packages/minerl/env/_multiagent.py", line 556, in _setup_instances
    self.instances.extend([f.result() for f in instance_futures])
  File "/home/shva/.local/lib/python3.8/site-packages/minerl/env/_multiagent.py", line 556, in <listcomp>
    self.instances.extend([f.result() for f in instance_futures])
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/shva/.local/lib/python3.8/site-packages/minerl/env/_multiagent.py", line 807, in _get_new_instance
    instance.launch(replaceable=self._is_fault_tolerant)
  File "/home/shva/.local/lib/python3.8/site-packages/minerl/env/malmo.py", line 518, in launch
    _check_for_launch_errors(line)
  File "/home/shva/.local/lib/python3.8/site-packages/minerl/env/malmo.py", line 817, in _check_for_launch_errors
    raise RuntimeError(
RuntimeError: ERROR! MineRL could not detect an X Server, Monitor, or Virtual Monitor!

In order to run minerl environments WITHOUT A HEAD use a software renderer such as 'xvfb':
                xvfb-run python3 <your_script.py>
        ! NOTE: xvfb conflicts with NVIDIA-drivers!
        ! To run headless MineRL on a system with NVIDIA-drivers, please start a
        ! vnc server of your choosing and then `export DISPLAY=:<insert ur vnc server #>

If you're receiving this error and there is a monitor attached, make sure your current displayvariable is set correctly:
                 DISPLAY=:0 python3 <your_script.py>
        ! NOTE: For this to work your account must be logged on the physical monitor.

If none of these steps work, please complain in the discord!
If all else fails, JUST PUT THIS IN A DOCKER CONTAINER! :)

Trying to run through xvfb-run, etc. doesn't make a difference.

Has anyone managed to get MineRL to run out of the box on WSLg?

Thank you.

gl33mer commented 2 years ago

This seems to have been solved by installing the latest Nvidia drivers on the WSL instance.

yunfanjiang commented 2 years ago

Hi, so what version of Nvidia driver did you finally installed?

gl33mer commented 2 years ago

I tried a few different things - so I'm not certain this is what did the trick.

But. It was -sudo apt install nvidia-driver-455