My collaborator and I have been working on an offscreen renderer that saves many panda3d scenes as a series of images. The goal is to create hundreds of thousands of these images as a large training dataset for some machine learning models.
Everything is working on our local machines, and we’re ready to “scale up” and start running on the cloud. As our playground we’ve chosen a weak AWS EC2 machine to start, but we’re running into graphics troubles.
Here was our troubleshooting breadcrumbs, and we were wondering if anyone could spot the potential problem. Our hypothesis is that our machine doesn’t have a graphics card, and hence why we’re running into these troubles?
Running our example script, we first ran into this error:
:display(warning): Unable to load libpandagl.so: libGL.so.1: cannot open shared object file: No such file or directory
:display(warning): Unable to load libp3headlessgl.so: libGL.so.1: cannot open shared object file: No such file or directory
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
File "sandbox/simple.py", line 66, in <module>
interface = pt.ShotViewer()
File "/home/ec2-user/pooltool/pooltool/ani/animate.py", line 227, in __init__
Interface.__init__(self, config=config)
File "/home/ec2-user/pooltool/pooltool/ani/animate.py", line 116, in __init__
super().__init__(self, windowType=config.window_type)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 341, in __init__
self.openDefaultWindow(startDirect = False, props=props)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 1026, in openDefaultWindow
self.openMainWindow(*args, **kw)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 1061, in openMainWindow
self.openWindow(*args, **kw)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 771, in openWindow
win = func()
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 751, in <lambda>
func = lambda : self._doOpenWindow(
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 823, in _doOpenWindow
self.makeDefaultPipe()
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 652, in makeDefaultPipe
self.notify.error(
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/directnotify/Notifier.py", line 130, in error
raise exception(errorString)
Exception: No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.
We were able to “solve” this error with the following command:
sudo yum install libglvnd-glx
Here is the installation:
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package libglvnd-glx.x86_64 1:1.0.1-0.1.git5baa1e5.amzn2.0.1 will be installed
--> Processing Dependency: libglvnd(x86-64) = 1:1.0.1-0.1.git5baa1e5.amzn2.0.1 for package: 1:libglvnd-glx-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64
--> Processing Dependency: mesa-libGL(x86-64) >= 13.0.4-1 for package: 1:libglvnd-glx-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64
--> Processing Dependency: libXext.so.6()(64bit) for package: 1:libglvnd-glx-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: 1:libglvnd-glx-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64
--> Processing Dependency: libGLdispatch.so.0()(64bit) for package: 1:libglvnd-glx-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64
--> Running transaction check
---> Package libX11.x86_64 0:1.6.7-3.amzn2.0.2 will be installed
--> Processing Dependency: libX11-common >= 1.6.7-3.amzn2.0.2 for package: libX11-1.6.7-3.amzn2.0.2.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.7-3.amzn2.0.2.x86_64
---> Package libXext.x86_64 0:1.3.3-3.amzn2.0.2 will be installed
---> Package libglvnd.x86_64 1:1.0.1-0.1.git5baa1e5.amzn2.0.1 will be installed
---> Package mesa-libGL.x86_64 0:18.3.4-5.amzn2.0.1 will be installed
--> Processing Dependency: mesa-libglapi = 18.3.4-5.amzn2.0.1 for package: mesa-libGL-18.3.4-5.amzn2.0.1.x86_64
--> Processing Dependency: libxshmfence.so.1()(64bit) for package: mesa-libGL-18.3.4-5.amzn2.0.1.x86_64
--> Processing Dependency: libglapi.so.0()(64bit) for package: mesa-libGL-18.3.4-5.amzn2.0.1.x86_64
--> Processing Dependency: libXxf86vm.so.1()(64bit) for package: mesa-libGL-18.3.4-5.amzn2.0.1.x86_64
--> Processing Dependency: libXfixes.so.3()(64bit) for package: mesa-libGL-18.3.4-5.amzn2.0.1.x86_64
--> Processing Dependency: libXdamage.so.1()(64bit) for package: mesa-libGL-18.3.4-5.amzn2.0.1.x86_64
--> Running transaction check
---> Package libX11-common.noarch 0:1.6.7-3.amzn2.0.2 will be installed
---> Package libXdamage.x86_64 0:1.1.4-4.1.amzn2.0.2 will be installed
---> Package libXfixes.x86_64 0:5.0.3-1.amzn2.0.2 will be installed
---> Package libXxf86vm.x86_64 0:1.1.4-1.amzn2.0.2 will be installed
---> Package libxcb.x86_64 0:1.12-1.amzn2.0.2 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.12-1.amzn2.0.2.x86_64
---> Package libxshmfence.x86_64 0:1.2-1.amzn2.0.2 will be installed
---> Package mesa-libglapi.x86_64 0:18.3.4-5.amzn2.0.1 will be installed
--> Running transaction check
---> Package libXau.x86_64 0:1.0.8-2.1.amzn2.0.2 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================
Installing:
libglvnd-glx x86_64 1:1.0.1-0.1.git5baa1e5.amzn2.0.1 amzn2-core 125 k
Installing for dependencies:
libX11 x86_64 1.6.7-3.amzn2.0.2 amzn2-core 606 k
libX11-common noarch 1.6.7-3.amzn2.0.2 amzn2-core 165 k
libXau x86_64 1.0.8-2.1.amzn2.0.2 amzn2-core 29 k
libXdamage x86_64 1.1.4-4.1.amzn2.0.2 amzn2-core 20 k
libXext x86_64 1.3.3-3.amzn2.0.2 amzn2-core 39 k
libXfixes x86_64 5.0.3-1.amzn2.0.2 amzn2-core 18 k
libXxf86vm x86_64 1.1.4-1.amzn2.0.2 amzn2-core 17 k
libglvnd x86_64 1:1.0.1-0.1.git5baa1e5.amzn2.0.1 amzn2-core 89 k
libxcb x86_64 1.12-1.amzn2.0.2 amzn2-core 216 k
libxshmfence x86_64 1.2-1.amzn2.0.2 amzn2-core 7.2 k
mesa-libGL x86_64 18.3.4-5.amzn2.0.1 amzn2-core 162 k
mesa-libglapi x86_64 18.3.4-5.amzn2.0.1 amzn2-core 45 k
Transaction Summary
==============================================================================================================================================================
Install 1 Package (+12 Dependent packages)
Total download size: 1.5 M
Installed size: 5.6 M
Is this ok [y/d/N]: y
Downloading packages:
(1/13): libX11-common-1.6.7-3.amzn2.0.2.noarch.rpm | 165 kB 00:00:00
(2/13): libX11-1.6.7-3.amzn2.0.2.x86_64.rpm | 606 kB 00:00:00
(3/13): libXau-1.0.8-2.1.amzn2.0.2.x86_64.rpm | 29 kB 00:00:00
(4/13): libXdamage-1.1.4-4.1.amzn2.0.2.x86_64.rpm | 20 kB 00:00:00
(5/13): libXext-1.3.3-3.amzn2.0.2.x86_64.rpm | 39 kB 00:00:00
(6/13): libXfixes-5.0.3-1.amzn2.0.2.x86_64.rpm | 18 kB 00:00:00
(7/13): libXxf86vm-1.1.4-1.amzn2.0.2.x86_64.rpm | 17 kB 00:00:00
(8/13): libglvnd-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64.rpm | 89 kB 00:00:00
(9/13): libglvnd-glx-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64.rpm | 125 kB 00:00:00
(10/13): libxcb-1.12-1.amzn2.0.2.x86_64.rpm | 216 kB 00:00:00
(11/13): libxshmfence-1.2-1.amzn2.0.2.x86_64.rpm | 7.2 kB 00:00:00
(12/13): mesa-libGL-18.3.4-5.amzn2.0.1.x86_64.rpm | 162 kB 00:00:00
(13/13): mesa-libglapi-18.3.4-5.amzn2.0.1.x86_64.rpm | 45 kB 00:00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 6.4 MB/s | 1.5 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libXau-1.0.8-2.1.amzn2.0.2.x86_64 1/13
Installing : libxcb-1.12-1.amzn2.0.2.x86_64 2/13
Installing : libX11-common-1.6.7-3.amzn2.0.2.noarch 3/13
Installing : libX11-1.6.7-3.amzn2.0.2.x86_64 4/13
Installing : libXext-1.3.3-3.amzn2.0.2.x86_64 5/13
Installing : libXfixes-5.0.3-1.amzn2.0.2.x86_64 6/13
Installing : libXdamage-1.1.4-4.1.amzn2.0.2.x86_64 7/13
Installing : libXxf86vm-1.1.4-1.amzn2.0.2.x86_64 8/13
Installing : 1:libglvnd-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 9/13
Installing : libxshmfence-1.2-1.amzn2.0.2.x86_64 10/13
Installing : mesa-libglapi-18.3.4-5.amzn2.0.1.x86_64 11/13
Installing : 1:libglvnd-glx-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 12/13
Installing : mesa-libGL-18.3.4-5.amzn2.0.1.x86_64 13/13
Verifying : mesa-libGL-18.3.4-5.amzn2.0.1.x86_64 1/13
Verifying : libXext-1.3.3-3.amzn2.0.2.x86_64 2/13
Verifying : libX11-1.6.7-3.amzn2.0.2.x86_64 3/13
Verifying : mesa-libglapi-18.3.4-5.amzn2.0.1.x86_64 4/13
Verifying : libxshmfence-1.2-1.amzn2.0.2.x86_64 5/13
Verifying : 1:libglvnd-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 6/13
Verifying : libXxf86vm-1.1.4-1.amzn2.0.2.x86_64 7/13
Verifying : libX11-common-1.6.7-3.amzn2.0.2.noarch 8/13
Verifying : 1:libglvnd-glx-1.0.1-0.1.git5baa1e5.amzn2.0.1.x86_64 9/13
Verifying : libXdamage-1.1.4-4.1.amzn2.0.2.x86_64 10/13
Verifying : libXfixes-5.0.3-1.amzn2.0.2.x86_64 11/13
Verifying : libXau-1.0.8-2.1.amzn2.0.2.x86_64 12/13
Verifying : libxcb-1.12-1.amzn2.0.2.x86_64 13/13
Installed:
libglvnd-glx.x86_64 1:1.0.1-0.1.git5baa1e5.amzn2.0.1
Dependency Installed:
libX11.x86_64 0:1.6.7-3.amzn2.0.2 libX11-common.noarch 0:1.6.7-3.amzn2.0.2 libXau.x86_64 0:1.0.8-2.1.amzn2.0.2
libXdamage.x86_64 0:1.1.4-4.1.amzn2.0.2 libXext.x86_64 0:1.3.3-3.amzn2.0.2 libXfixes.x86_64 0:5.0.3-1.amzn2.0.2
libXxf86vm.x86_64 0:1.1.4-1.amzn2.0.2 libglvnd.x86_64 1:1.0.1-0.1.git5baa1e5.amzn2.0.1 libxcb.x86_64 0:1.12-1.amzn2.0.2
libxshmfence.x86_64 0:1.2-1.amzn2.0.2 mesa-libGL.x86_64 0:18.3.4-5.amzn2.0.1 mesa-libglapi.x86_64 0:18.3.4-5.amzn2.0.1
Complete!
Running again, we got this error:
Known pipe types:
glxGraphicsPipe
(1 aux display modules not yet loaded.)
:display:x11display(error): Could not open display ":0.0".
:display(warning): Unable to load libp3headlessgl.so: libEGL.so.1: cannot open shared object file: No such file or directory
:ShowBase(warning): Unable to open 'offscreen' window.
Traceback (most recent call last):
File "sandbox/offscreen.py", line 90, in <module>
main(args)
File "sandbox/offscreen.py", line 14, in main
interface = pt.ImageSaver()
File "/home/ec2-user/pooltool/pooltool/ani/animate.py", line 324, in __init__
Interface.__init__(self, config=config)
File "/home/ec2-user/pooltool/pooltool/ani/animate.py", line 116, in __init__
super().__init__(self, windowType=config.window_type)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 341, in __init__
self.openDefaultWindow(startDirect = False, props=props)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 1026, in openDefaultWindow
self.openMainWindow(*args, **kw)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 1061, in openMainWindow
self.openWindow(*args, **kw)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 806, in openWindow
raise Exception('Could not open window.')
Exception: Could not open window.
We were able to “solve” this error with this command:
sudo yum install mesa-libEGL
Which ultimately led to this error:
Known pipe types:
glxGraphicsPipe
(1 aux display modules not yet loaded.)
:display:x11display(error): Could not open display ":0.0".
:display:egldisplay(warning): Couldn't initialize the default EGL display: EGL_NOT_INITIALIZED
:display:egldisplay(error): Failed to find or initialize a suitable EGL display connection.
:ShowBase(warning): Unable to open 'offscreen' window.
Traceback (most recent call last):
File "sandbox/offscreen.py", line 90, in <module>
main(args)
File "sandbox/offscreen.py", line 14, in main
interface = pt.ImageSaver()
File "/home/ec2-user/pooltool/pooltool/ani/animate.py", line 324, in __init__
Interface.__init__(self, config=config)
File "/home/ec2-user/pooltool/pooltool/ani/animate.py", line 116, in __init__
super().__init__(self, windowType=config.window_type)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 341, in __init__
self.openDefaultWindow(startDirect = False, props=props)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 1026, in openDefaultWindow
self.openMainWindow(*args, **kw)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 1061, in openMainWindow
self.openWindow(*args, **kw)
File "/home/ec2-user/miniconda3/envs/pooltool/lib/python3.8/site-packages/direct/showbase/ShowBase.py", line 806, in openWindow
raise Exception('Could not open window.')
Exception: Could not open window.
Based on this panda3d topic, our problem might be that our EC2 has no graphics card, but we aren’t sure and would like some clarification.
Getting some clarification on this would be super helpful. Thanks in advance!