You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't know if this has been detailed before, but I have gotten spinningup to work on WSL2 on windows without needing to install a X server for X11 forwarding. If you didn't know, WSL2 has WSLg which allows for you to run GUI apps in WSL.
First make sure you have WSL2 enabled in your system, you can check by using: wsl -l -v in cmd/powershell. To upgrade to WSL2, issue the command wsl --set-version <distro name> 2 replacing <distro name> with the name of the distribution you want to upgrade.
Next, install the vGPU driver for Ubuntu by following this link here. At the time of this post, the cuda version was 11.8, this will be important later on.
Install miniconda by downloading the .sh from here. Personally, I use pyenv which you can check out here. If you run into any dependency issues creating your virtualenv you might need to find one with python=3.6 support.
Follow spinningup for the rest of the installation.
Here is where we need to potentially fix things. If you encounter no errors, then maybe the issues were patched out. However, when trying to watch the trained policy you might encounter this error:
ImportError:
Error occurred while running `from pyglet.gl import *`
HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'.
If you're running on a server, you may need a virtual frame buffer; something like this should work:
'xvfb-run -s "-screen 0 1400x900x24" python <your_script.py>'
To fix this issue, install an OpenGL library. The python-opengl library may not be present in your Ubuntu WSL distro, but you can install sudo apt install freeglut3-dev
You might also encounter another error:
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
Most likely this is due to the anaconda/miniconda install having too old of an GLIBCXX binary (even if your system has a new one). We can check this by exporting this variable: export LIBGL_DEBUG=verbose and running the command again. If we see:
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so: /home/dev/.pyenv/versions/miniconda3-latest/envs/su/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-13.so.1)
Then we can fix this by symlinking our systems GLIBCXX to conda distribution by executing:
Don't know if this has been detailed before, but I have gotten spinningup to work on WSL2 on windows without needing to install a X server for X11 forwarding. If you didn't know, WSL2 has WSLg which allows for you to run GUI apps in WSL.
First make sure you have WSL2 enabled in your system, you can check by using:
wsl -l -v
in cmd/powershell. To upgrade to WSL2, issue the commandwsl --set-version <distro name> 2
replacing<distro name>
with the name of the distribution you want to upgrade.Next, install the vGPU driver for Ubuntu by following this link here. At the time of this post, the cuda version was
11.8
, this will be important later on.Install miniconda by downloading the
.sh
from here. Personally, I use pyenv which you can check out here. If you run into any dependency issues creating your virtualenv you might need to find one withpython=3.6
support.Follow spinningup for the rest of the installation.
Here is where we need to potentially fix things. If you encounter no errors, then maybe the issues were patched out. However, when trying to watch the trained policy you might encounter this error:
To fix this issue, install an OpenGL library. The
python-opengl
library may not be present in your Ubuntu WSL distro, but you can installsudo apt install freeglut3-dev
You might also encounter another error:
Most likely this is due to the anaconda/miniconda install having too old of an GLIBCXX binary (even if your system has a new one). We can check this by exporting this variable:
export LIBGL_DEBUG=verbose
and running the command again. If we see:Then we can fix this by symlinking our systems GLIBCXX to conda distribution by executing:
If everything works you should see the training video when running the command again.
The text was updated successfully, but these errors were encountered: