Robotics StackExchange | Archived questions

Gzserver fails on a k3s cluster

I'm trying to run a ROS integrated Gazebo server on a cluster in a virtual machine. The idea is to run gzserver headless, utilize the computation power there, and view the results using gzweb.

The ROS package which uses gazebo has been dockerized. Gzserver works as expected when the docker container is run as an isolated container, but throws the following error when the same container is deployed on a k3s cluster.

As seen in the screenshot below, gzserver crashes immediately after launch. A generalized error is thrown and the log files do not share any other information. Moreover, the log file(s) gazebo-1*.log cannot be found.

image description

The (ros)launch file can be found here (pastebin).

I believe the error could be either because of lack of GPU access, or because gzserver is not really running headless.

Has anyone faced something similar? Can you confirm if the parameters in the launch file are set up correctly? Are there any tips/tutorials I could follow to run Gazebo in a proper headless manner?

Asked by notnath on 2020-11-02 08:38:03 UTC

Comments

Enable verbose and debug, and see if you get any more information.

Asked by nlamprian on 2020-11-02 11:57:58 UTC

@nlmprian verbose and debug show that the problem might be with the display: Can't open display; Unable to create x window; Thread 1 "gzserver" received signal SIGSEGV, Segmentation fault. The complete log can be found here (pastebin)

Asked by notnath on 2020-11-05 08:40:42 UTC

Answers

Try setting the DISPLAY env variable with the gazebo node

<node name="gazebo" pkg="gazebo_ros" type="$(arg script_type)" respawn="$(arg respawn_gazebo)" output="screen" args="$(arg command_arg1) $(arg command_arg2) $(arg command_arg3) -e $(arg physics) $(arg extra_gazebo_args) $(arg world_name)">
  <env name="DISPLAY" value=":0" />
</node>

Asked by nlamprian on 2020-11-05 09:30:11 UTC

Comments

Doesn't do anything other than change the error from Can't open display to Can't open display :0. Can't understand why gzserver even needs a display.

Asked by notnath on 2020-11-05 13:54:25 UTC

Ah, I reacted to the error and forgot about your problem description. Gazebo can indeed run headless. It needs an x server though. If you don't have that configured, you usually get 'rendering is disabled' warnings and your cameras don't work. In your case, you say you don't have a GPU in your system. Perhaps you need to configure a virtual display. There are probably related threads in the forum. Have a look

Asked by nlamprian on 2020-11-05 17:23:31 UTC