KASM-8264 set node to a min of 18, fixed a potential gpu issue, remove typo in currentVersion

This commit is contained in:
Chris Hunt 2026-04-15 14:53:17 +01:00
parent d7d5cd8f12
commit fbf2e5ff48
No known key found for this signature in database
2 changed files with 17 additions and 6 deletions

View file

@ -142,7 +142,7 @@ async function installerBlobs() {
try {
currentVersion = fs.readFileSync('/version.txt', 'utf8').replace(/(\r\n|\n|\r)/gm,'');
} catch (err) {
currentVersion = '1.18.1!';
currentVersion = '1.18.1';
}
images = await fetchWorkspaceList(currentVersion, arch);
gpuInfo = {};
@ -180,13 +180,21 @@ async function setGpu(imagesI) {
if (upgradeSettings['forceGpu'] !== undefined) {
installSettings = upgradeSettings;
}
let gpu = installSettings.forceGpu.split('|')[0];
let gpuName = installSettings.forceGpu.split('|')[1];
let card = gpu.slice(-1);
let render = (Number(card) + 128).toString();
const forceGpu = installSettings.forceGpu;
if (!forceGpu || forceGpu === 'disabled' || !forceGpu.includes('|')) {
console.error('setGpu: invalid or missing forceGpu value:', forceGpu);
return imagesI;
}
const [gpu, gpuName] = forceGpu.split('|');
if (!gpu || !gpuName) {
console.error('setGpu: could not parse GPU path or name from forceGpu:', forceGpu);
return imagesI;
}
const card = gpu.slice(-1);
const render = (Number(card) + 128).toString();
// Handle NVIDIA Gpus
let baseRun;
if (gpuName.indexOf('NVIDIA') !== -1) {
if (gpuName.includes('NVIDIA')) {
baseRun = JSON.parse('{"runtime":"nvidia","environment":{"NVIDIA_DRIVER_CAPABILITIES":"all","KASM_EGL_CARD":"/dev/dri/card' + card + '","KASM_RENDERD":"/dev/dri/renderD' + render + '"},"device_requests":[{"driver": "","count": -1,"device_ids": null,"capabilities":[["gpu"]],"options":{}}]}');
} else {
baseRun = JSON.parse('{"environment":{"DRINODE":"/dev/dri/renderD' + render + '", "HW3D": true},"devices":["/dev/dri/card' + card + ':/dev/dri/card' + card + ':rwm","/dev/dri/renderD' + render + ':/dev/dri/renderD' + render + ':rwm"]}');

View file

@ -8,6 +8,9 @@
},
"author": "",
"license": "MIT",
"engines": {
"node": ">=18"
},
"dependencies": {
"dockerode": "^4.0.10",
"express": "^4.18.1",