Run an autonomous driving simulation sweep with CARLA
This tutorial walks you through running a
CARLA
The job runs a lane-change cut-in scenario where an NPC vehicle starts behind the ego vehicle, accelerates to position itself 20 meters ahead of the ego during a 105-second get-ahead phase, then cuts into the ego's lane. It sweeps across configurable ego speeds, NPC speeds, and NPC starting distances, creating a task for each parameter combination (default 2×2×2 = 8 tasks). Each task captures multi-sensor data from the camera viewpoints you select and produces the following output:
-
RGB frames from each selected camera viewpoint
-
Semantic segmentation frames
-
LiDAR point clouds (
.ply) -
2D and 3D bounding boxes (KITTI format)
-
Per-camera scenario videos (H.264 MP4)
-
Stitched grid video (if you select multiple cameras)
The following video demonstrates the CARLA simulation sweep workflow on Deadline Cloud.
Estimated time: 1–2 hours, including the Docker image build. Tasks typically complete in about 13 minutes each.
Running this tutorial incurs charges for the GPU worker instances that process the tasks and for Amazon ECR image storage.
Overview
To complete this tutorial, follow these steps:
-
Complete the prerequisites.
-
Set up your farm.
-
Build and push the Docker image.
-
Submit the simulation job.
-
Monitor the job.
-
Review the output.
-
Clean up resources.
Prerequisites
Before you begin, complete the following setup:
-
Create an AWS account
if you do not already have one, ensuring it has access to GPU instances ( g6.4xlargerecommended). -
Install Docker
locally for building the CARLA image. -
Create an Amazon ECR
repository in your account to host the built image. -
Install the Deadline Cloud CLI
locally.
Set up your farm
You need a Deadline Cloud farm with a queue that has a conda queue
environment (channels: conda-forge, packages:
ffmpeg) and a GPU fleet (minimum: 1 NVIDIA GPU with
16 vCPU and 64 GiB memory).
IAM permissions – Your
queue role needs Amazon ECR pull permissions, because the task script runs
docker pull under queue role credentials. Attach a policy
like the following:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage", "ecr:BatchCheckLayerAvailability" ], "Resource": "arn:aws:ecr:REGION:ACCOUNT_ID:repository/*" }, { "Effect": "Allow", "Action": "ecr:GetAuthorizationToken", "Resource": "*" } ] }
Fleet host configuration –
Your fleet workers need Docker and the NVIDIA Container Toolkit. Attach
the
Docker and NVIDIA Container Toolkit host configuration script on GitHub
Build and push the Docker image
The job runs inside a Docker container based on the
carlasim/carla:0.9.16 base image on Docker Hubscenario_runner, and the entrypoint and capture scripts so
each Deadline Cloud task can boot CARLA, execute the driving scenario, and
record sensor data in a single container.
To build and push the Docker image
-
Create an Amazon ECR repository if you don't have one:
aws ecr create-repository --repository-name carla-deadline --regionREGION -
From the
docker/directory of theautonomous_driving_carlabundle, build the image:cd docker/ docker build -t carla-deadline:0.9.16 .Note
The Dockerfile pulls
carlasim/carla:0.9.16from Docker Hub as the base image. The first build downloads approximately 8 GB. -
Push the image to Amazon ECR:
aws ecr get-login-password --regionREGION| \ docker login --username AWS --password-stdinACCOUNT_ID.dkr.ecr.REGION.amazonaws.com docker tag carla-deadline:0.9.16 \ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/carla-deadline:0.9.16 docker pushACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/carla-deadline:0.9.16
Submit the simulation job
To submit the job with the GUI submitter
-
From the bundle directory, open the submitter:
cd autonomous_driving_carla deadline bundle gui-submit . -
On the Job-specific settings tab, under Scenario Settings, configure ego speeds, NPC speeds, and NPC distances as comma-separated integers. The cross-product creates your task grid.
-
Under Camera Viewpoints, select which cameras to capture. Front is the default selection. Available positions are Front, Front Left, Front Right, Rear, Rear Left, and Rear Right.
-
Under Advanced, set your Container Image URI to
and the AWS Region where your Amazon ECR repository lives.ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/carla-deadline:0.9.16 -
Choose Submit.
Alternatively, submit with the CLI:
deadline bundle submit . \ --farm-idFARM_ID\ --queue-idQUEUE_ID\ --name "CARLA Lane Change Demo" \ -p ImageURI=ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/carla-deadline:0.9.16 \ -p AwsRegion=REGION
Monitor the job
Monitor progress in the Deadline Cloud console. Each task shows its
parameter values (EgoSpeed, NpcSpeed,
NpcDistance) in the task table. Tasks typically complete
in about 13 minutes each.
The log output shows:
-
Scenario generation and parameter values
-
CARLA server boot and readiness
-
Sensor capture progress (frame count per camera)
-
Video encoding for each camera
-
Grid video stitching (if you selected multiple cameras)
Review the output
To download the output
-
After the job completes, run the download command from the same directory you used at submit time, so the
OutputDirpath (default./outputs) resolves to the same place:deadline job download-output --job-idjob-id -
Deadline Cloud restores the output to the
OutputDirdirectory that you selected when submitting the job.
Each task produces output in a subdirectory named for its parameters:
outputs/ └── ego20_npc30_dist10/ ├── rgb/ │ ├── front/frame_000001.png ... frame_000062.png │ └── rear/frame_000001.png ... frame_000062.png ├── semantic/ │ ├── front/... │ └── rear/... ├── lidar/frame_000001.ply ... ├── bbox_2d/{front,rear}/frame_*.txt ├── bbox_3d/frame_*.txt └── video/ ├── front_scenario.mp4 ├── rear_scenario.mp4 └── grid_scenario.mp4
Known limitations
-
Linux only – The CARLA Docker image requires a Linux host with NVIDIA GPU drivers. Workers must run on Linux fleets.
-
x86_64 only – The CARLA Docker image does not support ARM architectures.
-
Mosaic images – The job generates RGB/semantic mosaic images when you select 2 or more cameras. The layout is 2×3 when all 6 are active, or a smaller grid otherwise.
-
Capture rate scales with camera count – The capture script writes PNGs synchronously per flush. With all 6 cameras, each flush writes 14 PNGs instead of 2 with a single camera, and the increased I/O slows flushes below the 7 FPS target. The video encoder is fixed at 7 FPS, so the same scenario produces a longer per-camera video with few cameras enabled and a shorter, denser multi-view video with many cameras enabled. This synchronous design is a deliberate tradeoff to keep the sample's architecture small and easy to adapt. A production pipeline would parallelize sensor I/O.
Clean up
To avoid ongoing charges, clean up the resources that you created for this tutorial:
To clean up tutorial resources
-
If you created a GPU fleet specifically for this tutorial, stop or delete it. If you used a pre-existing shared fleet, leave it in place.
-
Delete the
carla-deadlineAmazon ECR repository if you no longer need the image.
Related resources
The following resources provide additional information: