pinokiod 5.1.24 → 5.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/bin/cuda.js +4 -17
- package/kernel/shell.js +16 -3
- package/package.json +1 -1
package/kernel/bin/cuda.js
CHANGED
|
@@ -2,19 +2,7 @@ const semver = require('semver')
|
|
|
2
2
|
const fs = require('fs')
|
|
3
3
|
const path = require('path')
|
|
4
4
|
class Cuda {
|
|
5
|
-
async
|
|
6
|
-
if (this.kernel.platform !== "win32") {
|
|
7
|
-
return
|
|
8
|
-
}
|
|
9
|
-
const folder = this.kernel.bin.path("miniconda/etc/conda/activate.d")
|
|
10
|
-
try {
|
|
11
|
-
await fs.promises.rename(
|
|
12
|
-
path.resolve(folder, "~cuda-nvcc_activate.bat.disabled"),
|
|
13
|
-
path.resolve(folder, "~cuda-nvcc_activate.bat")
|
|
14
|
-
)
|
|
15
|
-
} catch (e) {}
|
|
16
|
-
}
|
|
17
|
-
async stashCompilerVarsScripts() {
|
|
5
|
+
async stashActivationScripts() {
|
|
18
6
|
if (this.kernel.platform !== "win32") {
|
|
19
7
|
return
|
|
20
8
|
}
|
|
@@ -22,6 +10,7 @@ class Cuda {
|
|
|
22
10
|
const stash = path.resolve(folder, "pinokio")
|
|
23
11
|
await fs.promises.mkdir(stash, { recursive: true }).catch(() => {})
|
|
24
12
|
const scripts = [
|
|
13
|
+
"~cuda-nvcc_activate.bat",
|
|
25
14
|
"vs2019_compiler_vars.bat",
|
|
26
15
|
"vs2022_compiler_vars.bat",
|
|
27
16
|
]
|
|
@@ -55,8 +44,7 @@ class Cuda {
|
|
|
55
44
|
"conda install -y nvidia/label/cuda-12.8.1::cuda"
|
|
56
45
|
]
|
|
57
46
|
}, ondata)
|
|
58
|
-
await this.
|
|
59
|
-
await this.stashCompilerVarsScripts()
|
|
47
|
+
await this.stashActivationScripts()
|
|
60
48
|
} else {
|
|
61
49
|
await this.kernel.bin.exec({
|
|
62
50
|
message: [
|
|
@@ -83,8 +71,7 @@ class Cuda {
|
|
|
83
71
|
async installed() {
|
|
84
72
|
if (this.kernel.gpu === "nvidia") {
|
|
85
73
|
if (this.kernel.platform === 'win32') {
|
|
86
|
-
await this.
|
|
87
|
-
await this.stashCompilerVarsScripts()
|
|
74
|
+
await this.stashActivationScripts()
|
|
88
75
|
if (this.kernel.bin.installed.conda.has("cudnn") && this.kernel.bin.installed.conda.has("cuda") && this.kernel.bin.installed.conda.has("libzlib-wapi")) {
|
|
89
76
|
let version = this.kernel.bin.installed.conda_versions.cuda
|
|
90
77
|
if (version) {
|
package/kernel/shell.js
CHANGED
|
@@ -972,7 +972,6 @@ class Shell {
|
|
|
972
972
|
console.log(`Unsupported arch: os.arch()=${architecture}, process.arch=${armArchitecture}`)
|
|
973
973
|
}
|
|
974
974
|
|
|
975
|
-
const compiler_log = '"%TEMP%\\pinokio-vs.log"'
|
|
976
975
|
const activate_root = this.kernel.bin.path("miniconda/etc/conda/activate.d")
|
|
977
976
|
const compiler_candidates = [
|
|
978
977
|
path.resolve(activate_root, "pinokio", "vs2019_compiler_vars.bat"),
|
|
@@ -988,9 +987,23 @@ class Shell {
|
|
|
988
987
|
}
|
|
989
988
|
}
|
|
990
989
|
if (compiler_script) {
|
|
991
|
-
conda_activation.push(`CALL "${compiler_script}" >
|
|
990
|
+
conda_activation.push(`CALL "${compiler_script}" > nul 2>&1`)
|
|
992
991
|
} else if (vcvars_path && arg) {
|
|
993
|
-
conda_activation.push(`CALL "${vcvars_path}" ${arg} >
|
|
992
|
+
conda_activation.push(`CALL "${vcvars_path}" ${arg} > nul 2>&1`)
|
|
993
|
+
}
|
|
994
|
+
const cuda_candidates = [
|
|
995
|
+
path.resolve(activate_root, "pinokio", "~cuda-nvcc_activate.bat"),
|
|
996
|
+
path.resolve(activate_root, "~cuda-nvcc_activate.bat"),
|
|
997
|
+
]
|
|
998
|
+
let cuda_script = null
|
|
999
|
+
for (const candidate of cuda_candidates) {
|
|
1000
|
+
if (await this.exists(candidate)) {
|
|
1001
|
+
cuda_script = candidate
|
|
1002
|
+
break
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
if (cuda_script) {
|
|
1006
|
+
conda_activation.push(`CALL "${cuda_script}" > nul 2>&1`)
|
|
994
1007
|
}
|
|
995
1008
|
conda_activation.push("@echo off")
|
|
996
1009
|
conda_activation.push("set TORCH_CUDA_ARCH_LIST=")
|