question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PyBullet GUI problem on Ubuntu 18 with NVIDIA driver

See original GitHub issue

Describe the bug Same as #41. Installation steps are applied properly.

Trying to run fly.py.

stavrako@stavrako:~/gym-pybullet-drones/examples$ python3 fly.py pybullet build time: May 14 2021 14:07:06 [INFO] BaseAviary.init() loaded parameters from the drone’s .urdf: [INFO] m 0.027000, L 0.039700, [INFO] ixx 0.000014, iyy 0.000014, izz 0.000022, [INFO] kf 0.000000, km 0.000000, [INFO] t2w 2.250000, max_speed_kmh 30.000000, [INFO] gnd_eff_coeff 11.368590, prop_radius 0.023135, [INFO] drag_xy_coeff 0.000001, drag_z_coeff 0.000001, [INFO] dw_coeff_1 2267.180000, dw_coeff_2 0.160000, dw_coeff_3 -0.110000 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! Creating context Created GL 3.3 context Direct GLX rendering context obtained Making context current GL_VENDOR=NVIDIA Corporation GL_RENDERER=GeForce MX110/PCIe/SSE2 GL_VERSION=3.3.0 NVIDIA 460.73.01 GL_SHADING_LANGUAGE_VERSION=3.30 NVIDIA via Cg compiler pthread_getconcurrency()=0 Version = 3.3.0 NVIDIA 460.73.01 Vendor = NVIDIA Corporation Renderer = GeForce MX110/PCIe/SSE2 b3Printf: Selected demo: Physics Server startThreads creating 1 threads. starting thread 0 started thread 0 MotionThreadFunc thread started viewMatrix (-0.8660253882408142, -0.2499999701976776, 0.4330126941204071, 0.0, 0.0, 0.8660253286361694, 0.4999999701976776, 0.0, -0.4999999701976776, 0.4330126643180847, -0.75, 0.0, -0.0, 5.960464477539063e-08, -2.999999761581421, 1.0) projectionMatrix (1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0000200271606445, -1.0, 0.0, 0.0, -0.02000020071864128, 0.0) /home/stavrako/.local/lib/python3.6/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32 warnings.warn(colorize(β€˜%s: %s’%(β€˜WARN’, msg % args), β€˜yellow’)) ven = NVIDIA Corporation ven = NVIDIA Corporation

[INFO] BaseAviary.render() β€”β€”β€” it 0005 β€”β€”β€” wall-clock time 1.5s, simulation time 0.0s@240Hz (0.01x) [INFO] BaseAviary.render() β€”β€”β€” drone 0 β€”β€”β€” x +00.00, y +00.00, z +00.10 β€”β€”β€” velocity +00.00, +00.00, +00.00 β€”β€”β€” roll +00.00, pitch -00.00, yaw +00.00 β€”β€”β€” angular velocity +0.0000, +0.0000, +0.0000 β€”β€”β€” [INFO] BaseAviary.render() β€”β€”β€” drone 1 β€”β€”β€” x -00.26, y -00.15, z +00.15 β€”β€”β€” velocity +00.00, +00.00, +00.00 β€”β€”β€” roll -00.00, pitch -00.00, yaw +30.00 β€”β€”β€” angular velocity +0.0000, +0.0000, +0.0000 β€”β€”β€” [INFO] BaseAviary.render() β€”β€”β€” drone 2 β€”β€”β€” x -00.26, y -00.45, z +00.20 β€”β€”β€” velocity +00.00, +00.00, +00.00 β€”β€”β€” roll -00.00, pitch -00.00, yaw +60.00 β€”β€”β€” angular velocity +0.0000, +0.0000, +0.0000 β€”β€”β€”

…

numActiveThreads = 0 stopping threads Thread with taskId 0 exiting Thread TERMINATED destroy semaphore semaphore destroyed destroy main semaphore main semaphore destroyed finished numActiveThreads = 0 btShutDownExampleBrowser stopping threads Thread with taskId 0 exiting Thread TERMINATED destroy semaphore semaphore destroyed destroy main semaphore main semaphore destroyed

image

To Reproduce Steps to reproduce the behavior: Running fly.py

Expected behavior 1.

I run a minimal example that has been referred in #41

import pybullet as p
import pybullet_data
from time import sleep

def main():
    PYB_CLIENT = p.connect(p.GUI)
    p.setGravity(0, 0, -9.8, physicsClientId=PYB_CLIENT)
    p.setRealTimeSimulation(0, physicsClientId=PYB_CLIENT)
    p.setTimeStep(1/240, physicsClientId=PYB_CLIENT)
    p.setAdditionalSearchPath(pybullet_data.getDataPath(), physicsClientId=PYB_CLIENT)
    p.loadURDF("plane.urdf", physicsClientId=PYB_CLIENT)
    p.loadURDF("duck_vhacd.urdf", [0, 0, 1], physicsClientId=PYB_CLIENT)
    for _ in range(240*10):
        p.stepSimulation(physicsClientId=PYB_CLIENT)
        sleep(1/(240*10))

if __name__ == "__main__":
    main()

image

  1. β€œreplace p.connect(p.GUI) with p.connect(p.GUI, options=”–opengl2")" didn’t work as well.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Software Python 3.6
 stavrako@stavrako:~$ glxinfo | grep "OpenGL version"
OpenGL version string: 4.6.0 NVIDIA 460.73.01
stavrako@stavrako:~$ glxinfo | grep 'version'
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 4.6.0 NVIDIA 460.73.01
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 460.73.01
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 460.73.01
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    GL_EXT_shader_group_vote, GL_EXT_shader_implicit_conversions, 
stavrako@stavrako:~$ nvidia-smi
Tue May 18 19:18:46 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.73.01    Driver Version: 460.73.01    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce MX110       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P0    N/A /  N/A |    136MiB /  2004MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      5480      G   /usr/lib/xorg/Xorg                 88MiB |
|    0   N/A  N/A      5642      G   /usr/bin/gnome-shell               44MiB |
+-----------------------------------------------------------------------------+

Additional context I have tried Windows and it works fine there.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
JacopoPancommented, May 18, 2021

Thanks @stavrako,

I’d suspect this to be an issue arising directly from PyBullet / OpenGL when using Ubuntu and NVIDIA GPUs. I normally work on macOS (and I’m glad Windows works fine too) but I will look into this when I can.

1reaction
JacopoPancommented, May 20, 2021

Thanks for confirming that @lampidis. If you happen to find a way to replicate the problem in the minimal example, I’d try to fix it (or at least understand the cause).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Graphics and resolution problems (Nvidia) in Ubuntu 18.04 ...
I have tried many different drivers, and have rebooted after each change. I still can't change resolution, and xrandr still says: "Failed to...
Read more >
Pybullet not rendering correctly - Real-Time Physics ...
Am currently experiencing issues getting PyBullet to render meshes ... -Dual booted into Ubuntu 18, installed Pybullet (on a python 3.6 env)Β ...
Read more >
Unable to start xorg/gdm on ubuntu 18.04 with nvidia drivers ...
I'm running ubuntu 18.04 with 4.15.0-20-generic kernel on the same ... ubuntu 18.04 in legacy as NVIDIA drivers have problems with UEFI.
Read more >
Running X11 software in LXD containers - Mi blog lah!
This error is on permission denied when trying to run GPU-accelerated applications in an (unprivileged) container as user ubuntu . libGL error:Β ...
Read more >
How to use OpenGL on top of SSH? - linux - Stack Overflow
The remote computer has an NVIDIA RTX 2070 GPU card with 410 drivers. xlogo works fine. A quick test gives me the error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found