MIVisionX Docker documentation#

Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers. Refer to Rocm Docker Wiki for additional information.

Docker workflow on Ubuntu 20.04/22.04#

Prerequisites#

Workflow#

  1. Get the latest docker image. Use the following command to bring in the latest changes from upstream.

sudo docker pull mivisionx/ubuntu-20.04:latest
  1. Run docker image

Run docker image: Local Machine#

sudo docker run -it --privileged --device=/dev/kfd --device=/dev/dri --device=/dev/mem --cap-add=SYS_RAWIO  --group-add video --shm-size=4g --ipc="host" --network=host mivisionx/ubuntu-20.04:latest
  • Computer Vision Test

python3 /workspace/MIVisionX/tests/vision_tests/runVisionTests.py --num_frames 1
  • Neural Network Test

python3 /workspace/MIVisionX/tests/neural_network_tests/runNeuralNetworkTests.py --profiler_level 1
  • Khronos OpenVX 1.3.0 Conformance Test

python3 /workspace/MIVisionX/tests/conformance_tests/runConformanceTests.py --backend_type HOST

Option 1: Map localhost directory on the docker image#

  • Option to map the localhost directory with data to be accessed on the docker image: -v {LOCAL_HOST_DIRECTORY_PATH}:{DOCKER_DIRECTORY_PATH}

sudo docker run -it -v /home/:/root/hostDrive/ --privileged --device=/dev/kfd --device=/dev/dri --device=/dev/mem --cap-add=SYS_RAWIO  --group-add video --shm-size=4g --ipc="host" --network=host mivisionx/ubuntu-20.04:latest

Option 2: Display with docker#

  • Using host display for docker

xhost +local:root
sudo docker run -it --privileged --device=/dev/kfd --device=/dev/dri --cap-add=SYS_RAWIO --device=/dev/mem --group-add video --network host --env DISPLAY=$DISPLAY --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --volume /tmp/.X11-unix/:/tmp/.X11-unix mivisionx/ubuntu-20.04:latest
  • Test display with MIVisionX sample

runvx -v /opt/rocm/share/mivisionx/samples/gdf/canny.gdf

Run docker image with display: Remote Server Machine#

sudo docker run -it --privileged --device=/dev/kfd --device=/dev/dri --cap-add=SYS_RAWIO --device=/dev/mem --group-add video --network host --env DISPLAY=$DISPLAY --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --volume /tmp/.X11-unix/:/tmp/.X11-unix mivisionx/ubuntu-20.04:latest
  • Display with MIVisionX sample

runvx -v /opt/rocm/share/mivisionx/samples/gdf/canny.gdf

Build - dockerfiles#

sudo docker build --build-arg {ARG_1_NAME}={ARG_1_VALUE} [--build-arg {ARG_2_NAME}={ARG_2_VALUE}] -f {DOCKER_FILE_NAME}.dockerfile -t {DOCKER_IMAGE_NAME} .

Run - docker#

sudo docker run -it --privileged --device=/dev/kfd --device=/dev/dri --cap-add=SYS_RAWIO --device=/dev/mem --group-add video --network host --env DISPLAY=$DISPLAY --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --volume /tmp/.X11-unix/:/tmp/.X11-unix {DOCKER_IMAGE_NAME}

Ubuntu 20/22 DockerFiles#

  • Green Square New component added to the level

  • Blue Square Existing component from the previous level

Build Level

MIVisionX Dependencies

Modules

Libraries and Executables

Docker File

Level_1

cmake
gcc
g++

amd_openvx
utilities

Green Square libopenvx.so - OpenVX Lib - CPU
Green Square libvxu.so - OpenVX immediate node Lib - CPU
Green Square runvx - OpenVX Graph Executor - CPU with Display OFF

level-1.dockerfile

Level_2

ROCm OpenCL
+Level 1

amd_openvx
amd_openvx_extensions
utilities

Blue Square libopenvx.so - OpenVX Lib - CPU/GPU
Blue Square libvxu.so - OpenVX immediate node Lib - CPU/GPU
Green Square libvx_loomsl.so - Loom 360 Stitch Lib
Green Square loom_shell - 360 Stitch App
Green Square runcl - OpenCL Debug App
Blue Square runvx - OpenVX Graph Executor - Display OFF

level-2.dockerfile

Level_3

OpenCV
FFMPEG
+Level 2

amd_openvx
amd_openvx_extensions
utilities

Blue Square libopenvx.so - OpenVX Lib
Blue Square libvxu.so - OpenVX immediate node Lib
Blue Square libvx_loomsl.so - Loom 360 Stitch Lib
Blue Square loom_shell - 360 Stitch App
Blue Square runcl - OpenCL Debug App
Green Square libvx_amd_media.so - OpenVX Media Extension
Green Square libvx_opencv.so - OpenVX OpenCV InterOp Extension
Green Square mv_compile - Neural Net Model Compile
Blue Square runvx - OpenVX Graph Executor - Display ON

level-3.dockerfile

Level_4

MIOpenGEMM
MIOpen
ProtoBuf
+Level 3

amd_openvx
amd_openvx_extensions
apps
utilities

Blue Square libopenvx.so - OpenVX Lib
Blue Square libvxu.so - OpenVX immediate node Lib
Blue Square libvx_loomsl.so - Loom 360 Stitch Lib
Blue Square loom_shell - 360 Stitch App
Blue Square libvx_amd_media.so - OpenVX Media Extension
Blue Square libvx_opencv.so - OpenVX OpenCV InterOp Extension
Blue Square mv_compile - Neural Net Model Compile
Blue Square runcl - OpenCL Debug App
Blue Square runvx - OpenVX Graph Executor - Display ON
Green Square libvx_nn.so - OpenVX Neural Net Extension
Green Square inference_server_app - Cloud Inference App

level-4.dockerfile

Level_5

AMD_RPP
RPP deps
+Level 4

amd_openvx
amd_openvx_extensions
apps
AMD VX RPP
utilities

Blue Square libopenvx.so - OpenVX Lib
Blue Square libvxu.so - OpenVX immediate node Lib
Blue Square libvx_loomsl.so - Loom 360 Stitch Lib
Blue Square loom_shell - 360 Stitch App
Blue Square libvx_amd_media.so - OpenVX Media Extension
Blue Square libvx_opencv.so - OpenVX OpenCV InterOp Extension
Blue Square mv_compile - Neural Net Model Compile
Blue Square runcl - OpenCL Debug App
Blue Square runvx - OpenVX Graph Executor - Display ON
Blue Square libvx_nn.so - OpenVX Neural Net Extension
Blue Square inference_server_app - Cloud Inference App
Green Square libvx_rpp.so - OpenVX RPP Extension

level-5.dockerfile