carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.19k stars 3.62k forks source link

Carla on WSL2 with GUI rendering #5806

Open johnMinelli opened 2 years ago

johnMinelli commented 2 years ago

Hi I'm just filling this for the records if someone want to use Carla on WSL2 with GUI rendering.

This guide was very helpful to me for the audio setting: https://carette.xyz/posts/setup_sound_video_wsl2/ For the video you need a custom lavapipe: https://github.com/gnsmrky/wsl-vulkan-mesa The readme guide says to set the DISPLAY setting at 1. That doesn't worked for me. I suggest instead:

(The prerequisite is a correct driver setup for your GPU in windows to comunicate with WSL.)

I tested the behaviour just launching ./CarlaUE4.sh (if you don't want the renderings just add -RenderOffscreen and you are done)


Troubleshooting

CARLA version: 0.9.13 Platform/OS: Windows 11, 22H2, Build: 22623.730 WSL2: Debian GNU/Linux 11 (bullseye)

I hope this saves someone else some time.

abidnazirisami commented 1 year ago

Can you render CARLA using all of your GPU capabilities? I followed the links and I can get a render of CARLA from wsl, but it doesn't seem to be able to access the GPU in my system and is running very slow. I have the proper Nvidia drivers installed as well.

johnMinelli commented 1 year ago

No, actually the last time I tried I had the same problem and I ended up using the Windows version 😓

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ChanCody commented 1 year ago

For anyone trying to use carla in wsl2, I suggest running the carla server in windows and running client in WSL. This works perfect for me.

sonalrpatel commented 1 year ago

For anyone trying to use carla in wsl2, I suggest running the carla server in windows and running client in WSL. This works perfect for me.

Could you please describe the steps how to do it? Even I am trying the same, but not able to make it work yet.

ChanCody commented 1 year ago
  1. Download the Carla server of Win version and start the Win server instead of Linux server.
  2. In your client script, change the "localhost" to the ip of your Win.
  3. Run your script in wsl and the client will connect to the Win server.
Mulberry26 commented 11 months ago
  1. Download the Carla server of Win version and start the Win server instead of Linux server.
  2. In your client script, change the "localhost" to the ip of your Win.
  3. Run your script in wsl and the client will connect to the Win server.

connecting to Carla server... WARNING: Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API WARNING: Client API version = 0.9.6 WARNING: Simulator API version = baf43b07

I've run into this problem. I was wondering if you have done anything else to fix this? Because Win doesn't have carla 9.6

angelomorgado commented 10 months ago
  1. Download the Carla server of Win version and start the Win server instead of Linux server.
  2. In your client script, change the "localhost" to the ip of your Win.
  3. Run your script in wsl and the client will connect to the Win server.

connecting to Carla server... WARNING: Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API WARNING: Client API version = 0.9.6 WARNING: Simulator API version = baf43b0

I've run into this problem. I was wondering if you have done anything else to fix this? Because Win doesn't have carla 9.6

Hey last time I had a similar error it was because i needed to use Python 3.8, try running the client in a virtual env with conda

Sgt-Harry commented 6 months ago

Do we still need a VcXsrv on Windows to use Carla on WSL2 when WSL2 now actually support GUI application?