Skip to content

Commit 30745da

Browse files
authored
Merge pull request #295 from intel/update-branch
feat: update xeon installation flow (#780)
2 parents 6157bd3 + cce512d commit 30745da

File tree

5 files changed

+196
-250
lines changed

5 files changed

+196
-250
lines changed

gpu_installer.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ readonly DEPENDENCIES=(
4848

4949
# Combined GPU packages for cleaner installation
5050
readonly COMMON_GPU_PACKAGES=(
51-
"intel-level-zero-gpu"
5251
"${COMPUTE_PACKAGES[@]}"
5352
)
5453

@@ -58,7 +57,7 @@ readonly MEDIA_GPU_PACKAGES=(
5857

5958
readonly OPTIONAL_GPU_PACKAGES=(
6059
"intel-ocloc"
61-
"level-zero-dev"
60+
"libze-dev"
6261
)
6362

6463
# GPU detection - simplified approach
@@ -282,7 +281,7 @@ install_gpu_drivers() {
282281
echo -e "\n# Post-installation configuration"
283282

284283
# Verify critical packages
285-
local critical_packages=("intel-level-zero-gpu" "intel-opencl-icd" "libze-intel-gpu1")
284+
local critical_packages=("intel-opencl-icd" "libze-intel-gpu1")
286285
local missing_packages=()
287286

288287
for pkg in "${critical_packages[@]}"; do

main_installer.sh

Lines changed: 104 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ download_scripts() {
9595
"gpu_installer.sh"
9696
"npu_installer.sh"
9797
"openvino_installer.sh"
98-
"platform_detection.sh"
9998
"print_summary_table.sh"
10099
)
101100

@@ -183,10 +182,26 @@ verify_ubuntu_24() {
183182

184183
# Install NPU drivers (Core Ultra only)
185184
install_npu_drivers() {
186-
echo "Installing NPU drivers for Core Ultra..."
185+
# Explicit guard: Only install NPU drivers on Core Ultra platforms
186+
if ! is_coreultra; then
187+
echo "$S_ERROR NPU drivers are only supported on Core Ultra platforms"
188+
echo "Current platform: $CPU_MODEL"
189+
echo "Skipping NPU driver installation"
190+
return 1
191+
fi
192+
193+
echo "Installing NPU drivers for Core Ultra platform..."
194+
echo "$S_VALID NPU driver installation is supported on this Core Ultra platform"
195+
187196
# Execute the script instead of sourcing it to avoid context issues
188197
# shellcheck disable=SC1091
189-
bash "$SCRIPT_DIR/npu_installer.sh"
198+
if bash "$SCRIPT_DIR/npu_installer.sh"; then
199+
echo "$S_VALID NPU drivers installed successfully"
200+
return 0
201+
else
202+
echo "$S_ERROR NPU driver installation failed"
203+
return 1
204+
fi
190205
}
191206

192207
# Check for GPU presence
@@ -217,17 +232,26 @@ check_intel_arc_gpu() {
217232

218233
# Install GPU drivers - only if any GPU is present
219234
install_gpu_drivers() {
235+
echo "# GPU Driver Installation Process"
236+
220237
if check_intel_arc_gpu; then
221238
echo "Installing Intel GPU drivers..."
222239
# Execute the script instead of sourcing it to avoid context issues
223240
# shellcheck disable=SC1091
224-
bash "$SCRIPT_DIR/gpu_installer.sh"
225-
echo "$S_VALID GPU drivers installed"
226-
227-
# Verify OpenCL setup after installation
228-
# verify_opencl_setup
241+
if bash "$SCRIPT_DIR/gpu_installer.sh"; then
242+
echo "$S_VALID GPU drivers installed successfully"
243+
244+
# Verify OpenCL setup after installation
245+
# verify_opencl_setup
246+
return 0
247+
else
248+
echo "$S_ERROR GPU driver installation failed"
249+
return 1
250+
fi
229251
else
230252
echo "$S_WARNING Skipping GPU driver installation - no GPU devices detected"
253+
echo "This is normal for systems without dedicated or integrated GPUs"
254+
return 0 # Not an error condition
231255
fi
232256
}
233257

@@ -333,6 +357,50 @@ verify_opencl_setup() {
333357
fi
334358
}
335359

360+
# Platform detection variables
361+
PLATFORM_FAMILY=""
362+
CPU_MODEL=""
363+
IS_COREULTRA=false
364+
365+
# Detect platform information
366+
detect_platform() {
367+
echo "Detecting platform family..."
368+
369+
# Get CPU model
370+
CPU_MODEL=$(grep -m1 "model name" /proc/cpuinfo | cut -d: -f2 | sed 's/^[ \t]*//' || echo "unknown")
371+
372+
# Detect platform family using a case statement for better readability
373+
case "$CPU_MODEL" in
374+
*Ultra*)
375+
PLATFORM_FAMILY="coreultra"
376+
IS_COREULTRA=true
377+
;;
378+
*Xeon*)
379+
PLATFORM_FAMILY="xeon"
380+
;;
381+
*Atom*|*Core*N[0-9]*)
382+
PLATFORM_FAMILY="atom"
383+
;;
384+
*Core*)
385+
PLATFORM_FAMILY="core"
386+
;;
387+
*Processor*)
388+
PLATFORM_FAMILY="processor"
389+
;;
390+
*)
391+
PLATFORM_FAMILY="unknown"
392+
;;
393+
esac
394+
395+
echo " CPU Model: $CPU_MODEL"
396+
echo " Platform Family: $PLATFORM_FAMILY"
397+
}
398+
399+
# Check if Core Ultra platform
400+
is_coreultra() {
401+
[ "$IS_COREULTRA" = true ]
402+
}
403+
336404
install_openvino(){
337405
echo ""
338406
echo "========================================================================"
@@ -419,48 +487,54 @@ main() {
419487
install_build_essentials
420488
echo ""
421489

422-
# 3. Load platform detection
423-
# shellcheck disable=SC1091
424-
source "$SCRIPT_DIR/platform_detection.sh"
425-
426-
# 4. Detect platform and OS
427-
echo "# Detecting platform and OS..."
490+
# 3. Detect platform
491+
echo "# Detecting platform..."
428492
detect_platform
429-
detect_os
430493
echo ""
431494

432495
# 5. Platform Installation Flow
433496
echo "# Platform Installation Flow..."
434497
echo "$S_VALID Platform detected: $CPU_MODEL"
435498

436499
# Determine platform family and execute appropriate flow
437-
if is_xeon; then
438-
echo "# Xeon platform detected"
439-
echo "$S_ERROR Setup skipped for Xeon platforms"
440-
echo "Please follow Ubuntu 24.04 Server installation guide:"
441-
echo "https://ubuntu.com/download/server"
442-
echo "For Xeon-specific optimizations, consult Intel documentation"
500+
if is_coreultra; then
501+
echo ""
502+
echo "========================================================================"
503+
echo "# CORE ULTRA PLATFORM INSTALLATION"
504+
echo "========================================================================"
505+
echo "Platform: Core Ultra CPU"
506+
echo "Components: GPU Drivers + NPU Drivers + OpenVINO"
507+
echo "NPU Support: Available and will be installed"
508+
echo ""
443509

444-
elif is_coreultra; then
445-
echo "# Core Ultra platform detected"
446-
install_gpu_drivers # Will check for Arc GPU presence first
447-
install_npu_drivers
510+
# Install GPU drivers (will check for GPU presence)
511+
install_gpu_drivers || echo "$S_WARNING GPU driver installation had issues"
512+
513+
# Install NPU drivers (Core Ultra only)
514+
install_npu_drivers || echo "$S_WARNING NPU driver installation had issues"
448515

449516
# Install OpenVINO with error handling
450517
if ! install_openvino; then
451518
echo "$S_ERROR Core Ultra platform setup incomplete due to OpenVINO installation failure"
452-
echo "NPU and GPU drivers were installed successfully"
453519
echo "You may retry OpenVINO installation manually: bash $SCRIPT_DIR/openvino_installer.sh"
454520
fi
455521

456522
else
457-
echo "# Atom/Core platform detected"
458-
install_gpu_drivers # Will check for Arc GPU presence first
523+
echo ""
524+
echo "========================================================================"
525+
echo "# STANDARD INTEL PLATFORM INSTALLATION"
526+
echo "========================================================================"
527+
echo "Platform: $CPU_MODEL (Xeon/Atom/Core)"
528+
echo "Components: GPU Drivers (if GPU present) + OpenVINO"
529+
echo "NPU Support: Not available (Core Ultra only)"
530+
echo ""
531+
532+
# Install GPU drivers (will check for GPU presence)
533+
install_gpu_drivers || echo "$S_WARNING GPU driver installation had issues"
459534

460535
# Install OpenVINO with error handling
461536
if ! install_openvino; then
462-
echo "$S_ERROR Atom/Core platform setup incomplete due to OpenVINO installation failure"
463-
echo "GPU drivers were installed successfully (if Arc GPU was present)"
537+
echo "$S_ERROR Platform setup incomplete due to OpenVINO installation failure"
464538
echo "You may retry OpenVINO installation manually: bash $SCRIPT_DIR/openvino_installer.sh"
465539
fi
466540
fi

npu_installer.sh

Lines changed: 90 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,61 @@
11
#!/bin/bash
22

3-
# NPU (Neural Processing Unit) Installer
4-
# Standardized NPU installation for Core Ultra family
3+
# NPU (Neural Processing Unit) Installer for Core Ultra platforms
4+
# Installs Intel NPU drivers with Level Zero support
55
# Copyright (C) 2025 Intel Corporation
66
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
# Features:
9+
# - Installs specific NPU driver versions (manually configured)
10+
# - Downloads packages from GitHub releases
11+
# - Supports Ubuntu 24.04 LTS only
12+
# - Requires Ubuntu 24.04 for dependency compatibility
13+
#
14+
# Version Management:
15+
# - Update the global version variables below when new releases are available
16+
# - Check for latest releases at: https://github.com/intel/linux-npu-driver/releases
17+
# - Level Zero compatibility matrix: https://github.com/intel/linux-npu-driver/releases/tag/v<version>
18+
#
19+
# Usage:
20+
# sudo ./npu_installer.sh
721

8-
# Global version variables
9-
NPU_VERSION="1.19.0"
10-
NPU_BUILD_ID="20250707-16111289554"
22+
# Global version variables - Update these when new releases are available
23+
# Source: https://github.com/intel/linux-npu-driver/releases/latest
24+
NPU_VERSION="1.23.0"
25+
NPU_BUILD_ID="20250827-17270089246"
1126
LEVEL_ZERO_VERSION="v1.22.4"
12-
UBUNTU_VERSION="ubuntu24.04"
27+
28+
# Auto-detect Ubuntu version
29+
UBUNTU_VERSION=""
30+
detect_ubuntu_version() {
31+
local ubuntu_ver
32+
ubuntu_ver=$(lsb_release -r | awk '{print $2}')
33+
34+
case "$ubuntu_ver" in
35+
"24.04")
36+
UBUNTU_VERSION="ubuntu2404"
37+
;;
38+
*)
39+
print_warning "Unsupported Ubuntu version: $ubuntu_ver"
40+
print_warning "This script only supports Ubuntu 24.04 LTS"
41+
print_error "Please upgrade to Ubuntu 24.04 LTS for NPU driver support"
42+
exit 1
43+
;;
44+
esac
45+
46+
print_info "Detected Ubuntu version: $ubuntu_ver -> $UBUNTU_VERSION"
47+
}
48+
49+
# Simple version display function (replaces complex GitHub scraping)
50+
display_version_info() {
51+
print_info "Using NPU Driver Version Information:"
52+
print_info "NPU Version: ${NPU_VERSION} | Build: ${NPU_BUILD_ID}"
53+
print_info "Level Zero Version: ${LEVEL_ZERO_VERSION}"
54+
print_info "Ubuntu Package: ${UBUNTU_VERSION}"
55+
print_info ""
56+
print_info "Note: To update versions, edit the global variables at the top of this script"
57+
print_info "Latest releases: https://github.com/intel/linux-npu-driver/releases"
58+
}
1359

1460
# Status indicators - using ASCII for better compatibility (conditional definition)
1561
if [[ -z "$S_ERROR" ]]; then
@@ -93,25 +139,29 @@ download_npu_packages() {
93139
print_info "Downloading NPU driver packages ${NPU_VERSION}..."
94140

95141
local base_url="https://github.com/intel/linux-npu-driver/releases/download/v${NPU_VERSION}"
96-
local build_suffix="${NPU_VERSION}.${NPU_BUILD_ID}_${UBUNTU_VERSION}_amd64.deb"
97-
98-
# Download each package with error checking
99-
local files=(
100-
"intel-driver-compiler-npu_${build_suffix}"
101-
"intel-fw-npu_${build_suffix}"
102-
"intel-level-zero-npu_${build_suffix}"
103-
)
104-
105-
for file in "${files[@]}"; do
106-
local url="${base_url}/${file}"
107-
print_info " Downloading ${file}..."
108-
if wget -q --timeout=30 "${url}"; then
109-
print_success " Downloaded ${file}"
142+
143+
# Download tar.gz archive format
144+
print_info "Downloading NPU driver archive..."
145+
local archive_name="linux-npu-driver-v${NPU_VERSION}.${NPU_BUILD_ID}-${UBUNTU_VERSION}.tar.gz"
146+
local url="${base_url}/${archive_name}"
147+
148+
print_info " Downloading ${archive_name}..."
149+
if wget -q --timeout=30 "${url}"; then
150+
print_success " Downloaded ${archive_name}"
151+
152+
# Extract the archive
153+
print_info " Extracting ${archive_name}..."
154+
if tar -xzf "${archive_name}"; then
155+
print_success " Extracted NPU packages from archive"
156+
rm -f "${archive_name}" # Clean up archive after extraction
110157
else
111-
print_error " Failed to download ${file} from ${url}"
158+
print_error " Failed to extract ${archive_name}"
112159
return 1
113160
fi
114-
done
161+
else
162+
print_error " Failed to download ${archive_name} from ${url}"
163+
return 1
164+
fi
115165

116166
print_success "All NPU packages downloaded successfully"
117167
return 0
@@ -132,7 +182,17 @@ check_level_zero() {
132182
# Download oneAPI Level Zero package
133183
download_level_zero_package() {
134184
print_info "Downloading oneAPI Level Zero ${LEVEL_ZERO_VERSION}..."
135-
local lz_url="https://github.com/oneapi-src/level-zero/releases/download/${LEVEL_ZERO_VERSION}/level-zero_1.22.4+u24.04_amd64.deb"
185+
print_info "DEBUG: Level Zero version variable: '${LEVEL_ZERO_VERSION}'"
186+
187+
# Extract version number without 'v' prefix for filename
188+
local lz_version_num
189+
# shellcheck disable=SC2001
190+
lz_version_num=$(echo "$LEVEL_ZERO_VERSION" | sed 's/^v//')
191+
print_info "DEBUG: Extracted version number: '${lz_version_num}'"
192+
193+
# Use Ubuntu 24.04 package
194+
local lz_url="https://github.com/oneapi-src/level-zero/releases/download/${LEVEL_ZERO_VERSION}/level-zero_${lz_version_num}+u24.04_amd64.deb"
195+
print_info "DEBUG: Download URL: ${lz_url}"
136196

137197
if wget -q --timeout=30 "${lz_url}"; then
138198
print_success "Downloaded Level Zero package"
@@ -265,15 +325,12 @@ verify_installation() {
265325
# Main installation function
266326
install_npu() {
267327
print_info "Starting NPU installation for Core Ultra platform..."
268-
print_info "NPU Version: ${NPU_VERSION} | Build: ${NPU_BUILD_ID}"
269-
print_info "Level Zero Version: ${LEVEL_ZERO_VERSION}"
270-
print_info ""
271328

272-
# Validate required variables
273-
if [[ -z "$NPU_VERSION" || -z "$NPU_BUILD_ID" || -z "$LEVEL_ZERO_VERSION" ]]; then
274-
print_error "Required version variables not set"
275-
exit 1
276-
fi
329+
# Detect Ubuntu version
330+
detect_ubuntu_version
331+
332+
# Display version information
333+
display_version_info
277334

278335
# Check if running as root
279336
if [ "$EUID" -ne 0 ]; then
@@ -333,6 +390,8 @@ install_npu() {
333390
print_info ""
334391
}
335392

393+
394+
336395
# Run installation if script is executed directly
337396
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
338397
install_npu

0 commit comments

Comments
 (0)