能否在Google Cloud、Azure等云服务器上运行AirSim?本地运行过热转云平台报错求助
Hey there! Let's work through your AirSim cloud deployment issues together.
First off, the short answer: Yes, you absolutely can—but you need to use GPU-accelerated instances and configure the graphics environment correctly. AirSim depends on hardware-accelerated graphics APIs (like OpenGL) that plain CPU-only cloud instances don't support, which is why you're hitting those errors.
Your errors ("insufficient driver or hardware" and failed OpenGL 4.3 context creation) stem from using a non-GPU instance or missing proper drivers. Here's how to fix it:
- Switch to a GPU-enabled instance: Choose Azure's NV-series (e.g., NVv3, NVv4) or NC-series instances—these come with NVIDIA GPUs that support OpenGL 4.3+.
- Install NVIDIA drivers & CUDA: After spinning up the instance, install the official NVIDIA driver matching your GPU model, plus the CUDA toolkit. This ensures the system recognizes the GPU and supports the required OpenGL version.
- Set up a virtual display: Cloud servers don't have physical monitors, so you need a virtual X server. Run these commands to start Xvfb (a lightweight virtual display):
Then launch AirSim within this environment.Xvfb :0 -screen 0 1024x768x24 & export DISPLAY=:0
The XRandR and SDL errors happen because GCP's default instances lack a proper X11 graphics environment (which SDL relies on for display handling). Try these steps:
- Use a GPU instance: Pick GCP's N1 instances with NVIDIA T4/P4 GPUs, or A2-series instances—these include the hardware needed for graphics acceleration.
- Install X11 components & NVIDIA drivers: Install packages like
xorg,xrandr, and the official NVIDIA driver. For Ubuntu-based instances, run:
Then install the NVIDIA driver via GCP'ssudo apt update && sudo apt install xorg xrandrnvidia-driver-installertool or official repositories. - Configure SDL to use X11: Set the environment variable to force SDL to use the X11 backend:
Combine this with the Xvfb setup from the Azure section to create a virtual display for AirSim.export SDL_VIDEODRIVER=x11
Once you've configured the GPU instance and graphics environment, AirSim should run smoothly on either cloud platform.
内容的提问来源于stack exchange,提问作者ozan pali

