1
0

Add --group-add example in README.md

Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
James Ketrenos 2020-01-29 14:18:59 -08:00
parent 7643dd430f
commit 4d5e882ed6

View File

@ -6,6 +6,27 @@ offload for transcode operations.
For information on how the Dockerfile in this container is generated,
see [xe-solutions](https://gitlab.devtools.intel.com/vtt/sws/osgc/solutions/xe-solutions).
# To run pre-built container
The following will download the latest version of the container and run the
'test' entry point.
```bash
. SOLUTION
VIDEO=$(getent group video | sed -E 's,^video:[^:]*:([^:]*):.*$,\1,')
docker run --rm \
--group-add ${VIDEO} \
--volume $(pwd)/data:/data \
--device /dev/dri \
${REGISTRY_URL}/intel-compute-clinfo:latest-${OS_DISTRO}-${OS_RELEASE} \
test
```
NOTE: The VIDEO setup prior to running the container is needed if you are running
on a host OS that has a different video UID:GID mapping than the guest OS.
On some systems, you may also need to do the same for the RENDER group. See
`scripts/test-image.sh` for an example.
# Usage examples
Two step from zero-to-hero:
@ -29,7 +50,9 @@ The following will transcode 'TearsOfSteal.mp4' from AVC (H.264) to a
5Mbps HEVC (H.265) stream using the GPU.
```bash
VIDEO=$(getent group video | sed -E 's,^video:[^:]*:([^:]*):.*$,\1,')
docker run \
--group-add ${VIDEO} \
--device=/dev/dri \
--volume $(pwd)/data:/data \
amr-registry.caas.intel.com/vtt-osgc/solutions/intel-media-ffmpeg:ubuntu-eoan \
@ -93,7 +116,9 @@ scripts/build-image.sh
```bash
TAG=${TAG:-latest}
VIDEO=$(getent group video | sed -E 's,^video:[^:]*:([^:]*):.*$,\1,')
docker run \
--group-add ${VIDEO} \
--rm \
--device=/dev/dri \
-e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \
@ -122,7 +147,9 @@ TAG=${TAG:-latest}
mkdir $(pwd)/data
wget -O $(pwd)/data/AUD_MW_E.264 \
https://fate-suite.libav.org/h264-conformance/AUD_MW_E.264
VIDEO=$(getent group video | sed -E 's,^video:[^:]*:([^:]*):.*$,\1,')
docker run \
--group-add ${VIDEO} \
--rm \
--device=/dev/dri \
-e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \
@ -164,7 +191,9 @@ TAG=${TAG:-latest}
mkdir $(pwd)/data
wget -O $(pwd)/data/TearsOfSteel.mp4 \
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4
VIDEO=$(getent group video | sed -E 's,^video:[^:]*:([^:]*):.*$,\1,')
docker run \
--group-add ${VIDEO} \
--rm \
--device=/dev/dri \
-e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \
@ -180,7 +209,9 @@ The examples below are all assumed to be running in the container's environment:
```bash
TAG=${TAG:-latest}
VIDEO=$(getent group video | sed -E 's,^video:[^:]*:([^:]*):.*$,\1,')
docker run \
--group-add ${VIDEO} \
--rm \
--device=/dev/dri \
-e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \