Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: IGT container launches monitoring for all available devices #30

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion benchmark-scripts/Dockerfile.igt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2023 Intel Corporation.
# Copyright (C) 2024 Intel Corporation.
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -34,3 +34,6 @@ WORKDIR /igt
RUN git config --global http.proxy $HTTP_PROXY; git clone https://gitlab.freedesktop.org/drm/igt-gpu-tools.git; cd igt-gpu-tools; git checkout 2b29e8ac07fbcfadc48b9d60e4d736a6e3b289ab

RUN cd igt-gpu-tools; meson build; ninja -C build; cd build; ninja install
COPY igt-entrypoint.sh entrypoint.sh

ENTRYPOINT [ "./entrypoint.sh" ]
39 changes: 39 additions & 0 deletions benchmark-scripts/igt-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
#
# Copyright (C) 2024 Intel Corporation.
#
# SPDX-License-Identifier: Apache-2.0
#

# shellcheck disable=SC2086 # Intended work splitting
devices=$(/usr/local/bin/intel_gpu_top -L | grep card | awk '{print $1,$5;}' | sed ":a;N;s/\n/@/g")
echo "devices found $devices"

if [ -z "$devices" ]
then
echo "No valid GPU devices found"
exit 1
fi

IFS='@'
for device in $devices
do
# shellcheck disable=SC2086 # Intended work splitting
dev=$(echo $device | awk '{print $1}')
echo "$dev"
# shellcheck disable=SC2086 # Intended work splitting
deviceId=$(echo $device | awk '{print $2}' | sed -E 's/.*?device=//' | cut -f1 -d",")
echo "$deviceId"
# shellcheck disable=SC2086 # Intended work splitting
deviceNum=$(echo $dev | sed -E 's/.*?card//')
echo "device number: $deviceNum"
# shellcheck disable=SC2086 # Intended work splitting
/usr/local/bin/intel_gpu_top -d pci:card=$deviceNum -J -s 1000 > /tmp/results/igt$deviceNum-$deviceId.json &
echo "Starting igt capture for $device in igt$deviceNum-$deviceId.json"
done

while true
do
echo "Capturing igt metrics"
sleep 15
done
Loading