Skip to content

Commit 6529cb6

Browse files
authored
Merge pull request #112 from intel/update-branch
feat: Support for bmg (#316)
2 parents 996d73d + 00280c0 commit 6529cb6

File tree

7 files changed

+504
-0
lines changed

7 files changed

+504
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Based on the platform you are using, select the following to get started:
1919

2020
## GPU
2121
1. [Intel® Arc™ A-Series Graphics](gpu/arc/dg2#intel-arc-a-series-graphics-products-formerly-alchemist)
22+
1. [Intel® Arc™ B-Series Graphics](gpu/arc/bmg#intel-arc-b-series-graphics-products-formerly-battlemage)
2223
2. [Intel® Data Center GPU Flex Series](gpu/flex/ats#intel-data-center-gpu-flex-series-products-formerly-arctic-sound)
2324

2425
## Use Cases

gpu/arc/bmg/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Intel® Arc™ B-Series Graphics (Products formerly Battlemage)
2+
3+
## Requirement
4+
### Validated Hardware
5+
- Asrock iEPF-9030S-EY4 + Intel® Arc™ B580 Graphics
6+
7+
## Pre-requisite
8+
- Enable resizable bar option in BIOS settings
9+
10+
## Quick Start
11+
### 1. Install operating system
12+
Install the latest [Ubuntu* 24.04 LTS Desktop](https://releases.ubuntu.com/noble/). Refer to [Ubuntu Desktop installation tutorial](https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview) if needed.
13+
14+
> **Note**
15+
> Please ensure that your display cable is connected to the dgpu
16+
17+
### 2. Download scripts
18+
This step will download the setup script to your current directory
19+
```bash
20+
wget https://raw.githubusercontent.com/intel/edge-developer-kit-reference-scripts/refs/heads/main/gpu/bmg/setup.sh
21+
```
22+
23+
### 3. Run the setup script
24+
This step will configure the basic setup of the platform. Make sure to run the script with **privileged access** and ensure that all of the requirements have been met before proceeding to the next step.
25+
```bash
26+
sudo bash setup.sh
27+
```
28+
After completing the setup, please reboot the system in order for the setup to be completed.
29+
30+
## Next Steps
31+
1. [Intel® Distribution of OpenVINO™ Toolkit](usecases/openvino/README.md)

gpu/arc/bmg/setup.sh

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
#!/bin/bash
2+
3+
# Copyright (C) 2024 Intel Corporation
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
set -e
7+
8+
# BKC
9+
OS_ID="ubuntu"
10+
OS_VERSION="24.04"
11+
KERNEL_PACKAGE_NAME="linux-image-6.11.0-1007-oem"
12+
13+
# symbol
14+
S_VALID=""
15+
#S_INVALID="✗"
16+
17+
# verify current user
18+
if [ ! "$EUID" -eq 0 ]; then
19+
echo "Please run with sudo or root user"
20+
exit 1
21+
fi
22+
23+
install_packages(){
24+
local PACKAGES=("$@")
25+
local INSTALL_REQUIRED=0
26+
for PACKAGE in "${PACKAGES[@]}"; do
27+
INSTALLED_VERSION=$(dpkg-query -W -f='${Version}' "$PACKAGE" 2>/dev/null || true)
28+
LATEST_VERSION=$(apt-cache policy "$PACKAGE" | grep Candidate | awk '{print $2}')
29+
30+
if [ -z "$INSTALLED_VERSION" ] || [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
31+
echo "$PACKAGE is not installed or not the latest version."
32+
INSTALL_REQUIRED=1
33+
fi
34+
done
35+
if [ $INSTALL_REQUIRED -eq 1 ]; then
36+
apt update
37+
apt install -y "${PACKAGES[@]}"
38+
fi
39+
}
40+
41+
verify_kernel_package() {
42+
echo -e "Verifying kernel package"
43+
LATEST_KERNEL_VERSION=$(apt-cache madison $KERNEL_PACKAGE_NAME | awk '{print $3}' | sort -V | tail -n 1 | tr '-' '.')
44+
CURRENT_KERNEL_VERSION_INSTALLED=$(dpkg -l | grep "^ii.*$KERNEL_PACKAGE_NAME" | awk '{print $3}' | sort -V | tail -n 1 | tr '-' '.')
45+
LATEST_KERNEL_INSTALLED=$(dpkg -l | grep "^ii.*$KERNEL_PACKAGE_NAME" | grep -E "${LATEST_KERNEL_VERSION}[^ ]*" | awk '{print $3}' | tr '-' '.')
46+
47+
# extract flavour name
48+
KERNEL_FLAVOUR=""
49+
if [[ $KERNEL_PACKAGE_NAME == *"generic"* ]]; then
50+
KERNEL_FLAVOUR="generic"
51+
elif [[ $KERNEL_PACKAGE_NAME == *"oem"* ]]; then
52+
KERNEL_FLAVOUR="oem"
53+
elif [[ $KERNEL_PACKAGE_NAME == *"intel-iotg"* ]]; then
54+
KERNEL_FLAVOUR="intel-iotg"
55+
fi
56+
57+
if [ -z "$LATEST_KERNEL_INSTALLED" ]; then
58+
echo "Installing latest '${KERNEL_PACKAGE_NAME}' kernel"
59+
KERNEL_PACKAGES=("${KERNEL_PACKAGE_NAME}")
60+
install_packages "${KERNEL_PACKAGES[@]}"
61+
fi
62+
if [[ ! "$LATEST_KERNEL_VERSION" == *"$CURRENT_KERNEL_VERSION_REVISION"* ]]; then
63+
if dpkg -l | grep -q 'linux-image.*generic$' && [ "$KERNEL_FLAVOUR" != "generic" ]; then
64+
echo "Removing generic kernel"
65+
apt remove -y --auto-remove linux-image-generic-hwe-$OS_VERSION
66+
DEBIAN_FRONTEND=noninteractive apt purge -y 'linux-image-*-generic'
67+
elif dpkg -l | grep -q 'linux-image.*iotg$' && [ "$KERNEL_FLAVOUR" != "intel-iotg" ]; then
68+
echo "Removing Intel IoT kernel"
69+
apt remove -y --auto-remove linux-image-intel-iotg
70+
DEBIAN_FRONTEND=noninteractive apt purge -y 'linux-image-*-iotg'
71+
elif dpkg -l | grep -q 'linux-image.*oem$' && [ "$KERNEL_FLAVOUR" != "oem" ]; then
72+
echo "Removing OEM kernel"
73+
DEBIAN_FRONTEND=noninteractive apt purge -y 'linux-image-*-oem'
74+
fi
75+
echo "Running kernel version: $CURRENT_KERNEL_VERSION_REVISION"
76+
echo "Installed kernel version: $CURRENT_KERNEL_VERSION_INSTALLED"
77+
fi
78+
}
79+
80+
verify_intel_gpu_package_repo(){
81+
if [ ! -e /etc/apt/sources.list.d/intel-gpu-jammy.list ]; then
82+
echo "Adding Intel GPU repository"
83+
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
84+
gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
85+
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu noble client" | \
86+
tee /etc/apt/sources.list.d/intel-gpu-noble.list
87+
apt update
88+
fi
89+
}
90+
91+
verify_dgpu_driver(){
92+
echo -e "Verifying dGPU driver"
93+
94+
verify_intel_gpu_package_repo
95+
DGPU_PACKAGES=(
96+
libze-intel-gpu1
97+
libze1
98+
intel-opencl-icd
99+
clinfo
100+
intel-gsc
101+
)
102+
install_packages "${DGPU_PACKAGES[@]}"
103+
if ! id -nG "$USER" | grep -q -w '\<video\>'; then
104+
echo "Adding current user to 'video' group"
105+
usermod -aG video "$USER"
106+
fi
107+
if ! id -nG "$USER" | grep -q '\<render\>'; then
108+
echo "Adding current user to 'render' group"
109+
usermod -aG render "$USER"
110+
fi
111+
112+
}
113+
# verify platform
114+
verify_platform() {
115+
echo -e "\n# Verifying platform"
116+
CPU_MODEL=$(< /proc/cpuinfo grep -m1 "model name" | cut -d: -f2 | sed 's/^[ \t]*//')
117+
echo "- CPU model: $CPU_MODEL"
118+
}
119+
120+
verify_gpu() {
121+
echo -e "\n# Verifying GPU"
122+
DGPU="$(lspci | grep -E 'VGA|DISPLAY' | grep Intel -c)"
123+
124+
if [ "$DGPU" -ge 1 ]; then
125+
if [ ! -e "/dev/dri" ]; then
126+
IGPU=1
127+
else
128+
IGPU="$(find /dev/dri -maxdepth 1 -type c -name 'renderD128*' | wc -l)"
129+
fi
130+
fi
131+
if [ -e "/dev/dri" ]; then
132+
IGPU="$(find /dev/dri -maxdepth 1 -type c -name 'renderD128*' | wc -l)"
133+
fi
134+
135+
if [ "$DGPU" -ge 2 ]; then
136+
GPU_STAT_LABEL="- iGPU\n- dGPU"
137+
else
138+
if [ "$IGPU" -lt 1 ]; then
139+
GPU_STAT_LABEL="- n/a"
140+
else
141+
GPU_STAT_LABEL="- iGPU (default)"
142+
fi
143+
fi
144+
echo -e "$GPU_STAT_LABEL"
145+
}
146+
147+
verify_os() {
148+
echo -e "\n# Verifying operating system"
149+
if [ ! -e /etc/os-release ]; then
150+
echo "Error: /etc/os-release file not found"
151+
exit 1
152+
fi
153+
CURRENT_OS_ID=$(grep -E '^ID=' /etc/os-release | cut -d'=' -f2- | tr -d '"')
154+
CURRENT_OS_VERSION=$(grep -E '^VERSION_ID=' /etc/os-release | cut -d'=' -f2- | tr -d '"')
155+
if [ "$OS_ID" != "$CURRENT_OS_ID" ] || [ "$OS_VERSION" != "$CURRENT_OS_VERSION" ]; then
156+
echo "Error: OS is not supported. Please make sure $OS_ID $OS_VERSION is installed"
157+
exit 1
158+
fi
159+
echo "$S_VALID OS version: $CURRENT_OS_ID $CURRENT_OS_VERSION"
160+
}
161+
162+
# verify kernel
163+
verify_kernel() {
164+
echo -e "\n# Verifying kernel version"
165+
CURRENT_KERNEL_VERSION=$(uname -r | cut -d'-' -f1)
166+
CURRENT_KERNEL_REVISION=$(uname -r | cut -d'-' -f2)
167+
CURRENT_KERNEL_VERSION_REVISION="$CURRENT_KERNEL_VERSION.$CURRENT_KERNEL_REVISION"
168+
169+
if [[ -n "$KERNEL_PACKAGE_NAME" ]]; then
170+
verify_kernel_package
171+
else
172+
echo "Error: Custom build kernel not yet supported."
173+
exit 1
174+
fi
175+
echo "$S_VALID Kernel version: $(uname -r)"
176+
}
177+
178+
# verify drivers
179+
verify_drivers() {
180+
echo -e "\n# Verifying drivers"
181+
verify_dgpu_driver
182+
183+
if [ -z "$(clinfo | grep 'Driver Version' | awk '{print $NF}')" ]; then
184+
echo "Error: Failed to configure GPU driver"
185+
exit 1
186+
fi
187+
188+
echo -e "Upgrading packages"
189+
apt dist-upgrade -y
190+
}
191+
192+
setup() {
193+
# verify_dependencies
194+
verify_platform
195+
verify_gpu
196+
197+
verify_os
198+
verify_drivers
199+
verify_kernel
200+
201+
GPU_DRIVER_VERSION="$(clinfo | grep 'Device Name\|Driver Version' | head -n4)"
202+
echo -e "$S_VALID Intel GPU Drivers:\n$GPU_DRIVER_VERSION"
203+
204+
echo -e "\n# Status"
205+
echo "$S_VALID Platform configured"
206+
echo "System reboot is required."
207+
}
208+
209+
setup
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Intel® Distribution of OpenVINO™ toolkit
2+
3+
## Requirement
4+
### Validated Hardware
5+
- Asrock iEPF-9030S-EY4 + Intel® Arc™ B580 Graphics
6+
7+
## Pre-requisites
8+
- GPU reference setup script installed. Refer to [README.md](../../README.md)
9+
- Docker version 24 or later installed
10+
11+
## Quick Start
12+
### 1. Go to OpenVINO™ usecase directory
13+
```bash
14+
cd edge-developer-kit-reference-scripts/arc/bmg/usecases/openvino
15+
```
16+
17+
### 2. Run the setup script
18+
This script will create 2 docker images: OpenVINO™ docker image and OpenVINO™ Notebooks docker image.
19+
```bash
20+
./setup.sh
21+
```
22+
During installation, it may ask you to reboot your system. Reboot the system and run `./setup.sh` again. Installation is completed when you see this message:
23+
> ✓ OpenVINO™ use case Installed
24+
25+
When you run command `docker images`, you can see the following example:
26+
```
27+
REPOSITORY TAG IMAGE ID CREATED SIZE
28+
openvino_notebook/ubuntu24_dev latest f22588c53ada About a minute ago 5.56GB
29+
openvino_dgpu/ubuntu24_dev latest c250d3d6e260 8 minutes ago 4.75GB
30+
```
31+
32+
## Run Docker Image
33+
### OpenVINO™ Toolkit
34+
1. Run this command to launch docker container with OpenVINO™ image and link to your working directory. For this instance, the working directory is in /home/user/workspace and it mount to container /data/workspace directory.
35+
```bash
36+
docker run -it -d -u openvino -u root --name openvino_app -v /etc/group:/etc/group --device=/dev/dri --group-add=$(stat -c "%g" /dev/dri/render* | head -n 1) -v /usr/bin:/usr/bin -v /home/user/workspace:/data/workspace -w /data/workspace openvino_dgpu/ubuntu24_dev:latest
37+
```
38+
39+
- --name: container name
40+
- -v: mount from local source directory to container destination directory
41+
- --device: Add device to container
42+
- --group-add: Add additional groups
43+
- -w: The default working directory inside the container
44+
45+
2. Run following command to login into container:
46+
```bash
47+
docker exec -it openvino_app /bin/bash
48+
```
49+
50+
3. Now you can run your application with OpenVINO™
51+
52+
### OpenVINO™ Notebooks
53+
1. Run this command to launch OpenVINO™ Notebooks
54+
```bash
55+
./launch_notebooks.sh
56+
```
57+
2. Copy the URL printed in the terminal and open in a browser. Example output you will see in terminal:
58+
```
59+
To access the server, open this file in a browser:
60+
file:///opt/app-root/src/.local/share/jupyter/runtime/jpserver-20-open.html
61+
Or copy and paste one of these URLs:
62+
http://8adf267b0a6a:8888/lab?token=7d150b3a8d4157f1068c85d582eff346cce28e24cd2e9a85
63+
http://127.0.0.1:8888/lab?token=7d150b3a8d4157f1068c85d582eff346cce28e24cd2e9a85
64+
```
65+
3. Open your browser and paste the URL. You will see openvino_notebooks directory and it has a lot of sample to try out.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
# Copyright (C) 2024 Intel Corporation
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
# Install the Intel graphics GPG public key
7+
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
8+
sudo gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
9+
10+
# Configure the repositories.intel.com package repository
11+
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu noble client" | \
12+
sudo tee /etc/apt/sources.list.d/intel-gpu-noble.list
13+
14+
# Update the package repository meta-data
15+
sudo apt update
16+
17+
# Install the compute-related packages
18+
sudo apt-get install -y libze-intel-gpu1 libze1 intel-opencl-icd clinfo intel-gsc
19+
20+
# Install compute runtime
21+
mkdir -p /tmp/neo_temp
22+
cd /tmp/neo_temp || exit
23+
wget https://github.com/intel/intel-graphics-compiler/releases/download/v2.5.6/intel-igc-core-2_2.5.6+18417_amd64.deb
24+
wget https://github.com/intel/intel-graphics-compiler/releases/download/v2.5.6/intel-igc-opencl-2_2.5.6+18417_amd64.deb
25+
wget https://github.com/intel/compute-runtime/releases/download/24.52.32224.5/intel-level-zero-gpu-dbgsym_1.6.32224.5_amd64.ddeb
26+
wget https://github.com/intel/compute-runtime/releases/download/24.52.32224.5/intel-level-zero-gpu_1.6.32224.5_amd64.deb
27+
wget https://github.com/intel/compute-runtime/releases/download/24.52.32224.5/intel-opencl-icd-dbgsym_24.52.32224.5_amd64.ddeb
28+
wget https://github.com/intel/compute-runtime/releases/download/24.52.32224.5/intel-opencl-icd_24.52.32224.5_amd64.deb
29+
wget https://github.com/intel/compute-runtime/releases/download/24.52.32224.5/libigdgmm12_22.5.5_amd64.deb
30+
31+
echo -e "Verify sha256 sums for packages"
32+
wget https://github.com/intel/compute-runtime/releases/download/24.52.32224.5/ww52.sum
33+
sha256sum -c ww52.sum
34+
35+
echo -e "\nInstalling compute runtime as root"
36+
sudo apt remove -y intel-ocloc libze-intel-gpu1
37+
sudo dpkg -i ./*.deb
38+
39+
cd /tmp || exit
40+
echo -e "Cleaning up /tmp/neo_temp folder after installation"
41+
rm -rf neo_temp
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Copyright (C) 2024 Intel Corporation
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
CURRENT_DIRECTORY=$(pwd)
7+
echo "${CURRENT_DIRECTORY}"
8+
9+
if docker ps | grep notebooks; then
10+
echo -e "# Remove existing notebook container"
11+
docker stop notebooks
12+
sleep 5 # For removal in progress
13+
if docker ps -a | grep notebooks; then
14+
docker rm notebooks
15+
fi
16+
fi
17+
18+
docker run -t -u root -d --rm --name notebooks \
19+
-v /etc/group:/etc/group --device=/dev/dri:/dev/dri \
20+
--group-add="$(stat -c "%g" /dev/dri/render* | head -n 1)" \
21+
-v "${CURRENT_DIRECTORY}":/mnt \
22+
-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY="$DISPLAY" \
23+
-p 127.0.0.1:8888:8888 \
24+
openvino_notebook/ubuntu24_dev:latest
25+
26+
docker exec notebooks bash -c "cd /mnt/openvino_notebooks/notebooks ; jupyter-lab --allow-root --ip=127.0.0.1 --no-browser --NotebookApp.iopub_data_rate_limit=10000000"

0 commit comments

Comments
 (0)