CarlaSim on Ibex

CarlaSim runs as a client server application. Since CarlaSim supports limited Operating systems, and requires root access to install, it is unviable to install it on bare metal on a HPC system like Ibex which is shared. Besides, only the server side requires an installation such as that.

Moreover, vulkan drivers are not available on Ibex GPU node and we will rely on opengl to run our server as headless i.e. with no rendering support.

Building Server environment

For server side we use Docker image published by CarlaSim on DockerHub. Since Docker container platform is not available on Ibex. Instead we will use Singularity container platform to run a CarlaSim container using the same Docker image from DockerHub.

Here is how you fetch the relevant image on Ibex:

module load singularity mkdir -p $HOME/tmpdir export SINGULARITY_TMPDIR=$HOME/tmpdir singularity pull docker://carlasim/carla:0.9.5

Once completed, the above commands result in a Singularity Image File or a carla_0.9.5.sif which Singularity container runtime understand.

Running the server

The following jobscript should start a Carla server:

#!/bin/bash #SBATCH --job-name=carla_server #SBATCH --gpus=1 #SBATCH --gpus-per-node=1 #SBATCH --constraint=gtx1080ti #SBATCH --mem=50G #SBATCH --cpus-per-task=4 #SBATCH --time=01:00:00 module load singularity export DISPLAY= # set image path to where your image is located export IMAGE=/ibex/scratch/shaima0d/tickets/37094/carla_0.9.5.sif #Setting the port is optional. Set it if another user process is using the default 2000 and 2001 ports. export HOST=$(/bin/hostname) export PORT=11011 echo "Starting Carla server on $HOST:$PORT" > server_info.${SLURM_JOBID}.txt SINGULARITYENV_SDL_VIDEODRIVER=offscreen SINGULARITYENV_CUDA_VISIBLE_DEIVCE=$CUDA_VISIBLE_DEVICES singularity exec --nv carla_0.9.5.sif /home/carla/CarlaUE4.sh -opengl -carla-rpc-port=11011
  • At times, you may notice that the server doesn’t start and crashes with Segmentation Fault. In such situation try allocating the whole node and resubmit the server job. We are investigating the issue why the CUDA_VISIBLE_DEVICES are not honored.

  • In case you see that the requested port is busy, try to change the port, its an arbitrary number. Try port number > 10000 to keep away from the commonly used ones.

Build Client environment

You can create a conda environment:

conda env create -f environment.yml

where the environment.yml looks as follows:

Running the client

To connect to the server, you can either start an interactive job or submit a python script in a SLURM job script. The following is a jobscript running a performance benchmark packaged in CarlaSim’s Github repository: