Fixing installation.

This commit is contained in:
Isse
2024-11-27 10:23:40 +01:00
parent 4bf8211042
commit 2e3fa26fef
3 changed files with 89 additions and 54 deletions

View File

@ -1,42 +0,0 @@
# ROS
<br>
## Build
- Install system: \
(https://developer.nvidia.com/embedded/learn/get-started-jetson-agx-orin-devkit)
- Install _docker_: \
(https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script)
- Install _nvidia-container-toolkit_: \
(https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)
- Enable GPU-access for docker building:
Run `sudo nano /etc/docker/daemon.json` and add:
```json
{
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
},
"default-runtime": "nvidia"
}
```
Restart docker: `sudo systemctl restart docker`
- Install _vs-code_: \
(https://code.visualstudio.com/docs/setup/linux)
- Test docker is working: \
```bash
sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:35.4.1
sudo docker run --runtime nvidia -it --rm --network=host nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.11-py3
```

View File

@ -0,0 +1,84 @@
# Setup with Nvidia-Jetson-Orin
Initial setup and installation of _RapidPoseTriangulation_ on a _Nvidia Jetson_ device. \
Tested with a _Jetson AGX Orin Developer Kit_ module.
<br>
## Base installation
- Install newest software image: \
(https://developer.nvidia.com/sdk-manager)
- Initialize system: \
(https://developer.nvidia.com/embedded/learn/get-started-jetson-agx-orin-devkit)
- Install basic tools:
```bash
sudo apt install -y curl nano wget git
sudo apt install -y terminator
```
- Enable _docker_ without _sudo_: \
(https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
- Enable GPU-access for docker building:
Run `sudo nano /etc/docker/daemon.json` and add:
```json
{
"runtimes": {
"nvidia": {
"args": [],
"path": "nvidia-container-runtime"
}
},
"default-runtime": "nvidia"
}
```
Restart docker: `sudo systemctl restart docker`
- Install _vs-code_: \
(https://code.visualstudio.com/docs/setup/linux)
- Test docker is working:
```bash
docker run -it --rm --runtime=nvidia --network=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r36.2.0
docker run -it --rm --runtime=nvidia --network=host nvcr.io/nvidia/l4t-ml:r36.2.0-py3
docker run -it --rm --runtime=nvidia --network=host dustynv/l4t-pytorch:r36.4.0
```
- Check _cuda_ access in container:
```bash
python3 -c 'import torch; print(torch.cuda.is_available());'
```
<br>
## RPT installation
- Build docker container:
```bash
docker build --progress=plain -f ros/dockerfile_jetson -t rapidposetriangulation .
./run_container.sh
```
- Build _rpt_ package inside container:
```bash
cd /RapidPoseTriangulation/swig/ && make all && cd ../tests/ && python3 test_interface.py
```
- Test with samples:
```bash
python3 /RapidPoseTriangulation/scripts/test_triangulate.py
```

View File

@ -1,4 +1,4 @@
FROM nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.11-py3
FROM dustynv/l4t-pytorch:r36.4.0
ARG DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
@ -7,24 +7,20 @@ WORKDIR /
RUN apt-get update && apt-get install -y --no-install-recommends feh
RUN apt-get update && apt-get install -y --no-install-recommends python3-opencv
RUN pip uninstall -y opencv-python && pip install --no-cache "opencv-python<4.3"
# Show matplotlib images
RUN apt-get update && apt-get install -y --no-install-recommends python3-tk
# Update pip to allow installation of skelda in editable mode
RUN pip3 install --upgrade --no-cache-dir pip
# Install MMPose
# ENV FORCE_CUDA="1"
# ENV MMCV_WITH_OPS=1
ENV FORCE_CUDA="1"
ENV MMCV_WITH_OPS=1
RUN pip3 install --upgrade --no-cache-dir openmim
RUN mim install mmengine
RUN mim install "mmcv>=2,<2.2.0"
RUN mim install "mmdet>=3"
RUN mim install "mmpose>=1.1.0"
# Fix an error when importing mmpose
RUN pip3 install --upgrade --no-cache-dir numpy scipy
RUN pip3 install --upgrade --no-cache-dir "numpy<2" scipy
RUN git clone --depth=1 --branch=main https://github.com/open-mmlab/mmpose.git
# Download pretrained model
@ -32,13 +28,10 @@ COPY scripts/utils_2d_pose.py /
RUN python3 -c "from utils_2d_pose import load_model; load_model();"
RUN python3 -c "from utils_2d_pose import load_wb_model; load_wb_model();"
# Fix an undefined symbol error with ompi
RUN echo "ldconfig" >> ~/.bashrc
# Install swig and later dependencies
RUN apt-get update && apt-get install -y --no-install-recommends build-essential
RUN apt-get update && apt-get install -y --no-install-recommends swig
# RUN apt-get update && apt-get install -y --no-install-recommends libopencv-dev
RUN apt-get update && apt-get install -y --no-install-recommends libopencv-dev
COPY ./skelda/ /skelda/
RUN pip3 install --no-cache-dir -e /skelda/