Skip to content

Commit 915ead2

Browse files
committed
npu: add demo workload
Signed-off-by: Tuomas Katila <[email protected]>
1 parent 360c97d commit 915ead2

File tree

5 files changed

+55
-1
lines changed

5 files changed

+55
-1
lines changed

.github/workflows/lib-build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- sgx-sdk-demo
3838
- sgx-aesmd-demo
3939
- dsa-dpdk-dmadevtest
40+
- intel-npu-demo
4041
builder: [buildah, docker]
4142
steps:
4243
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ The summary of resources available via plugins in this repository is given in th
254254
* `sgx.intel.com` : `epc`
255255
* [intelsgx-job.yaml](deployments/sgx_enclave_apps/base/intelsgx-job.yaml)
256256
* `npu.intel.com` : `accel`
257-
* TODO
257+
* [intel-npu-workload.yaml](demo/intel-npu-workload.yaml)
258258

259259
## Developers
260260

demo/intel-npu-demo/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:24.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt update && apt install -y build-essential git git-lfs cmake python3 && rm -rf /var/lib/apt/lists/\*
6+
7+
RUN git clone https://github.com/intel/linux-npu-driver/ && cd linux-npu-driver && \
8+
git submodule update --init --recursive && \
9+
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -B build -S . && \
10+
cmake --build build --parallel $(nproc) && \
11+
cmake --install build && \
12+
cd .. && \
13+
rm -rf linux-npu-driver
14+
15+
COPY npu-tests.sh /
16+
17+
ENTRYPOINT [ "/npu-tests.sh" ]

demo/intel-npu-demo/npu-tests.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
echo "Run NPU tests"
4+
5+
npu-kmd-test *:-Device.GroupOwnership || exit 1
6+
7+
# use npu-umd-test -l to list all topics
8+
# note: some of the tests require the NPU compiler & openvino runtime
9+
# https://github.com/intel/linux-npu-driver/blob/main/docs/overview.md#building-a-driver-together-with-the-compiler
10+
topics="Device Driver Event EventSync MemoryAllocation MemoryExecution MemoryAllocationThreaded CommandCopyPerf MultiMemoryExecution MultiContext CommandMemoryFill"
11+
12+
for topic in $topics; do
13+
npu-umd-test -v ${topic}.* || exit 1
14+
done
15+
16+
echo "Tests done"
17+
18+
exit 0

demo/intel-npu-workload.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: npu-workload
5+
spec:
6+
template:
7+
metadata:
8+
labels:
9+
app: example-job
10+
spec:
11+
containers:
12+
- image: intel/intel-npu-demo:devel
13+
name: workload
14+
resources:
15+
limits:
16+
npu.intel.com/accel: 1
17+
restartPolicy: Never
18+
backoffLimit: 4

0 commit comments

Comments
 (0)