Skip to content

Commit

Permalink
core: install npu drivers in lxc
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Aug 30, 2024
1 parent 1615f79 commit 29c5dfd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/core",
"version": "0.3.67",
"version": "0.3.68",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",
Expand Down
26 changes: 25 additions & 1 deletion plugins/core/src/platform/lxc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function checkLxcDependencies() {
// 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<string>((r,f)=> child_process.exec("sh -c 'apt show versions intel-opencl-icd'", (err, stdout, stderr) => {
if (err)
if (err && !stdout && !stderr)
f(err);
else
r(stdout + '\n' + stderr);
Expand All @@ -73,6 +73,30 @@ export async function checkLxcDependencies() {
sdk.log.a('Failed to verify/install intel-opencl-icd version.');
}

try {
const output = await new Promise<string>((r,f)=> child_process.exec("sh -c 'apt show versions intel-driver-compiler-npu'", (err, stdout, stderr) => {
if (err && !stdout && !stderr)
f(err);
else
r(stdout + '\n' + stderr);
}));

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']);
const [exitCode] = await once(cp, 'exit');
if (exitCode !== 0)
sdk.log.a('Failed to install intel-driver-compiler-npu.');
else
needRestart = true;
}
}
catch (e) {
sdk.log.a('Failed to verify/install intel-driver-compiler-npu.');
}

if (needRestart)
sdk.log.a('A system update is pending. Please restart Scrypted to apply changes.');
}

0 comments on commit 29c5dfd

Please sign in to comment.