0

I am trying to get PyBullet to work on my WSL2 installation of Ubuntu 22.04 with an Nvidia GTX 1050Ti. When I run p.connect(p.GUI), the execution fails with the following output:

startThreads creating 1 threads.
starting thread 0
started thread 0
argc=2
argv[0] = --unused
argv[1] = --start_demo_name=Physics Server
ExampleBrowserThreadFunc started
X11 functions dynamically loaded using dlopen/dlsym OK!
X11 functions dynamically loaded using dlopen/dlsym OK!
libGL error: MESA-LOADER: failed to open swrast: /home/dkapur17/anaconda3/envs/drl/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-15.so.1) (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
Creating context
Failed to create GL 3.3 context ... using old-style GLX context
Failed to create an OpenGL context

Following is the output of glxinfo -B:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (NVIDIA GeForce GTX 1050 Ti) (0xffffffff)
    Version: 23.0.4
    Accelerated: yes
    Video memory: 12132MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.2
    Max compat profile version: 4.2
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce GTX 1050 Ti)
OpenGL core profile version string: 4.2 (Core Profile) Mesa 23.0.4-0ubuntu1~22.04.1
OpenGL core profile shading language version string: 4.20
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.2 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~22.04.1
OpenGL shading language version string: 4.20
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 23.0.4-0ubuntu1~22.04.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Programs like glxgears, gedit, and gimp all work.

genpfault
  • 51,148
  • 11
  • 85
  • 139
dkapur17
  • 476
  • 1
  • 3
  • 11
  • Can you provide more detail on how you have installed PyBullet? On Ubuntu 22.04, Python 3.10 is the default, and from what I can tell, PyBullet only has wheels built for up to Python 3.9. Did you "downgrade" (perhaps `pyenv`) your Python to 3.9? Or did you build PyBullet yourself? Thanks! – NotTheDr01ds Aug 14 '23 at 12:17
  • @NotTheDr01ds I installed `gym_pybullet_drones` by cloning the GitHub Repo and running `pip install -e .`, and that installed `pybullet 3.2.5` as a dependency. You are right, my current python environment is using Python 3.10.11. – dkapur17 Aug 14 '23 at 15:36
  • When you did `pip install -e .`, are you sure that it didn't download the PyBullet tarball and build the wheel from that? That's what it's attempting to do in my case (even with that repo). – NotTheDr01ds Aug 14 '23 at 18:45
  • Also, are you using Anaconda? – NotTheDr01ds Aug 14 '23 at 19:13

1 Answers1

0

Solved! Turns out it was a dependency issue, and had nothing to do with WSL. I installed the required dependencies using

conda install -c conda-forge libgcc=5.2.0
conda install -c anaconda libstdcxx-ng
conda install -c conda-forge gcc=12.1.0

And PyBullet started launching as expected.

dkapur17
  • 476
  • 1
  • 3
  • 11
  • 1
    Ah, I suspected you might be using Anaconda rather than stock Python. That's why I wasn't able to get it built (on 22.04, at least) to reproduce ;-). Deleting my answer ... – NotTheDr01ds Aug 15 '23 at 19:32