mirror of
https://github.com/kasmtech/kasm-install-wizard.git
synced 2026-01-23 02:34:27 +00:00
KASM-3699 have a fallback mode for gpuinfo script to simply list the cards
This commit is contained in:
parent
bfacaa3734
commit
a8735cf7e3
1 changed files with 14 additions and 3 deletions
17
index.js
17
index.js
|
|
@ -39,10 +39,21 @@ async function installerBlobs() {
|
|||
gpuData.push(data);
|
||||
});
|
||||
gpuCmd.on('close', function(code) {
|
||||
if (code == 0) {
|
||||
gpuInfo = JSON.parse(gpuData.join(''));
|
||||
} else {
|
||||
try {
|
||||
if (code == 0) {
|
||||
gpuInfo = JSON.parse(gpuData.join(''));
|
||||
} else {
|
||||
gpuInfo = {};
|
||||
}
|
||||
} catch (err) {
|
||||
// Manually backfill GPU info if available
|
||||
gpuInfo = {};
|
||||
for (let i = 0; i < 10; i++) {
|
||||
let num = i.toString();
|
||||
if (fs.existsSync('/dev/dri/card' + num)) {
|
||||
gpuInfo['/dev/dri/card' + num] = "Unknown GPU";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue