Skip to content

Commit f80f709

Browse files
authored
Merge pull request #115 from intel/update-branch
feat: add twl setup script (#329)
2 parents 6d3de81 + 542a909 commit f80f709

File tree

7 files changed

+507
-7
lines changed

7 files changed

+507
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ Based on the platform you are using, select the following to get started:
99
## Platform
1010
1. [Intel® Processor (Products formerly Alder Lake-N)](platforms/atom/adln#intel-processor-products-formerly-alder-lake-n)
1111
2. [Intel Atom® Processor X Series (Products formerly Amston Lake)](platforms/atom/asl#intel-atom-processor-x-series-products-formerly-known-as-amston-lake)
12-
3. [Intel® Core™ Processors (13th gen) (Product formerly Raptor Lake-P)](platforms/core/rpl/rplp#intel-core-processors-products-formerly-raptor-lake-p)
13-
4. [Intel® Core™ Processors (14th gen) (Product formerly Raptor Lake-S Refresh)](platforms/core/rpl/rpls#intel-core-processors-products-formerly-raptor-lake-s)
14-
5. [Intel® Core™ Ultra Processor (Products formerly Meteor Lake-UH)](platforms/coreultra/mtluh#intel-core-ultra-processors-products-formerly-meteor-lake)
15-
6. [Intel® Core™ Ultra Processors (Series 2) (Products formerly known as Arrow Lake)](platforms/coreultra/arluh/README.md#intel-core-ultra-processors-products-formerly-known-as-arrowlake-uh)
16-
7. [Intel® Core™ Ultra Processors (Series 2) (Products formerly known as Lunar Lake)](platforms/coreultra/lnl/README.md#intel-core-ultra-processors-products-formerly-known-as-lunarlake)
17-
8. [4th Generation Intel® Xeon® Scalable Processors (Products formerly Sapphire Rapids)](platforms/xeon/sprsp#4th-generation-intel-xeon-scalable-processors-products-formerly-sapphire-rapids)
18-
9. [4th Generation Intel® Xeon® Scalable Processors (Products formerly Sapphire Rapids Edge Enhanced)](platforms/xeon/spree#4th-generation-intel-xeon-scalable-processors-products-formerly-sapphire-rapids-edge-enhanced)
12+
3. [Intel® Core™ Processor N-series (Products formerly known as Twin Lake](platforms/atom/twl/README.md#intel-core-processor-n-series-products-formerly-known-as-twin-lake)
13+
4. [Intel® Core™ Processors (13th gen) (Product formerly Raptor Lake-P)](platforms/core/rpl/rplp#intel-core-processors-products-formerly-raptor-lake-p)
14+
5. [Intel® Core™ Processors (14th gen) (Product formerly Raptor Lake-S Refresh)](platforms/core/rpl/rpls#intel-core-processors-products-formerly-raptor-lake-s)
15+
6. [Intel® Core™ Ultra Processor (Products formerly Meteor Lake-UH)](platforms/coreultra/mtluh#intel-core-ultra-processors-products-formerly-meteor-lake)
16+
7. [Intel® Core™ Ultra Processors (Series 2) (Products formerly known as Arrow Lake)](platforms/coreultra/arluh/README.md#intel-core-ultra-processors-products-formerly-known-as-arrowlake-uh)
17+
8. [Intel® Core™ Ultra Processors (Series 2) (Products formerly known as Lunar Lake)](platforms/coreultra/lnl/README.md#intel-core-ultra-processors-products-formerly-known-as-lunarlake)
18+
9. [4th Generation Intel® Xeon® Scalable Processors (Products formerly Sapphire Rapids)](platforms/xeon/sprsp#4th-generation-intel-xeon-scalable-processors-products-formerly-sapphire-rapids)
19+
10. [4th Generation Intel® Xeon® Scalable Processors (Products formerly Sapphire Rapids Edge Enhanced)](platforms/xeon/spree#4th-generation-intel-xeon-scalable-processors-products-formerly-sapphire-rapids-edge-enhanced)
1920

2021
## GPU
2122
1. [Intel® Arc™ A-Series Graphics](gpu/arc/dg2#intel-arc-a-series-graphics-products-formerly-alchemist)

platforms/atom/twl/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Intel® Core™ Processor N-series (Products formerly known as Twin Lake)
2+
3+
## Requirements
4+
5+
#### Validated Hardware
6+
- AAEON RS-UPN-ADLN355-A10-0864
7+
8+
## Quick Start
9+
10+
### 1. Install operating system
11+
12+
Install the latest [Ubuntu* Desktop 24.04.1 LTS](https://ubuntu.com/download/desktop/thank-you?version=24.04.1&architecture=amd64&lts=true). Refer to the [Ubuntu Desktop installation tutorial](https://ubuntu.com/tutorials/install-ubuntu-desktop) if needed.
13+
14+
### 2. Download scripts
15+
16+
This step will download all reference scripts from the repository.
17+
18+
```bash
19+
git clone https://github.com/intel/edge-developer-kit-reference-scripts
20+
```
21+
22+
### 3. Go to specific setup directory
23+
24+
This step will redirect user to the current platform setup directory
25+
26+
```bash
27+
cd edge-developer-kit-reference-scripts/platforms/atom/twl
28+
```
29+
30+
### 4. Run setup script
31+
32+
This step will configure the basic setup of the platform. Make sure all of the requirements have been met before proceed to the next step.
33+
34+
```bash
35+
./setup.sh
36+
```
37+
38+
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:
39+
40+
> ✓ Platform configured
41+
42+
43+
## Next Steps
44+
45+
Refer to the available use cases and examples below
46+
47+
1. [Setup Intel® Distribution of OpenVINO™ toolkit in Docker](usecases/openvino/README.md)

platforms/atom/twl/setup.sh

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
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_VERSION="6.6-intel"
12+
13+
# symbol
14+
S_VALID=""
15+
#S_INVALID="✗"
16+
17+
# verify current user
18+
if [ "$EUID" -eq 0 ]; then
19+
echo "Must not run with sudo or root user"
20+
exit 1
21+
fi
22+
23+
# resolve scripts directory
24+
SOURCE="${BASH_SOURCE[0]}"
25+
while [ -h "$SOURCE" ]; do
26+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
27+
SOURCE="$(readlink "$SOURCE")"
28+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
29+
done
30+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
31+
32+
install_packages(){
33+
local PACKAGES=("$@")
34+
local INSTALL_REQUIRED=0
35+
for PACKAGE in "${PACKAGES[@]}"; do
36+
INSTALLED_VERSION=$(dpkg-query -W -f='${Version}' "$PACKAGE" 2>/dev/null || true)
37+
LATEST_VERSION=$(apt-cache policy "$PACKAGE" | grep Candidate | awk '{print $2}')
38+
39+
if [ -z "$INSTALLED_VERSION" ] || [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
40+
echo "$PACKAGE is not installed or not the latest version."
41+
INSTALL_REQUIRED=1
42+
fi
43+
done
44+
if [ $INSTALL_REQUIRED -eq 1 ]; then
45+
sudo -E apt update
46+
sudo -E apt install -y "${PACKAGES[@]}"
47+
fi
48+
}
49+
50+
verify_dependencies(){
51+
echo -e "# Verifying dependencies"
52+
DEPENDENCIES_PACKAGES=(
53+
git
54+
curl
55+
wget
56+
clinfo
57+
)
58+
install_packages "${DEPENDENCIES_PACKAGES[@]}"
59+
echo "$S_VALID Dependencies installed"
60+
}
61+
62+
verify_intel_gpu_package_repo(){
63+
if [ ! -e /etc/apt/sources.list.d/intel-gpu-jammy.list ]; then
64+
echo "Adding Intel GPU repository"
65+
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
66+
sudo gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
67+
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu noble client" | \
68+
sudo tee /etc/apt/sources.list.d/intel-gpu-noble.list
69+
sudo -E apt update
70+
fi
71+
}
72+
73+
verify_igpu_driver(){
74+
# TODO: verify if same iGPU driver setup can use for dGPU
75+
echo -e "Verifying iGPU driver"
76+
77+
# verify compute and media runtimes
78+
if [ -z "$(clinfo | grep 'Driver Version' | awk '{print $NF}')" ]; then
79+
verify_intel_gpu_package_repo
80+
IGPU_PACKAGES=(
81+
libze-intel-gpu1
82+
intel-gsc
83+
intel-opencl-icd
84+
libze-dev
85+
intel-ocloc
86+
libze1
87+
clinfo
88+
vainfo
89+
hwinfo
90+
)
91+
install_packages "${IGPU_PACKAGES[@]}"
92+
if ! id -nG "$USER" | grep -q -w '\<video\>'; then
93+
echo "Adding current user to 'video' group"
94+
sudo usermod -aG video "$USER"
95+
fi
96+
if ! id -nG "$USER" | grep -q '\<render\>'; then
97+
echo "Adding current user to 'render' group"
98+
sudo usermod -aG render "$USER"
99+
fi
100+
fi
101+
}
102+
103+
install_kernel_overlay() {
104+
echo -e "## Install User Space Components"
105+
sudo apt -y update
106+
sudo apt -y upgrade
107+
108+
echo -e "### Add download link into /etc/apt/sources.list.d/intel-asladln.list"
109+
sudo touch /etc/apt/sources.list.d/intel-asladln.list
110+
echo -e "deb https://download.01.org/intel-linux-overlay/ubuntu noble main non-free multimedia kernels\n\
111+
deb-src https://download.01.org/intel-linux-overlay/ubuntu noble main non-free multimedia kernels" | sudo tee /etc/apt/sources.list.d/intel-asladln.list
112+
113+
echo -e "### Download the GPG key to /etc/apt/trusted.gpg.d and rename it to asladln.gpg"
114+
sudo wget https://download.01.org/intel-linux-overlay/ubuntu/E6FA98203588250569758E97D176E3162086EE4C.gpg -O /etc/apt/trusted.gpg.d/asladln.gpg
115+
116+
echo -e "### Set the preferred list in /etc/apt/preferences.d/intel-asladln"
117+
sudo touch /etc/apt/preferences.d/intel-asladln
118+
echo -e "Package: *\n\
119+
Pin: release o=intel-iot-linux-overlay-noble\n\
120+
Pin-Priority: 2000" | sudo tee /etc/apt/preferences.d/intel-asladln
121+
122+
echo -e "## Install Kernel Overlay"
123+
sudo apt -y update
124+
sudo apt -y install linux-image-6.6-intel
125+
sudo apt -y install linux-headers-6.6-intel
126+
sudo apt -y install linux-libc-dev
127+
128+
echo -e "## Update grub"
129+
sudo sed -i 's/^GRUB_DEFAULT=.*$/GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 6.6-intel"/' /etc/default/grub
130+
sudo update-grub
131+
132+
echo "System reboot is required. Re-run the script after reboot"
133+
exit 0
134+
}
135+
136+
verify_platform() {
137+
echo -e "\n# Verifying platform"
138+
CPU_MODEL=$(< /proc/cpuinfo grep -m1 "model name" | cut -d: -f2 | sed 's/^[ \t]*//')
139+
echo "- CPU model: $CPU_MODEL"
140+
}
141+
142+
verify_gpu() {
143+
echo -e "\n# Verifying GPU"
144+
DGPU="$(lspci | grep VGA | grep Intel -c)"
145+
146+
if [ "$DGPU" -ge 1 ]; then
147+
if [ ! -e "/dev/dri" ]; then
148+
IGPU=1
149+
else
150+
IGPU="$(find /dev/dri -maxdepth 1 -type c -name 'renderD128*' | wc -l)"
151+
fi
152+
fi
153+
if [ -e "/dev/dri" ]; then
154+
IGPU="$(find /dev/dri -maxdepth 1 -type c -name 'renderD128*' | wc -l)"
155+
fi
156+
157+
if [ "$DGPU" -ge 2 ]; then
158+
GPU_STAT_LABEL="- iGPU\n-dGPU (default)"
159+
echo kern_upgrade_dgpu
160+
else
161+
if [ "$IGPU" -lt 1 ]; then
162+
GPU_STAT_LABEL="- n/a"
163+
else
164+
GPU_STAT_LABEL="- iGPU (default)"
165+
fi
166+
fi
167+
echo -e "$GPU_STAT_LABEL"
168+
}
169+
170+
verify_os() {
171+
echo -e "\n# Verifying operating system"
172+
if [ ! -e /etc/os-release ]; then
173+
echo "Error: /etc/os-release file not found"
174+
exit 1
175+
fi
176+
CURRENT_OS_ID=$(grep -E '^ID=' /etc/os-release | cut -d'=' -f2- | tr -d '"')
177+
CURRENT_OS_VERSION=$(grep -E '^VERSION_ID=' /etc/os-release | cut -d'=' -f2- | tr -d '"')
178+
if [ "$OS_ID" != "$CURRENT_OS_ID" ] || [ "$OS_VERSION" != "$CURRENT_OS_VERSION" ]; then
179+
echo "Error: OS is not supported. Please make sure $OS_ID $OS_VERSION is installed"
180+
exit 1
181+
fi
182+
echo "$S_VALID OS version: $CURRENT_OS_ID $CURRENT_OS_VERSION"
183+
}
184+
185+
verify_kernel() {
186+
echo -e "\n# Verifying kernel version"
187+
CURRENT_KERNEL_VERSION=$(uname -r | cut -d'-' -f1)
188+
CURRENT_KERNEL_REVISION=$(uname -r | cut -d'-' -f2)
189+
CURRENT_KERNEL_VERSION_REVISION="$CURRENT_KERNEL_VERSION-$CURRENT_KERNEL_REVISION"
190+
191+
if [ "$CURRENT_KERNEL_VERSION_REVISION" != "$KERNEL_VERSION" ]; then
192+
echo -e "Current Kernel: $CURRENT_KERNEL_VERSION_REVISION"
193+
echo -e "To be install: $KERNEL_VERSION"
194+
install_kernel_overlay
195+
elif [ "$CURRENT_KERNEL_VERSION_REVISION" == "$KERNEL_VERSION" ]; then
196+
echo -e "Current Kernel: $CURRENT_KERNEL_VERSION_REVISION"
197+
echo -e "Kernel Updated"
198+
else
199+
# TODO: option to install kernel via verify_custom_build_kernel
200+
echo "Error: Custom build kernel not yet supported."
201+
exit 1
202+
fi
203+
echo "$S_VALID Kernel version: $(uname -r)"
204+
}
205+
206+
verify_drivers() {
207+
echo -e "\n# Verifying drivers"
208+
if [ "$DGPU" -ge 2 ]; then
209+
# TODO: verify_dgpu_driver for supported platform
210+
echo "Error: dGPU driver is not supported"
211+
exit 1
212+
else
213+
verify_igpu_driver
214+
fi
215+
if [ -z "$(clinfo | grep 'Driver Version' | awk '{print $NF}')" ]; then
216+
echo "Error: Failed to configure GPU driver"
217+
exit 1
218+
fi
219+
GPU_DRIVER_VERSION="$(clinfo | grep 'Driver Version' | awk '{print $NF}')"
220+
echo "$S_VALID Intel GPU Drivers: $GPU_DRIVER_VERSION"
221+
}
222+
223+
setup() {
224+
verify_dependencies
225+
verify_platform
226+
verify_gpu
227+
verify_os
228+
verify_kernel
229+
verify_drivers
230+
231+
echo -e "\n# Status"
232+
echo "$S_VALID Platform configured"
233+
}
234+
235+
setup
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Intel® Distribution of OpenVINO™ toolkit
2+
3+
## Requirement
4+
### Validated Hardware
5+
- AAEON RS-UPN-ADLN355-A10-0864
6+
7+
## Pre-requisites
8+
- Platform reference setup script installed. Refer to [README.md](../../README.md)
9+
- Docker version 24 or later installed
10+
11+
## Quick Start
12+
### 1. Run the setup script
13+
This script will create 2 docker images: OpenVINO™ docker image and OpenVINO™ Notebooks docker image.
14+
```bash
15+
source setup.sh
16+
```
17+
During installation, it may ask you to reboot your system. Reboot the system and run `source setup.sh` again. Installation is completed when you see this message:
18+
> ✓ OpenVINO™ use case Installed
19+
20+
When you run command `docker images`, you can see the following example:
21+
```
22+
REPOSITORY TAG IMAGE ID CREATED SIZE
23+
openvino_notebook/ubuntu24_dev latest 5d337de8990a 46 minutes ago 5.57GB
24+
openvino_igpu/ubuntu24_dev latest d283c46d13e2 7 weeks ago 4.92GB
25+
```
26+
27+
## Run Docker Image
28+
### OpenVINO™ Toolkit
29+
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.
30+
```bash
31+
docker run -it -u root -d --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_igpu/ubuntu24_dev:latest
32+
```
33+
34+
- --name: container name
35+
- -v: mount from local source directory to container destination directory
36+
- --device: Add device to container
37+
- --group-add: Add additional groups
38+
- -w: The default working directory inside the container
39+
40+
2. Run following command to login into container:
41+
```bash
42+
docker exec -it openvino_app /bin/bash
43+
```
44+
45+
3. Now you can run your application with OpenVINO™
46+
47+
### OpenVINO™ Notebooks
48+
1. Run this command to launch OpenVINO™ Notebooks
49+
```bash
50+
./launch_notebooks.sh
51+
```
52+
2. Copy the URL printed in the terminal and open in a browser. Example output you will see in terminal:
53+
```
54+
To access the server, open this file in a browser:
55+
file:///root/.local/share/jupyter/runtime/jpserver-9-open.html
56+
Or copy and paste one of these URLs:
57+
http://b8c40fbc24fb:8888/lab?token=b149317e478f523c06600b78b67abf9db230a8af709009e7
58+
http://127.0.0.1:8888/lab?token=b149317e478f523c06600b78b67abf9db230a8af709009e7
59+
```
60+
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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Copyright (C) 2024 Intel Corporation
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
7+
sudo gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
8+
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu noble client" | \
9+
sudo tee /etc/apt/sources.list.d/intel-gpu-noble.list
10+
sudo -E apt update
11+
12+
sudo -E apt install -y \
13+
libze-intel-gpu1 intel-gsc intel-opencl-icd libze-dev intel-ocloc libze1 clinfo vainfo hwinfo

0 commit comments

Comments
 (0)