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

running docker-compose-gui-nvidia.yml on jetson nano #1

Closed
RezaOptimotive opened this issue Feb 4, 2023 · 11 comments
Closed

running docker-compose-gui-nvidia.yml on jetson nano #1

RezaOptimotive opened this issue Feb 4, 2023 · 11 comments

Comments

@RezaOptimotive
Copy link

So I'm trying to run the nvidia gui file on jetson nano.

I installed docker-compose on the nano using pip3:

sudo apt update && sudo apt -y upgrade
sudo apt install curl python3-pip libffi-dev python-openssl libssl-dev zlib1g-dev gcc g++ make -y
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install setuptools-rust
sudo python3 -m pip install docker-compose

I might've missed some packages that I installed!

then I did:

xhost +local:root
docker compose -f docker-compose-gui-nvidia.yml build
docker compose -f docker-compose-gui-nvidia.yml up

and with the last command I get this output:

/usr/local/lib/python3.6/dist-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography (40.0) will be the last to support Python 3.6.
  from cryptography.hazmat.backends import default_backend
Building realsense_ros2
Sending build context to Docker daemon  139.8kB
Step 1/9 : FROM ros:humble-perception
 ---> bad31d6015e0
Step 2/9 : ENV WS_DIR="/ros2_ws"
 ---> Using cache
 ---> b351c85dd87d
Step 3/9 : WORKDIR ${WS_DIR}
 ---> Using cache
 ---> 5c526ba274d9
Step 4/9 : SHELL ["/bin/bash", "-c"]
 ---> Using cache
 ---> 6fedfec2692e
Step 5/9 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 4cb30bb908bd
Step 6/9 : RUN apt-get update -y  && apt-get install -y     build-essential     cmake     git-all     software-properties-common
 ---> Using cache
 ---> d4f66f96e17b
Step 7/9 : RUN apt-get update -y  && apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE  && add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u  && apt-get install -y     librealsense2-dbg     librealsense2-dev     librealsense2-dkms     librealsense2-utils
 ---> Running in 4e125806f392
Hit:1 http://packages.ros.org/ros2/ubuntu jammy InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Reading package lists...
W: http://packages.ros.org/ros2/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.pvaIdQjDQ2/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
gpg: key C8B3A55A6F3EFCDE: public key ""CN = Intel(R) Intel(R) Realsense", O=Intel Corporation" imported
gpg: Total number processed: 1
gpg:               imported: 1
Hit:1 http://packages.ros.org/ros2/ubuntu jammy InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Get:6 https://librealsense.intel.com/Debian/apt-repo jammy InRelease [2400 B]
Fetched 2400 B in 2s (1378 B/s)
Reading package lists...
W: http://packages.ros.org/ros2/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://librealsense.intel.com/Debian/apt-repo/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Repository: 'deb https://librealsense.intel.com/Debian/apt-repo jammy main'
Description:
Archive for codename: jammy components: main
More info: https://librealsense.intel.com/Debian/apt-repo
Adding repository.
Adding deb entry to /etc/apt/sources.list.d/archive_uri-https_librealsense_intel_com_debian_apt-repo-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-https_librealsense_intel_com_debian_apt-repo-jammy.list
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package librealsense2-dbg
E: Unable to locate package librealsense2-dev
E: Unable to locate package librealsense2-dkms
E: Unable to locate package librealsense2-utils
The command '/bin/bash -c apt-get update -y  && apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE  && add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u  && apt-get install -y     librealsense2-dbg     librealsense2-dev     librealsense2-dkms     librealsense2-utils' returned a non-zero code: 100
ERROR: Service 'realsense_ros2' failed to build : Build failed

Any thoughts?

@2b-t
Copy link
Owner

2b-t commented Feb 4, 2023

Hi @RezaOptimotive
I sadly do not have a Jetson Nano so I can't try myself. Could you try to modify the Dockerfile and replace it with the following (basically removing everything that comes after the step that failed)?

FROM ros:humble-perception

ENV WS_DIR="/ros2_ws"
WORKDIR ${WS_DIR}

SHELL ["/bin/bash", "-c"]

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y \
 && apt-get install -y \
    build-essential \
    cmake \
    git-all \
    software-properties-common

# Install dependencies: See https://github.com/IntelRealSense/realsense-ros/tree/ros2-development
# Librealsense: See https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages
RUN apt-get update -y \
 && apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE \
 && add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" 
 
 ARG DEBIAN_FRONTEND=dialog

This minimal Docker should now compile as long as you have properly set-up the Nvidia Container Runtime. Then once inside the Docker execute
$ apt-get update
$ apt search librealsense2
and let me know what the output of it is.
In case it does not find any packages still it might as well be that Intel does not provide readily available Debian packages for Arm and Jammy (but it actually should as far as I know). In that case you could try the installation from source Dockerfile. Finally you could also try emulating amd64 as described here.

@RezaOptimotive
Copy link
Author

This is the output I get:

nano@jetson:~$ docker exec -it docker_realsense_ros2_1 /bin/bash
root@jetson:/ros2_ws# apt update
Hit:1 http://packages.ros.org/ros2/ubuntu jammy InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy InRelease                
Hit:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease        
Hit:4 https://librealsense.intel.com/Debian/apt-repo jammy InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Hit:6 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: http://packages.ros.org/ros2/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://librealsense.intel.com/Debian/apt-repo/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://librealsense.intel.com/Debian/apt-repo jammy InRelease' doesn't support architecture 'arm64'
root@jetson:/ros2_ws# apt search librealsense2
Sorting... Done
Full Text Search... Done
ros-humble-librealsense2/jammy 2.51.1-2jammy.20221108.153031 arm64
  Library for controlling and capturing data from the Intel(R) RealSense(TM) D400 devices.

ros-humble-librealsense2-dbgsym/jammy 2.51.1-2jammy.20221108.153031 arm64
  debug symbols for ros-humble-librealsense2

root@jetson:/ros2_ws# 

Next I'll try building from source.

@2b-t
Copy link
Owner

2b-t commented Feb 4, 2023

I see, could you try modifying your Dockerfile now as follows:

FROM ros:humble-perception

ENV WS_DIR="/ros2_ws"
WORKDIR ${WS_DIR}

SHELL ["/bin/bash", "-c"]

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y \
 && apt-get install -y \
    build-essential \
    cmake \
    git-all \
    software-properties-common

# Install dependencies: See https://github.com/IntelRealSense/realsense-ros/tree/ros2-development
# Librealsense: See https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages
RUN apt-get update -y \
 && apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE \
 && add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u \
 && apt-get update -y \
 && apt-get install -y librealsense2

RUN apt-get update -y \
 && apt-get install -y \
    ros-${ROS_DISTRO}-rviz2 \
    ros-${ROS_DISTRO}-librealsense2 \
 && mkdir src \
 && cd src \
 && git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2-development \
 && cd .. \
 && apt-get install -y python3-rosdep \
 && source /opt/ros/${ROS_DISTRO}/setup.bash \
 && rm /etc/ros/rosdep/sources.list.d/20-default.list \
 && rosdep init \
 && rosdep update \
 && rosdep install -i --from-path src --rosdistro ${ROS_DISTRO} --skip-keys=librealsense2 -y \
 && colcon build

ARG DEBIAN_FRONTEND=dialog

and see if that works?

@RezaOptimotive
Copy link
Author

RezaOptimotive commented Feb 5, 2023

the source docker file is still building, should be the end of it though.

I'll test this new one right after testing the source container.

@2b-t
Copy link
Owner

2b-t commented Feb 5, 2023

@RezaOptimotive Excellent, keep me posted. Would be cool if we could make this work for arm64 as well. Was not aware that the packages for arm64 would be different.

@RezaOptimotive
Copy link
Author

RezaOptimotive commented Feb 5, 2023

Building from source works great!

Moving on to the latest Dockerfile you sent!

@RezaOptimotive
Copy link
Author

It gives unable to locate package librealsense2

@2b-t
Copy link
Owner

2b-t commented Feb 5, 2023

@RezaOptimotive I see, just saw before that you had the output Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://librealsense.intel.com/Debian/apt-repo jammy InRelease' doesn't support architecture 'arm64'. So their repository in fact does not support arm64. Meaning building from source is your only option.

Have you already tested that it not only builds but you are also able to access the camera with e.g. $ rs-enumerate-devices --compact and visualize the camera stream?

@RezaOptimotive
Copy link
Author

RezaOptimotive commented Feb 5, 2023

Yes! rs-enumerate-devices --compact runs successfully.

After that I tested rs-depth and that works as well.

Then I tested running ros2 launch realsense2_camera rs_launch.py pointcloud.enable:=true and the topics are available, however it does not allow me to open rviz2 so I looked up the error:

Unable to create the rendering window

So from this I added -NVIDIA_DRIVER_CAPABILITIES=all to the yaml file yet I still have no success getting the GUI to open.

It might be worth making a new issue for this however if you agree.

@2b-t
Copy link
Owner

2b-t commented Feb 5, 2023

Excellent, let's open a separate issue for that (but it should be fairly easy to fix). Let me know in that issue what your set-up is like in more detail (operating system, is a screen attached to the Jetson or are you connecting over ssh?).

@2b-t 2b-t closed this as completed in 39b5bd5 Feb 5, 2023
@2b-t
Copy link
Owner

2b-t commented Jun 10, 2024

Should be resolved in #2 (comment).

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

No branches or pull requests

2 participants