diff --git a/plugins/core/package-lock.json b/plugins/core/package-lock.json index 190f14f338..a2aed7ddcf 100644 --- a/plugins/core/package-lock.json +++ b/plugins/core/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/core", - "version": "0.3.70", + "version": "0.3.71", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/core", - "version": "0.3.70", + "version": "0.3.71", "license": "Apache-2.0", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/core/package.json b/plugins/core/package.json index 9009ddbecb..b1c22601b4 100644 --- a/plugins/core/package.json +++ b/plugins/core/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/core", - "version": "0.3.70", + "version": "0.3.71", "description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.", "author": "Scrypted", "license": "Apache-2.0", diff --git a/plugins/core/src/platform/lxc.ts b/plugins/core/src/platform/lxc.ts index 2a96153a15..8cfc035591 100644 --- a/plugins/core/src/platform/lxc.ts +++ b/plugins/core/src/platform/lxc.ts @@ -1,8 +1,8 @@ -import fs from 'fs'; +import sdk from '@scrypted/sdk'; import child_process from 'child_process'; import { once } from 'events'; -import sdk from '@scrypted/sdk'; -import { stdout } from 'process'; +import fs from 'fs'; +import os from 'os'; export const SCRYPTED_INSTALL_ENVIRONMENT_LXC = 'lxc'; @@ -43,38 +43,51 @@ export async function checkLxcDependencies() { } try { - // intel opencl icd is broken from their official apt repos on kernel versions 6.8, which ships with ubuntu 24.04 and proxmox 8.2. - // the intel apt repo has not been updated yet. - // the current workaround is to install the release manually. - // https://github.com/intel/compute-runtime/releases/tag/24.13.29138.7 - const output = await new Promise((r,f)=> child_process.exec("sh -c 'apt show versions intel-opencl-icd'", (err, stdout, stderr) => { + const output = await new Promise((r, f) => child_process.exec("sh -c 'apt show versions level-zero'", (err, stdout, stderr) => { if (err && !stdout && !stderr) f(err); else r(stdout + '\n' + stderr); })); - if ( - // apt - output.includes('Version: 23') - // was installed via script at some point - || output.includes('Version: 24.13.29138.7') - // current script version: 24.17.29377.6 + const cpuModel = os.cpus()[0].model; + if (cpuModel.includes('Core') && cpuModel.includes('Ultra')) { + if ( + // apt + output.includes('No packages found') ) { - const cp = child_process.spawn('sh', ['-c', 'curl https://raw.githubusercontent.com/koush/scrypted/main/install/docker/install-intel-graphics.sh | bash']); - const [exitCode] = await once(cp, 'exit'); - if (exitCode !== 0) - sdk.log.a('Failed to install intel-opencl-icd.'); - else - needRestart = true; + const cp = child_process.spawn('sh', ['-c', 'curl https://raw.githubusercontent.com/koush/scrypted/main/install/docker/install-intel-npu.sh | bash']); + const [exitCode] = await once(cp, 'exit'); + if (exitCode !== 0) + sdk.log.a('Failed to install intel-driver-compiler-npu.'); + else + needRestart = true; + } + } + else { + // level-zero crashes openvino on older CPU due to illegal instruction. + // so ensure it is not installed if this is not a core ultra system with npu. + if ( + // apt + !output.includes('No packages found') + ) { + const cp = child_process.spawn('apt', ['-y', 'remove', 'level-zero']); + const [exitCode] = await once(cp, 'exit'); + console.log('level-zero removed', exitCode); + } } + } catch (e) { - sdk.log.a('Failed to verify/install intel-opencl-icd version.'); + sdk.log.a('Failed to verify/install intel-driver-compiler-npu.'); } try { - const output = await new Promise((r,f)=> child_process.exec("sh -c 'apt show versions intel-driver-compiler-npu'", (err, stdout, stderr) => { + // intel opencl icd is broken from their official apt repos on kernel versions 6.8, which ships with ubuntu 24.04 and proxmox 8.2. + // the intel apt repo has not been updated yet. + // the current workaround is to install the release manually. + // https://github.com/intel/compute-runtime/releases/tag/24.13.29138.7 + const output = await new Promise((r, f) => child_process.exec("sh -c 'apt show versions intel-opencl-icd'", (err, stdout, stderr) => { if (err && !stdout && !stderr) f(err); else @@ -83,18 +96,21 @@ export async function checkLxcDependencies() { if ( // apt - output.includes('No packages found') - ) { - const cp = child_process.spawn('sh', ['-c', 'curl https://raw.githubusercontent.com/koush/scrypted/main/install/docker/install-intel-npu.sh | bash']); + output.includes('Version: 23') + // was installed via script at some point + || output.includes('Version: 24.13.29138.7') + // current script version: 24.17.29377.6 + ) { + const cp = child_process.spawn('sh', ['-c', 'curl https://raw.githubusercontent.com/koush/scrypted/main/install/docker/install-intel-graphics.sh | bash']); const [exitCode] = await once(cp, 'exit'); if (exitCode !== 0) - sdk.log.a('Failed to install intel-driver-compiler-npu.'); + sdk.log.a('Failed to install intel-opencl-icd.'); else needRestart = true; } } catch (e) { - sdk.log.a('Failed to verify/install intel-driver-compiler-npu.'); + sdk.log.a('Failed to verify/install intel-opencl-icd version.'); } if (needRestart) diff --git a/plugins/openvino/package-lock.json b/plugins/openvino/package-lock.json index e074f18031..94f6cb43b5 100644 --- a/plugins/openvino/package-lock.json +++ b/plugins/openvino/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/openvino", - "version": "0.1.116", + "version": "0.1.117", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/openvino", - "version": "0.1.116", + "version": "0.1.117", "devDependencies": { "@scrypted/sdk": "file:../../sdk" } diff --git a/plugins/openvino/package.json b/plugins/openvino/package.json index 4e11dad734..28e9fb5dc3 100644 --- a/plugins/openvino/package.json +++ b/plugins/openvino/package.json @@ -42,5 +42,5 @@ "devDependencies": { "@scrypted/sdk": "file:../../sdk" }, - "version": "0.1.116" + "version": "0.1.117" } diff --git a/plugins/openvino/src/ov/__init__.py b/plugins/openvino/src/ov/__init__.py index da385b4021..b27b1a27e4 100644 --- a/plugins/openvino/src/ov/__init__.py +++ b/plugins/openvino/src/ov/__init__.py @@ -202,6 +202,9 @@ def __init__(self, nativeId: str | None = None): try: self.compiled_model = self.core.compile_model(xmlFile, mode) except: + import traceback + traceback.print_exc() + if mode == "GPU": try: print("GPU mode failed, reverting to AUTO.") @@ -209,9 +212,6 @@ def __init__(self, nativeId: str | None = None): self.mode = mode self.compiled_model = self.core.compile_model(xmlFile, mode) except: - import traceback - - traceback.print_exc() print("Reverting all settings.") self.storage.removeItem("mode") self.storage.removeItem("model") diff --git a/plugins/openvino/src/requirements.txt b/plugins/openvino/src/requirements.txt index 3b6eaa8ea5..c1710dd3ab 100644 --- a/plugins/openvino/src/requirements.txt +++ b/plugins/openvino/src/requirements.txt @@ -1,8 +1,7 @@ # must ensure numpy is pinned to prevent dependencies with an unpinned numpy from pulling numpy>=2.0. numpy==1.26.4 -# openvino 2024.3.0 crashes on older CPU -# openvino 2024.2.0 crashes on current CPU. -# older versions unsure about NPU support. +# openvino 2024.3.0 crashes on older CPU (J4105 and older) if level-zero is installed via apt. +# openvino 2024.2.0 and older crashes on arc dGPU. openvino==2024.3.0 Pillow==10.3.0 opencv-python==4.10.0.84