Sorry about the confusion. I was checking if there was some other headless configuration that didn’t use X but was hardware accelerated, but I read your response more closely and it makes sense now. Thank you!
After a lot of messing around, I realized all I had to do was run xinit
on the remote machine. I can now render images heedlessly on a remote Linux server and save them to file (thanks again!).
However, when it comes to creating my simulated depth cameras, I’m getting an error I don’t normally get on my laptop, shown below.
Singularity absynthe.simg:~/nfscode/absynthe> python3 experiments/box/likelihood.py
Failed to create secure directory (/run/user/23051/pulse): No such file or directory
AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"
AL lib: (WW) alsa_load: Failed to load libasound.so.2
AL lib: (WW) alc_initconfig: Failed to initialize backend "alsa"
AL lib: (EE) ALCplaybackOSS_open: Could not open /dev/dsp: No such file or directory
AL lib: (WW) alcSetError: Error generated on device (nil), code 0xa004
AL lib: (EE) ALCplaybackOSS_open: Could not open /dev/dsp: No such file or directory
AL lib: (WW) alcSetError: Error generated on device (nil), code 0xa004
:audio(error): Couldn't open default OpenAL device
:audio(error): OpenALAudioManager: No open device or context
:audio(error): OpenALAudioManager is not valid, will use NullAudioManager
AL lib: (EE) ALCplaybackOSS_open: Could not open /dev/dsp: No such file or directory
AL lib: (WW) alcSetError: Error generated on device (nil), code 0xa004
AL lib: (EE) ALCplaybackOSS_open: Could not open /dev/dsp: No such file or directory
AL lib: (WW) alcSetError: Error generated on device (nil), code 0xa004
:audio(error): Couldn't open default OpenAL device
:audio(error): OpenALAudioManager: No open device or context
:audio(error): OpenALAudioManager is not valid, will use NullAudioManager
:display(error): Could not get requested FrameBufferProperties; abandoning window.
requested: float_color color_bits=32 red_bits=32
got: color_bits=24 red_bits=8 green_bits=8 blue_bits=8 force_hardware force_software
Traceback (most recent call last):
File "experiments/box/likelihood.py", line 261, in <module>
depth_cameras = SceneUtil.make_depth_camera_ring(scene, intrinsics, n_cameras, camera_radius, camera_height, true_side_length/2)
File "/usr/local/lib/python3.6/dist-packages/absynthe/synthesis.py", line 214, in make_depth_camera_ring
depth_camera = scene.add_depth_camera(intrinics, pos, hpr)
File "/usr/local/lib/python3.6/dist-packages/absynthe/synthesis.py", line 180, in add_depth_camera
camera = self._make_camera(camera_config, pos, hpr, f'Depth, {len(self._image_cameras)}')
File "/usr/local/lib/python3.6/dist-packages/absynthe/synthesis.py", line 151, in _make_camera
buffer.add_render_texture(texture, p3dc.GraphicsOutput.RTMCopyRam)
AttributeError: 'NoneType' object has no attribute 'add_render_texture'
I don’t care about audio, but this part
:display(error): Could not get requested FrameBufferProperties; abandoning window.
requested: float_color color_bits=32 red_bits=32
got: color_bits=24 red_bits=8 green_bits=8 blue_bits=8 force_hardware force_software
seems to be stopping my depth cameras from being created.
Here is where I’m defining my configuration to make a buffer for the depth camera.
@classmethod
def get_depth_camera_config(cls, intrinsics: DepthCameraIntrinsics):
# depth is provided through the red channel as a 32-bit float
frame_buffer_properties = p3dc.FrameBufferProperties()
frame_buffer_properties.set_float_color(True)
frame_buffer_properties.set_rgba_bits(32, 0, 0, 0)
# load custom vertex and fragment shaders
shader_directory = os.path.join(os.path.dirname(__file__), '..', 'assets')
vert_path = os.path.join(shader_directory, 'depth-camera.vert')
vert_path = p3dc.Filename.from_os_specific(os.path.abspath(vert_path)).get_fullpath()
frag_path = os.path.join(shader_directory, 'depth-camera.frag')
frag_path = p3dc.Filename.from_os_specific(os.path.abspath(frag_path)).get_fullpath()
shader = p3dc.Shader.load(p3dc.Shader.SL_GLSL, vertex=vert_path, fragment=frag_path)
shader_attrib = p3dc.ShaderAttrib.make(shader, 0)
render_state = p3dc.RenderState.make(shader_attrib)
return cls(
intrinsics,
frame_buffer_properties,
render_state,
-2, # render order
(10, 0, 0, 0), # by default, use distance of 10 where no distance is measured
1, # only 1 channel (red) is used
np.float32 # buffer stores depth as 32-bit float
)
Does this mean that my GPU does not support float color?