-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Error when using jtop in docker container #63
Comments
Hi @yamiefun Thank you to use jetson-stats. This is not a bug, but a know enhancement. There is a significant error:
In this case jtop try to find in your container jetson_clocks and obliviously this is not available in your container, but only in your host. I never tried jtop in a container, but you should share some volumes and check if jtop start to read something, in particular:
Maybe your container can read something. |
Hi @rbonghi Thanks for helping. Actually I'm finding a way to check if my docker container can access GPU on Jetson Xavier. Now I can use Thanks very much! |
Don't worry! I'm in the same boat. I'm porting my robot software in docker, and I'm find a nice way to use jetson-stats inside a container. This docker implementation is a working progress. |
By the way, do you use cuDNN, CUDA and opencv in your robot container? I'm trying to run application with them but I haven't figured out how to do it yet. I'm not sure if it's reasonable to share them with volume. |
At this time, I'm only approaching the problem. I suggest to open a post on nvidia forum I think they can help you more to setup a docker image. |
I completely reshape jetson-stats from the new version 3.0 will be simple to integrate it in a docker container, before my official version I will release a simple guideline to use inside a docker container. |
Hi @rbonghi , there is any new with the guideline to use jetson-stats inside a docker container? |
@rbonghi I am also looking forward to use jtop python api inside container. I have mapped tegrastats, nvpmodel and jetson_clocks as pointed out above. They are also accessible inside container. However jtop is still looking for jetson_stats.service.
How can I run this code inside container to access jetson stats |
Hi @assafzam and @muzammil360 , WOW! You really push this issue :-) I reply as well for #80 To work with jetson-stats in a docker you need to follow this bullet list:
sudo -H pip install jetson-stats
docker build -t rbonghi/jetson-stats .
docker run --rm -it -v /run/jtop.sock:/run/jtop.sock rbonghi/jetson-stats jtop Keep me posted for any issues. 💪 |
Just to remind. It is mandatory important to share the jtop socket between the host and the container. Do no forget to add in your docker run: |
@rbonghi thanks a lot. I have been able to run it in docker. However, I don't know what unit exists with each item in |
@rbonghi Thanks a lot! it works fine with your example. |
This comment has been minimized.
This comment has been minimized.
FWIW, I managed to get jetson-stats running inside a Docker container on BalenaOS ( First, I retrieved the files Then I # docker-compose.yml
version: '2'
services:
my_nvidia_container:
restart: always
build: ./my-nvidia-container
privileged: true # my-nvidia-container/Dockerfile
FROM balenalib/jetson-nano-ubuntu:bionic
# Don't prompt with any configuration questions
ENV DEBIAN_FRONTEND noninteractive
# Enable hot plugging devices, compare
# https://www.balena.io/docs/reference/base-images/base-images/#working-with-dynamically-plugged-devices
ENV UDEV=1
# Prevent L4T from updating the Jetson's internal firmware (bootloader etc.) as this is
# BalenaOS's job.
RUN \
mkdir -p /opt/nvidia/l4t-packages/ && \
touch /opt/nvidia/l4t-packages/.nv-l4t-disable-boot-fw-update-in-preinstall && \
apt-get update
# Balena's Docker images for Jetson include Nvidia's deb repository. Which JetPack release this
# repository will point to exactly, depends on the BalenaOS host version, compare
# https://github.com/balena-os/balena-jetson/blob/master/CHANGELOG.md
RUN apt-get install -y nvidia-jetpack
RUN apt-get install -y python3-pip
RUN pip3 install jetson-stats
# Adapt the paths depending on where you downloaded jetson_clocks and tegrastats to
COPY ./jetson_clocks /usr/bin/jetson_clocks
COPY ./tegrastats /usr/bin/tegrastats Finally, I connected to the container via SSH:
Boom. As for the warnings regarding PS: As an alternative to using the Nvidia deb repository and putting the missing binaries in place by hand, one could also extract all the packages directly from the aforementioned archive at https://developer.nvidia.com/embedded/L4T/r32_Release_v4.4/r32_Release_v4.4-GMC3/T210/Tegra210_Linux_R32.4.4_aarch64.tbz2 , compare e.g. this example. UPDATE: Turns out you don't need the entire |
Hi @yamiefun, |
This error should now be fixed with the latest release 4.0 try to install and check again
|
Hi,
I'm using a nvidia docker container on Jetson Xavier. The docker image is
nvcr.io/nvidia/l4t-base:r32.3.1
.I install jtop with
pip3 install -U jetson-stats
, but it will pop up some errors while executing. Here are the error messages.Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jtop/jtop.py", line 119, in init
self.jc = JetsonClocks(config_file)
File "/usr/local/lib/python3.6/dist-packages/jtop/core/jetson_clocks.py", line 62, in init
raise JetsonClocks.JCException("No jetson_clock script is availble in this board")
jtop.core.jetson_clocks.JCException: No jetson_clock script is availble in this board
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jtop/main.py", line 90, in main
with jtop(interval=args.refresh) as jetson:
File "/usr/local/lib/python3.6/dist-packages/jtop/jtop.py", line 121, in init
raise jtop.JtopException(e)
jtop.jtop.JtopException: No jetson_clock script is availble in this board
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/jtop", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/jtop/main.py", line 136, in main
print("[{status}] {error}".format(status=bcolors.fail(), error=e.message))
AttributeError: 'JtopException' object has no attribute 'message'
The text was updated successfully, but these errors were encountered: