Skip to content

Commit 80dd70c

Browse files
authored
fix: resolve hooks issue and add diarization toggle for med scribe sample (#1003) (#523)
1 parent dca27b2 commit 80dd70c

27 files changed

Lines changed: 1487 additions & 411 deletions

File tree

usecases/ai/edge-ai-demo-studio/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ Once started, access the web UI at [http://localhost:8080](http://localhost:8080
7878

7979
---
8080

81+
### Docker
82+
83+
See [docker/README.md](docker/README.md) for docker guidelines.
84+
85+
---
86+
8187

8288
## Project Structure
8389

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM ubuntu:24.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
ARG USER=ubuntu
6+
7+
COPY ./install_dependencies.sh /home/ubuntu/install_dependencies.sh
8+
9+
RUN chmod +x /home/ubuntu/install_dependencies.sh
10+
11+
# Setup sudo for ubuntu user
12+
RUN apt-get update && apt-get install -y sudo && \
13+
usermod -aG sudo ${USER} && \
14+
echo "${USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USER} && \
15+
chmod 0440 /etc/sudoers.d/${USER} && \
16+
echo 'Defaults env_keep += "http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY ftp_proxy FTP_PROXY"' > /etc/sudoers.d/proxy_env && \
17+
chmod 0440 /etc/sudoers.d/proxy_env
18+
19+
USER ${USER}
20+
21+
# Mock clinfo to simulate Intel GPU presence
22+
# Install into /usr/local/bin so it is always on the secure_path ahead of /usr/bin
23+
RUN sudo printf '%s\n' \
24+
'#!/bin/sh' \
25+
'# Check if the script is asking for device enumeration' \
26+
'if echo "$*" | grep -q "\-l"; then' \
27+
' echo "Platform #0: Intel(R) OpenCL HD Graphics"' \
28+
' echo " \`-- Device #0: Intel(R) UHD Graphics"' \
29+
'else' \
30+
' # If the real clinfo exists, pass other calls to it, else just exit 0' \
31+
' if [ -x /usr/bin/clinfo ]; then' \
32+
' exec /usr/bin/clinfo "$@"' \
33+
' fi' \
34+
' exit 0' \
35+
'fi' | sudo tee /usr/local/bin/clinfo > /dev/null && sudo chmod +x /usr/local/bin/clinfo
36+
37+
# Mock hardware and run install dependencies as ubuntu user
38+
RUN sudo mkdir -p /dev/dri && \
39+
sudo touch /dev/dri/renderD128 /dev/dri/card0 && \
40+
sudo chmod 666 /dev/dri/* && \
41+
sudo -E /home/ubuntu/install_dependencies.sh -y && \
42+
sudo rm -rf /dev/dri && \
43+
sudo rm -f /usr/local/bin/clinfo
44+
45+
COPY . /home/ubuntu
46+
RUN sudo chown -R ${USER}:${USER} /home/ubuntu
47+
RUN sudo rm -f /etc/sudoers.d/${USER}
48+
49+
WORKDIR /home/ubuntu
50+
51+
RUN ./setup.sh --verbose
52+
53+
USER ${USER}
54+
55+
CMD ["/bin/bash", "-c", "cd /home/ubuntu && ./start.sh"]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Docker setup & run
2+
3+
This document explains how to build and run the project with Docker, and how to enable GPU / NPU device passthrough.
4+
5+
1) Enable device passthrough (optional)
6+
- If your system has an NPU, uncomment the following line in `docker/compose.yml` under `devices`:
7+
- "/dev/accel:/dev/accel"
8+
- If your system has a GPU, uncomment the following line in `docker/compose.yml` under `devices`:
9+
- "/dev/dri:/dev/dri"
10+
11+
2) Build the image
12+
Run from the project root or from `docker/`:
13+
14+
```
15+
docker compose build
16+
```
17+
18+
3) Export render group ID (for GPU access) and run
19+
If you use GPU passthrough, export the `RENDER_GROUP_ID` environment variable so the container can access the render group:
20+
21+
```
22+
export RENDER_GROUP_ID=$(getent group render | awk -F: '{printf "%s\n", $3}')
23+
docker compose up -d
24+
```
25+
26+
Notes
27+
- If you don't have GPU/NPU hardware, you can leave the device lines commented; the app will still run but without hardware acceleration.
28+
- If `getent group render` returns nothing, you may need to find the appropriate group ID for your system (often `render` or `video`) or run without setting `RENDER_GROUP_ID` and adjust permissions manually.
29+
- The app is exposed on port `8080` by default; open http://localhost:8080 after the container is running.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
edge-ai-studio:
3+
build:
4+
context: ../
5+
dockerfile: docker/Dockerfile
6+
image: edge-ai-studio:v1.0.0
7+
container_name: edge-ai-studio
8+
# devices: # Uncomment if you have a GPU/NPU
9+
# - "/dev/dri:/dev/dri" # Uncomment if you have a GPU
10+
# - "/dev/accel:/dev/accel" # Uncomment if you have an NPU
11+
# group_add: # Uncomment if you have a GPU/NPU
12+
# - ${RENDER_GROUP_ID:-992} # Uncomment if you have a GPU/NPU (render group)
13+
ports:
14+
- "8080:8080"

0 commit comments

Comments
 (0)