A C++ library that enables the use of Nvidia Jetson's GPIOs.
Note
The JetsonGPIO library only works properly on Nvidia Jetson devices.
The library determines the jetson model by checking /proc/device-tree/compatible and /proc/device-tree/chosen by default. These paths only can be mapped into the container in privilleged mode.
The following example will run /bin/bash from the container in privilleged mode.
sudo docker container run -it --rm \
--runtime=nvidia --gpus all \
--privileged \
-v /proc/device-tree/compatible:/proc/device-tree/compatible \
-v /proc/device-tree/chosen:/proc/device-tree/chosen \
-v /sys/devices/:/sys/devices/ \
-v /sys/class/gpio:/sys/class/gpio \
pjueon/jetson-gpio /bin/bash
You can directly provide your jetson model name to the library through the environment variable JETSON_MODEL_NAME (ex> -e JETSON_MODEL_NAME=JETSON_NANO).
You can get the proper value for this environment variable by running /gpio-cpp/samples/jetson_model in privilleged mode:
sudo docker container run --rm \
--runtime=nvidia --gpus all \
--privileged \
-v /proc/device-tree/compatible:/proc/device-tree/compatible \
-v /proc/device-tree/chosen:/proc/device-tree/chosen \
-v /sys/devices/:/sys/devices/ \
-v /sys/class/gpio:/sys/class/gpio \
pjueon/jetson-gpio /gpio-cpp/samples/jetson_model
The following example will run /bin/bash from the container in non-privilleged mode.
sudo docker container run -it --rm \
--runtime=nvidia --gpus all \
-v /sys/devices/:/sys/devices/ \
-v /sys/class/gpio:/sys/class/gpio \
-e JETSON_MODEL_NAME=[PUT_YOUR_JETSON_MODEL_NAME_HERE] \
pjueon/jetson-gpio /bin/bash
Content type
Image
Digest
sha256:e18bf9e96…
Size
416.3 MB
Last updated
almost 3 years ago
docker pull pjueon/jetson-gpio