Run /jetson-inference/docker/run.sh in privileged mode to use GPIO

Hello, I am running Ubuntu 18.04 with JetPack 4.6 and I installed the jetson-inference module. I want to use the GPIO ports to communicate with an arduino. I am ok with re-installing Jetson.GPIO every session, however, I cannot access the ports on the jetson nano from the container. Ive tried running

docker/run.sh --privileged --volume ~/object-detection:/my-object-detection

it says WARN: Unknown option (ignored): --privileged

Im a big fan of Dusty and his videos.

Hi @yjain0102, you would need to edit the script and add the --privileged flag to the docker run command that gets executed here:

If preferred, you can just extract that command that gets executed and run it yourself, without needing my docker/run.sh helper script at all. My script does dynamic detection of cameras, displays, ect, and mounts various directories/devices but once those are set the command won’t change. You can also add a +x to the top of that script and bash will print out all the commands it executes, allowing you to see the exact docker run command that gets composed.

Thank you Dusty! I am unsure how I would write the --privileged flag. Could I just add --privileged after sudo docker run or do I need something specific?

No problem @yjain0102 - you would change that section of the script to look like this:

sudo docker run --runtime nvidia -it --rm \
          		--network host \
          		--privileged \
          		-v /tmp/argus_socket:/tmp/argus_socket \
          		-v /etc/enctune.conf:/etc/enctune.conf \
          		-v /etc/nv_tegra_release:/etc/nv_tegra_release \
          		-v /tmp/nv_jetson_model:/tmp/nv_jetson_model \
          		$DISPLAY_DEVICE $V4L2_DEVICES \
          		$DATA_VOLUME $USER_VOLUME $DEV_VOLUME \
          		$CONTAINER_IMAGE $USER_COMMAND

The order of arguments to ‘docker run’ generally doesn’t matter, except that options for configuring the container start-up come before the container name/tag (in this case, $CONTAINER_IMAGE). While the initial command that the container runs once it’s started comes after the container name/tag ($USER_COMMAND - by default, /bin/bash)

Thank you Dusty! Appreciate your work!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.