Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

black window while running in wsl2 #102

Open
Controlist20 opened this issue Dec 19, 2024 · 14 comments
Open

black window while running in wsl2 #102

Controlist20 opened this issue Dec 19, 2024 · 14 comments

Comments

@Controlist20
Copy link

Controlist20 commented Dec 19, 2024

Hi I was trying to run the simplest example that you shared in Hello Genesis. It is running but it is a black window. I tested my opengl with another simple script, it was running without any issue.

image

image

@urish
Copy link

urish commented Dec 19, 2024

Try:

export PYOPENGL_PLATFORM=glx

@orioljim1
Copy link

This does not work for me can you share which version of PYOPENGL and PyOpenGL_accelerate are you running? @urish
Thanks!

@urish
Copy link

urish commented Dec 19, 2024

$ pip freeze | grep -i pyopengl
PyOpenGL==3.1.7

about PyOpenGL_accelerate - I don't think I have it installed

@Controlist20
Copy link
Author

Try:

export PYOPENGL_PLATFORM=glx

Thanks for quick response. Initially opengl did not work at all. I created launch file for export PYOPENGL_PLATFORM=gle. Then it started running but the window was black as I shared. I decrease the max FPS. It is running now but not efficient. I will try it on my other pc with nvidia gpu.

@meijie-jesse
Copy link

meijie-jesse commented Dec 20, 2024

I meet this problem too, in VMware ubuntu20. but in the black window, it shows "[i] show keyboard instructions", which i can triger by keyboad and shows menus.

@RRGGZZ
Copy link

RRGGZZ commented Dec 20, 2024

I also encountered the same problem in WSL2, and the window remained black.

@chenqiguo
Copy link

I met with the same problem with black window when running the hello_genesis, on ubuntu22.

@chenqiguo
Copy link

I met with the same problem with black window when running the hello_genesis, on ubuntu22.

Decreasing the max_FPS to 30 or 20 solve the problem but very inefficient

@meijie-jesse
Copy link

I met with the same problem with black window when running the hello_genesis, on ubuntu22.

Decreasing the max_FPS to 30 or 20 solve the problem but very inefficient

Thanks, I tried 40、30、20 but it not work. I successfully run it by switching to the physical machine, not vmware or wsl2.

@RRGGZZ
Copy link

RRGGZZ commented Dec 20, 2024

This project does not appear to run properly in the virtual machine

@AgentOfLyra
Copy link

image
Very, very slow, very stuck

@aidinism
Copy link

Same here. It runs, and the debug says it's at ~60 FPS, but the GUI is super slow at ~1 FPS.
It's the same on CPU or CUDA/GPU.
Interestingly, it was fine before the latest commit.

image
image

@myamazum
Copy link

myamazum commented Jan 5, 2025

hi, guys. I met same problems in my New year holidays.
Finally I found a solution in my case. (llvmpipe error I guess)

situation : tutorial / hello_genesis.py running in docker on wsl2.
HW : laptop ryzen 7 (with AMD Grafic card) and Geforce RTX 3050 : two graphic card cause a problem in wsl2/docker.

  1. Library linker is complex in new wsl2, if driver was instaled in Windows 11.
    Nvidia driver lay in /usr/lib/wsl/lib, not installed in default settings.
    Add drivers link in LD_LIBRARY_PATH.
  2. Dockerfile in Genesis doesn't refer previous directory, so that you should add volume link in the Dockerfile.
  3. Genesis uses mesa library but it's difficult to find nvidia driver if there are two graphic library.
    Add MESA_D3D12_DEFAULT_ADAPTER_NAME="NVIDIA"
docker run --gpus all --rm -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix -v $PWD:/workspace -v /usr/lib/wsl:/usr/lib/wsl genesis
export LD_LIBRARY_PATH=/usr/lib/wsl/lib:LD_LIBRARY_PATH
export MESA_D3D12_DEFAULT_ADAPTER_NAME="NVIDIA"
python examples/tutorials/hello_genesis.py
  1. check settings using mesa-utils.

Following status is correct.
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Microsoft Corporation (0xffffffff)
Device: D3D12 (NVIDIA GeForce RTX 3050 Laptop GPU) (0xffffffff)

apt update && apt install mesa-utils
glxinfo -B

Reference
microsoft/WSL#7507 (comment)
https://qiita.com/matttchan/items/5d6eb8f54640e01b9154

Sincerely

@hongbo-miao
Copy link

hongbo-miao commented Jan 17, 2025

I met same issue. I do need export PYOPENGL_PLATFORM=glx to get it work.

However, export LD_LIBRARY_PATH=/usr/lib/wsl/lib is a workaround solution. The root issue is incorrect driver got installed in WSL2 causing this device not found issue. I posted the detail at https://stackoverflow.com/a/79357542/2000548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants