Install Donkeycar on Linux
Note : tested on Ubuntu 20.04 LTS, 22.04 LTS
-
Open the Terminal application.
-
Install miniconda Python 3.11 64 bit.
wget https://repo.anaconda.com/miniconda/Miniconda3-py311_24.4.0-0-Linux-x86_64.sh
bash ./Miniconda3-py311_24.4.0-0-Linux-x86_64.sh
Setup your donkey
conda env with:
conda create -n donkey python=3.11
conda activate donkey
Now there are two different installations possible. Very likely you will want to do the user install. Then you will perform Step User install. In case you want to debug or edit the source code, you will need to do the more advanced Developer install. But you can do only one.
Note: Only do User install or Developer install but not both!
User install
As you have activated the new donkey
env already you simply type:
pip install donkeycar[pc]
This will install the latest release. Note, if you are using ZSH then
you have to escape the [
and ]
, i.e.
pip install donkeycar\[pc\]
Developer install
Here you can choose which branch or tag you want to install, and you can edit and/or debug the code, by downloading the source code from GitHub.
Create a project directory you would like to use as the
head of your projects, change into it and download and install donkeycar
from GitHub.
mkdir projects
cd projects
git clone https://github.com/autorope/donkeycar
cd donkeycar
git checkout main
pip install -e .[pc]
Note: if you are using ZSH (you'll know if you are), you won't be able to
run pip install -e .[pc]
. You'll need to escape the brackets and run
pip install -e .\[pc\]
.
- If this is not your first install, update Conda and remove old donkey
conda update -n base -c defaults conda
conda env remove -n donkey
The newer version of Tensorflow is already built with GPU support. If you have an Nvidia GPU, install Cuda 12 following instructions on Nivida's page here
- Optional Install Coral edge tpu compiler
If you have a Google Coral edge tpu, you may wish to compile models. You will need to install the edgetpu_compiler exectutable. Follow their instructions.
- Optionally configure PyTorch to use GPU - only for NVidia Graphics cards
If you have an NVidia card, you should update to the latest drivers and install Cuda SDK. You will also need to change the code to use the GPU in a few places, so you need the developer install.
conda install cudatoolkit=11 -c pytorch
You should replace <CUDA Version>
with your CUDA version. Any version
above 10.0 should work. You can find out your CUDA version by running
nvcc --version
or nvidia-smi
. (if those commands don't work, it means you
don't already have them installed. Follow the directions given by that error
to install them.) If the version given by these two commands don't match, go
with the version given by nvidia-smi
.
- Create your local working dir:
donkey createcar --path ~/mycar
Note: After closing the Anaconda Prompt, when you open it again, you will need to type
conda activate donkey
to re-enable the mappings to donkey specific Python libraries