Skip to content

Commit

Permalink
The production Intel® Tiber™ Broadcast Suite, version 24.07 (#6)
Browse files Browse the repository at this point in the history
* Move the lcore management to mtl-manager
* Remove unnecessary MTL patch and adjust tag
* Minor update to build.md

Signed-off-by: Milosz Linkiewicz <[email protected]>
  • Loading branch information
Mionsz authored Jul 25, 2024
1 parent 494c380 commit f5b4210
Show file tree
Hide file tree
Showing 27 changed files with 90 additions and 223 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ docs/_build
_build
file*.json
.reports
pipelines/src
pipelines/*.yuv
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@
- Optimized Memory Management: Improvements in memory allocation that enhance performance and reduce latency.
- Asynchronous Execution: Video pipeline filters operate asynchronously to maximize GPU utilization.
- High-Throughput Transfers: Enhanced GPU-CPU memory data transfers for high-performance media streaming.

# Summary of Changes for Intel® Tiber™ Broadcast Suite - 24.07 Release:

What's Changed
- Move the lcore management to mtl-manager
- Remove unnecessary MTL patch and adjust tag
- Minor update to build.md
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ENV \
FFMPEG_COMMIT_ID=n6.1.1 \
XDP_VER=d7edea3590052581c5fda5f8cfa40ae7be94f05c \
BPF_VER=42065ea6627ff6e1ab4c65e51042a70fbf30ff7c \
MTL_VER=2f1c2a3be417065a4dc9276e2d7344d768e95118 \
MTL_VER=MTL_enabling_for_Intel_Tiber_Broadcast_Suite \
MCM_VER=24.06.01 \
JPEG_XS_VER=0.9.0 \
DPDK_VER=23.11
Expand Down Expand Up @@ -203,7 +203,7 @@ WORKDIR /tmp/Media-Transport-Library
RUN \
echo "**** DOWNLOAD MTL ****" && \
curl -Lf \
https://github.com/OpenVisualCloud/Media-Transport-Library/archive/${MTL_VER}.tar.gz | \
https://github.com/OpenVisualCloud/Media-Transport-Library/archive/refs/tags/${MTL_VER}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/Media-Transport-Library

WORKDIR /tmp/dpdk
Expand Down
20 changes: 20 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,23 @@ docker buildx build "${ENV_PROXY_ARGS[@]}" "$@" \
"${SCRIPT_DIR}"

docker tag "${IMAGE_REGISTRY}/tiber-broadcast-suite:${IMAGE_TAG}" video_production_image

if docker images | grep -q "mtl-manager\s*latest"; then
echo -e '\e[32mmtl-manager:latest image exists. skipping the build\e[0m'
exit 0
fi

if [ -z "$mtl_source_code" ]; then
mtl_source_code=$(find "$HOME" -type d -name "Media-Transport-Library" -print -quit)

if [ -n "$mtl_source_code" ] && [ -f "$mtl_source_code/manager/Dockerfile" ]; then
echo -e '\e[33mmtl_source_code variable is set to '"$mtl_source_code"'.\e[0m'
else
echo -e '\e[31m'"Media-Transport-Library manager directory not found in $HOME directory."'\e[0m'
echo -e '\e[33mMTL manager not installed\e[0m'
exit 0
fi
fi

cd "$mtl_source_code"/manager
docker build -t mtl-manager:latest .
20 changes: 14 additions & 6 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,20 @@ To install Flex GPU driver follow the [1.4.3. Ubuntu Install Steps](https://dgpu
> **Note:** If prompted with `Unable to locate package`, please ensure repository key `intel-graphics.key` is properly dearmored and installed as `/usr/share/keyrings/intel-graphics.gpg`.
### 1.5 Install and configure host's NIC drivers and related software
> **Note:** Links to MTL repository below contain used commit hash `2f1c2a3be417065a4dc9276e2d7344d768e95118` as a part of the link. If needed, replace it with the value from `MTL_VER` variable read in first step.

1. Gather information about currently used Media Transport Library version (commit hash) with:
1. Gather information about currently used Media Transport Library tag with:
```shell
grep "MTL_VER=" Dockerfile | awk -F "=" '{print gensub(/ \\/,"","g",$NF)}'
```
2. Clone Media Transport Library repository and checkout to the commit detected in a previous step with
2. Clone Media Transport Library repository and checkout to the tag detected in a previous step with
```shell
git clone https://github.com/OpenVisualCloud/Media-Transport-Library.git
cd Media-Transport-Library
git reset ${MTL_VER} --hard
git checkout <tag>
```
3. While in `Media-Transport-Library` folder, set `imtl_source_code` variable with:
3. While in `Media-Transport-Library` folder, set `mtl_source_code` variable with:
```shell
export imtl_source_code=${PWD}
export mtl_source_code=${PWD}
```
4. Install patched ice driver for Intel® E810 Series Ethernet Adapter NICs based on the [Intel® E810 Series Ethernet Adapter driver install steps](https://github.com/OpenVisualCloud/Media-Transport-Library/blob/2f1c2a3be417065a4dc9276e2d7344d768e95118/doc/e810.md) instruction.

Expand Down Expand Up @@ -99,6 +98,15 @@ Change number of cores used to build by make can be changed by _--build-arg npr
docker build --build-arg nproc=1 -t video_production_image -f Dockerfile .
```

Build the mtl manager docker

```shell
cd "$mtl_source_code"/manager
docker build -t mtl-manager:latest .
cd -
```


## 3. Test run the image

```shell
Expand Down
2 changes: 1 addition & 1 deletion docs/building-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,4 @@ For parameter `--cpuset-cpus` use information gathered in [Find proper NUMA node
Dedicate a set of CPUs for specific container, e.g. `--cpuset-cpus=36-56`.

### CPUs for MTL
Parameter called `MTL_PARAM_LCORES` should contain 4 CPU cores from chosen CPUset CPUs, e.g. `-e MTL_PARAM_LCORES=51-56`.
Are choosen automatically and checked with mtl_manger.
7 changes: 2 additions & 5 deletions docs/run-know-how.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ docker run -it \
-v "$(pwd)":/videos \
-v /usr/lib/x86_64-linux-gnu/dri:/usr/local/lib/x86_64-linux-gnu/dri/ \
-v /tmp/kahawai_lcore.lock:/tmp/kahawai_lcore.lock \
-v /var/run/imtl:/var/run/imtl \
-v /dev/null:/dev/null \
-v /tmp/hugepages:/tmp/hugepages \
-v /hugepages:/hugepages \
--network=my_net_801f0 \
--ip=192.168.2.2 \
--expose=20000-20170 \
--ipc=host -v /dev/shm:/dev/shm \
--cpuset-cpus=20-40 \
-e MTL_PARAM_LCORES=30-40 \
-e MTL_PARAM_DATA_QUOTA=10356 \
video_production_image [broadcast_suite_parameters]
```

Expand All @@ -48,6 +46,7 @@ docker run -it \
- `-v "$(pwd)":/videos`: Binds the current working directory on the host to `/videos` inside the container.
- `-v /usr/lib/x86_64-linux-gnu/dri:/usr/local/lib/x86_64-linux-gnu/dri/`: Mounts the host's DRI drivers into the container.
- `-v /tmp/kahawai_lcore.lock:/tmp/kahawai_lcore.lock`: Shares a lock file between the host and the container.
- `-v /var/run/imtl:/var/run/imtl`: Shares a mtl manager socket between the host and the container.
- `-v /dev/null:/dev/null`: Makes `/dev/null` available inside the container.
- `-v /tmp/hugepages:/tmp/hugepages`: Shares the hugepages directory for memory management optimizations.
- `-v /hugepages:/hugepages`: Shares another hugepages directory.
Expand All @@ -56,6 +55,4 @@ docker run -it \
- `--expose=20000-20170`: Exposes a range of ports for the container.
- `--ipc=host -v /dev/shm:/dev/shm`: Shares the host's IPC namespace and mounts the shared memory directory.
- `--cpuset-cpus=20-40`: Limits the container to specific CPUs on the host machine.
- `-e MTL_PARAM_LCORES=30-40`: Sets the `MTL_PARAM_LCORES` environment variable inside the container.
- `-e MTL_PARAM_DATA_QUOTA=10356`: Sets the `MTL_PARAM_DATA_QUOTA` environment variable inside the container.
- `video_production_image`: Specifies the Docker image to be used for the container.
25 changes: 25 additions & 0 deletions first_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,28 @@ while IFS= read -r line; do
exit 2
fi
done <<< "$output"

container_id=$(docker ps -aq -f name=^mtl-manager$)

if [ -n "$container_id" ]; then
if [ "$(docker inspect -f '{{.State.Running}}' "$container_id")" = "true" ]; then
echo -e '\e[32mContainer mtl-manager is already running.\e[0m'
else
echo -e '\e[33mContainer mtl-manager exists but is not running. Removing it...\e[0m'
docker rm "$container_id"

docker run -d \
--name mtl-manager \
--privileged --net=host \
-v /var/run/imtl:/var/run/imtl \
-v /sys/fs/bpf:/sys/fs/bpf \
mtl-manager:latest
fi
else
docker run -d \
--name mtl-manager \
--privileged --net=host \
-v /var/run/imtl:/var/run/imtl \
-v /sys/fs/bpf:/sys/fs/bpf \
mtl-manager:latest
fi
115 changes: 0 additions & 115 deletions patches/imtl/0001-Use-env-for-lcores-and-data_quota_mbs_per_sch.patch

This file was deleted.

49 changes: 0 additions & 49 deletions patches/imtl/0002-add-stability-patches-for-ffmpeg-plugin.patch

This file was deleted.

4 changes: 1 addition & 3 deletions pipelines/jpeg_xs_rx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ docker run -it \
-v /dev/null:/dev/null \
-v /tmp/hugepages:/tmp/hugepages \
-v /hugepages:/hugepages \
-v /var/run/imtl:/var/run/imtl \
--network=my_net_801f0 \
--ip=192.168.2.2 \
--expose=20000-20170 \
--ipc=host -v /dev/shm:/dev/shm \
--cpuset-cpus=20-40 \
-e MTL_PARAM_LCORES=30-40 \
-e MTL_PARAM_DATA_QUOTA=10356 \
video_production_image -y \
-p_port 0000:4b:01.2 -p_sip 192.168.2.2 -p_rx_ip 192.168.2.1 -udp_port 20000 -payload_type 112 -fps 25 -f mtl_st22p -i "0" \
-p_port 0000:4b:01.2 -p_sip 192.168.2.2 -p_rx_ip 192.168.2.1 -udp_port 20001 -payload_type 112 -fps 25 -f mtl_st22p -i "1" \
Expand Down
4 changes: 1 addition & 3 deletions pipelines/jpeg_xs_tx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ docker run -it \
-v /dev/null:/dev/null \
-v /tmp/hugepages:/tmp/hugepages \
-v /hugepages:/hugepages \
-v /var/run/imtl:/var/run/imtl \
--network=my_net_801f0 \
--ip=192.168.2.1 \
--expose=20000-20170 \
--ipc=host -v /dev/shm:/dev/shm \
--cpuset-cpus=0-20 \
-e MTL_PARAM_LCORES=10-20 \
-e MTL_PARAM_DATA_QUOTA=10356 \
video_production_image \
-video_size 1920x1080 -f rawvideo -pix_fmt yuv422p10le -i /videos/src/1080p_yuv422_10b_1.yuv \
-video_size 1920x1080 -f rawvideo -pix_fmt yuv422p10le -i /videos/src/1080p_yuv422_10b_2.yuv \
Expand Down
4 changes: 1 addition & 3 deletions pipelines/mcm_jpeg_xs_rx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ docker run -it \
-v /tmp/hugepages:/tmp/hugepages \
-v /hugepages:/hugepages \
-v /run/mcm:/run/mcm \
-v /var/run/imtl:/var/run/imtl \
--expose=20000-20170 \
--ipc=host -v /dev/shm:/dev/shm \
--cpuset-cpus=20-40 \
--net=host \
-e MTL_PARAM_LCORES=30-40 \
-e MTL_PARAM_DATA_QUOTA=10356 \
-e MCM_MEDIA_PROXY_PORT=8003 \
video_production_image -y \
-f mcm \
Expand Down
4 changes: 1 addition & 3 deletions pipelines/mcm_jpeg_xs_tx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ docker run -it \
-v /tmp/hugepages:/tmp/hugepages \
-v /hugepages:/hugepages \
-v /run/mcm:/run/mcm \
-v /var/run/imtl:/var/run/imtl \
--expose=20000-20170 \
--ipc=host -v /dev/shm:/dev/shm \
--cpuset-cpus=0-20 \
--net=host \
-e MTL_PARAM_LCORES=10-20 \
-e MTL_PARAM_DATA_QUOTA=10356 \
-e MCM_MEDIA_PROXY_PORT=8002 \
video_production_image \
-video_size 1920x1080 -f rawvideo -pix_fmt yuv422p10le -i /videos/src/1080p_yuv422_10b_1.yuv \
Expand Down
Loading

0 comments on commit f5b4210

Please sign in to comment.