Repository: mlcommons/inference
Issue: Inference Benchmark Docker Platform Issue
Root cause: Environment Incompatibility

Context:
I am running this on the Jetson Nano developer kit with Ubuntu 18.04 on an ARM processor.

I am trying to run an object detection benchmark through Docker and was successful when I used the CPU with TensorFlow.  When I try using the GPU, I get this error:

Jake@Jake-desktop:~/mlpyhton38/vision/classification_and_detection$ sudo ./run_and_time.sh tf ssd-mobilenet gpu
Sending build context to Docker daemon  519.2kB
Step 1/16 : FROM nvidia/cuda:10.2-cudnn8-devel-ubuntu18.04
 ---> afc7fe5f7509
Step 2/16 : ENV PYTHON_VERSION=3.7
 ---> Using cache
 ---> c6f37df34879
Step 3/16 : ENV LANG C.UTF-8
 ---> Using cache
 ---> 1efbb09de82a
Step 4/16 : ENV LC_ALL C.UTF-8
 ---> Using cache
 ---> 01dfdc1bf679
Step 5/16 : ENV PATH /opt/anaconda3/bin:$PATH
 ---> Using cache
 ---> a13629642a89
Step 6/16 : WORKDIR /root
 ---> Using cache
 ---> 20f196861ed2
Step 7/16 : ENV HOME /root
 ---> Using cache
 ---> 5e5519deb70d
Step 8/16 : RUN apt-get update
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 6a107162052e
standard_init_linux.go:228: exec user process caused: exec format error
The command '/bin/sh -c apt-get update' returned a non-zero code: 1
docker: error parsing specified platform: "--runtime=nvidia" is an invalid component of "--runtime=nvidia": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument.
See 'docker run --help'.


After some searching, it seems the error stems from the Docker trying to run something meant for an AMD processor on my ARM processor.  People running into similar issues using M1 processors on a different GitHub project have said to try "--platform linux/amd64" after "docker run", but this does not help me.  I have tried other things all related to somehow changing "platform" to "linux/amd64" or "linux/arm64/v8" to no avail.  Any suggestions?  Maybe that warning doesn't mean anything and it is a different issue?

Something to note as well that confuses me is how Dockerfile.CPU works for when it is called by either run_common.sh or run_and_time.sh, but Dockerfile.GPU fails.  To be specific, lines 2 through 33 are the same between the two docker files.  Line 1 does add in downloading some CUDA files for Dockerfile.GPU, but I would only see downloading something wrong affecting me later in the file and not at "apt-get update".  I've tried commenting out the line that gets the non-zero code, but then the next line down just gets the same error.

I figured out my issue.  The first line on Docker.gpu was using an image that only works for amd64.  I found an aarch64 substitute and got the benchmark to work.  Could I do a pull request for the two docker files?  They both assume that you are running x86, so editing or adding something for aarch64 users would be nice.  It would feel like a waste to make all my fixes and not share it with others.

I solved the issue. Nvidia has not release any CUDA 10.x docker images, so the Jetson nano has to build the benchmark locally to use the GPU