google-research / ravens

Train robotic agents to learn pick and place with deep learning for vision-based manipulation in PyBullet. Transporter Nets, CoRL 2020.
https://transporternets.github.io
Apache License 2.0
538 stars 93 forks source link

Add option to use EGL rendering for Linux systems when `disp=False`. #14

Closed kevinzakka closed 2 years ago

kevinzakka commented 3 years ago

By default, the Environment class was using openGL hardware accelerated rendering. By switching to EGL rendering if using a Linux system, you can get an approximately 10x speedup in each call to the env.step method (9.83x to be precise.) This patch also fixes a visual bug in the spatula URDF which was missing a material definition.

Tested on my Ubuntu 20.04 machine with a RTX 2080ti:

Renderer Mean Std dev
Default openGL 0.2252595923267878 0.03675561883686646
EGL 0.02291664930695262 0.0037472464227214205

Speedup = 9.83x

kevinzakka commented 2 years ago

@ayzaan Would be awesome if this could get this merged!

ayzaan commented 2 years ago

Hi Kevin, yes when I tried running this internally it didn't work out of the box. I can take a look again and see if I can get it running properly.

kevinzakka commented 2 years ago

@ayzaan Done, made a separate PR for the spatula bugfix #18 .