Skip to content

Commit 7a184f5

Browse files
authored
Merge pull request #303 from open-edge-platform/update-branch
fix: update npu_detect function to use proper error handling (#811)
2 parents dd8ecc2 + 2ce2f8f commit 7a184f5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

print_summary_table.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
# Print a summary table of system installation status
77

8-
set -eo pipefail
8+
# Note: Removed 'set -eo pipefail' to prevent early exits from failed commands
9+
# Individual functions handle errors gracefully with timeouts and || true
910

1011
# Status indicators - using ASCII for better compatibility
1112
readonly S_ERROR="[ERROR]"
@@ -150,8 +151,8 @@ detect_npu() {
150151
local npu_status npu_pkg npu_ver
151152

152153
# Check if main NPU package is installed with timeout
153-
npu_pkg=$(timeout_cmd 5 dpkg -l | grep 'intel-level-zero-npu' | awk '{print $2}')
154-
npu_ver=$(timeout_cmd 5 dpkg -l | grep 'intel-level-zero-npu' | awk '{print $3}')
154+
npu_pkg=$(timeout_cmd 5 dpkg -l 2>/dev/null | grep 'intel-level-zero-npu' | awk '{print $2}' || true)
155+
npu_ver=$(timeout_cmd 5 dpkg -l 2>/dev/null | grep 'intel-level-zero-npu' | awk '{print $3}' || true)
155156

156157
if [ -n "$npu_pkg" ]; then
157158
npu_status="Detected"

0 commit comments

Comments
 (0)