Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create docker container to run CARLA server on GPU #8

Closed
DanielCoelho112 opened this issue Oct 11, 2022 · 10 comments
Closed

Create docker container to run CARLA server on GPU #8

DanielCoelho112 opened this issue Oct 11, 2022 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@DanielCoelho112
Copy link
Collaborator

No description provided.

@DanielCoelho112 DanielCoelho112 added the enhancement New feature or request label Oct 11, 2022
@DanielCoelho112 DanielCoelho112 self-assigned this Oct 11, 2022
@DanielCoelho112
Copy link
Collaborator Author

DanielCoelho112 commented Oct 11, 2022

Done.
This one was a bit tricky because in OpenSuse for the user to interact with NVIDIA files, the user must belong to root:video. Since this is different than other distros, I couldn't just use nvidia-docker to fix this. Following NVIDIA/nvidia-docker#657, I added more permissions on gpu devices:

sudo sed -i 's/660/666/g' /etc/modprobe.d/50-nvidia-default.conf
sudo /sbin/mkinitrd

After that, we need to run the server in the deeplar. For that first use ssh with tunneling:

ssh DanielCoelho11@193.137.172.109 -L 2000:localhost:2000 -L 2001:localhost:2001 -C -4

and then

 sudo docker run --privileged -d --gpus '"device=2"' --net=host -v /tmp/.X11-unix:/tmp/.X11-unix:rw carlasim/carla:0.9.13 /bin/bash ./CarlaUE4.sh -RenderOffScreen -quality-level=low

The previous initializes the server, then we just have to connect via the python API:

python3 manual.control.py

and we get the following image:

image

We are getting around 50 fps in server and client which is very good. However the driving is laggy, I suspect it is due to the latency over ssh. I think this is not critical, because we are going to run the simulation synchronous mode, meaning that the client has total control over the time in the simulation.

@DanielCoelho112
Copy link
Collaborator Author

Compression mode in ssh (-C flag) helps to reduce the latency a bit. I was wondering if it wouldn't be possible to connect an ethernet cable directly to deeper and then run ssh. Is this possible?

@DanielCoelho112
Copy link
Collaborator Author

This morning I used a ethernet cable to connect to the deeplar and now we have a real-time driving:

https://uapt33090-my.sharepoint.com/:v:/g/personal/danielsilveiracoelho_ua_pt/EQJFi3Qe3e1NoKRipYXg3O8Bhr_DTT0zwEdBkIafq8VS7Q?e=J2Bsse

I had to configure my wired network using the following parameters:
config_ethernet_client

Also, to run the server we shoudn't use the flag -C:

ssh DanielCoelho11@193.137.172.109 -L 2000:localhost:2000 -L 2001:localhost:2001 

The only problem is that the deeplar has only one ethernet port, which means that when I'm plugged in to test something in CARLA, the server goes offline.

@miguelriemoliveira, @vitoruapt should we use a switch? Or something else?

@miguelriemoliveira
Copy link
Member

Hi @DanielCoelho112 ,

the video looks great.

I think we should buy a new gibabit ethernet card ... @vitoruapt , what do you say?

@vitoruapt
Copy link
Contributor

I think we should buy a new gibabit ethernet card ... @vitoruapt , what do you say?

Sure... try to find one as soon as possible that fits in a free slot, and ask Rui Heitor to order it (Mbit is a suggestion)
We have a tight dead-line to close orders... a few days only!
Nice work... ;-)

@DanielCoelho112
Copy link
Collaborator Author

Hi @miguelriemoliveira, @vitoruapt

Today I tested the UBS-Ethernet conversor and everything works properly.
I added an additional ethernet interface eth1 with IP = 193.137.171.109 (I'll add this to the documentation).

Then I also configured the Steering Wheel to work with CARLA:
https://uapt33090-my.sharepoint.com/:v:/g/personal/danielsilveiracoelho_ua_pt/Eba9T-dD_ytAgw2DZdKJMv4B1JSME-LP-5JsbMxk2Cp5rg?e=wikAnd

@vitoruapt
Copy link
Contributor

Very nice. I am glad the converter works. Was it easy to configure?
But, most of all: I want to play with the driving simulator kit as well ;-)

@miguelriemoliveira
Copy link
Member

miguelriemoliveira commented Nov 8, 2022 via email

@DanielCoelho112
Copy link
Collaborator Author

Was it easy to configure?

Yes. The ethernet interface was recognized automatically.

The best part is the gigantic monitor in the back, unnused:)

Actually, I couldn't use the monitor this time. I had to use my ethernet cable which is only 3 meters and so I had to move closer to the DeepLar. I'll ask Eng. Rui a larger cable.

@miguelriemoliveira
Copy link
Member

miguelriemoliveira commented Nov 8, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants