JetsonGPIO.h not working when building the docker

I am trying to run an LED linked to the Jetson GPIO, everything outside the container work perfectly fine, even the library, when compiling it finds it.

However, for some reasons, when I run “docker/” in order to build the new docker, it gives me the following error:

"/jetson-inference/examples/detectnet/detectnet.cpp:43:10: fatal error: JetsonGPIO.h: No such file or directory
#include “JetsonGPIO.h” "

As said, outside the container when I compile the project, it works, the problems comes up when I am building the container.

I also tried to enable the directory on the path system, but it does not seem to work.


How do you enable the folder?

For example:

If JetsonGPIO.h is located at /home/nvidia/Jetson/.
Please launch the container like below:

$ sudo docker run ... -v /home/nvidia/Jetson:/home/nvidia/Jetson ...

Then please check if you can find the JetsonGPIO.h in /home/nvidia/Jetson/.
If the path is updated, please modify the Makefile with the correct include path.


The thing is that I need to build the docker first in order to run it, therefore I would first need to do “docker/” and then run the new container.

However as stated previously, when I compile the project before running the container and test with test images, it works, it finds the library and everything, I already put the directory on the target of the CMakelists file.

as you an see it is in there the “JetsonGPIO” and when I use “make” outside the container before building the actual container, everything compiles perfectly and it works, the problem is when I then try run the “docker/” as it gives me the following problem.


Hi @fratanto, the issue is that your JetsonGPIO.h file is not in the container when you build it.

Is this the JetsonGPIO project you are referring to?

If so, try adding this to the Dockerfile on this line, before jetson-inference gets built:

RUN git clone && \
cd JetsonGPIO/build && \
make all && \
make install

Also note that depending on what devices this GPIO library uses, doing GPIO from inside container may you require to mount additional /dev or /sys files into the container. I’m not sure exactly which.

1 Like

it did build the docker indeed however now when I try to run the model, it gives me this error, which I think is related to what you were saying there at the end.

if you don’t know what are the files, would you mind directing me on the python one as I know it is an official one by NVIDIA that one, as it actually gives the same problem, but it is not only that, seems that does not recognize all the python libraries inside the container, would you mind to have a look on another topic which I opened since you are not sure about this one, please?

here is the link:

You may want to refer to this thread about GPIO in container: Using GPIO from within a docker container

If you are unable to get GPIO to work inside container, you can build/install jetson-inference outside of container and just run without container.

How do I do that?
Because I already tried with "docker build -f jetson-inference/Dockerfile . "

However it gives me this error

which I then tried to pull some updates, but even then, still the same error pops up.

You can find the steps to build the project outside of container here:

This will build/install jetson-inference directly onto your device, without container.

1 Like