Skip to content

Commit

Permalink
core: update intel opencl in lxc
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed May 14, 2024
1 parent fd1aa10 commit 508f31c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 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.24",
"version": "0.3.25",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",
Expand Down
26 changes: 26 additions & 0 deletions plugins/core/src/platform/lxc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'fs';
import child_process from 'child_process';
import { once } from 'events';
import sdk from '@scrypted/sdk';
import { stdout } from 'process';

export const SCRYPTED_INSTALL_ENVIRONMENT_LXC = 'lxc';

Expand Down Expand Up @@ -41,6 +42,31 @@ export async function checkLxcDependencies() {
sdk.log.a('Failed to daemon-reload systemd.');
}

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<string>((r,f)=> child_process.exec("sh -c 'apt show versions intel-opencl-icd'", (err, stdout, stderr) => {
if (err)
f(err);
else
r(stdout + '\n' + stderr);
}));

if (output.includes('Version: 23')) {
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;
}
}
catch (e) {
sdk.log.a('Failed to verify/install intel-opencl-icd version.');
}

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

0 comments on commit 508f31c

Please sign in to comment.