Commit ffe43c1b authored by zk's avatar zk
Browse files

Fallback hy-smi to login shell

parent 244acb79
...@@ -320,7 +320,7 @@ function buildRemoteCommand(command) { ...@@ -320,7 +320,7 @@ function buildRemoteCommand(command) {
"--format=csv,noheader,nounits" "--format=csv,noheader,nounits"
].join(" "); ].join(" ");
} }
return "hy-smi"; return buildHySmiCommand("");
} }
function buildModelCommand(command) { function buildModelCommand(command) {
...@@ -331,7 +331,16 @@ function buildModelCommand(command) { ...@@ -331,7 +331,16 @@ function buildModelCommand(command) {
"--format=csv,noheader,nounits" "--format=csv,noheader,nounits"
].join(" "); ].join(" ");
} }
return "hy-smi --showproductname"; return buildHySmiCommand("--showproductname");
}
function buildHySmiCommand(args) {
const command = ["hy-smi", args].filter(Boolean).join(" ");
return `(${command} 2>/dev/null || bash -ilc ${shellQuote(command)})`;
}
function shellQuote(value) {
return `'${String(value).replace(/'/g, `'\\''`)}'`;
} }
function persistDetectedServerInfo(serverId, detected) { function persistDetectedServerInfo(serverId, detected) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment