Skip to content

Commit

Permalink
Update carla script to easier install docker and nvidia-docker (comma…
Browse files Browse the repository at this point in the history
…ai#23986)

* Easier docker and nvidia-docker install in carla script

* Small cleanup

* cleanuo

* cleanup

* More comments

* Remove adding usergroup step
  • Loading branch information
gijskoning authored and budney committed Mar 28, 2022
1 parent 5684438 commit 22aa6f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/sim/start_carla.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

# Requires nvidia docker - https://github.com/NVIDIA/nvidia-docker
if ! $(apt list --installed | grep -q nvidia-container-toolkit); then
if [ -z "$INSTALL" ]; then
echo "Nvidia docker is required. Re-run with INSTALL=1 to automatically install."
exit 0
else
read -p "Nvidia docker is required. Do you want to install it now? (y/n)";
if [ "${REPLY}" == "y" ]; then
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
echo $distribution
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo apt-get update && sudo apt-get install -y nvidia-docker2 # Also installs docker-ce and nvidia-container-toolkit
sudo systemctl restart docker
else
exit 0
fi
fi

Expand Down

0 comments on commit 22aa6f2

Please sign in to comment.