pinokiod 5.1.32 → 5.1.34

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.
@@ -40,7 +40,24 @@ class Cuda {
40
40
  return
41
41
  }
42
42
  const lines = content.split(/\r?\n/)
43
- const filtered = lines.filter((line) => !/set\s+\"?(TORCH_CUDA_ARCH_LIST|CUDAARCHS)=/i.test(line))
43
+ const filtered = []
44
+ let skipBlock = false
45
+ for (const line of lines) {
46
+ if (!skipBlock) {
47
+ if (/^\s*if\s+not\s+defined\s+(CUDAARCHS|TORCH_CUDA_ARCH_LIST)\s*\(\s*$/i.test(line)) {
48
+ skipBlock = true
49
+ continue
50
+ }
51
+ if (/set\s+\"?(TORCH_CUDA_ARCH_LIST|CUDAARCHS)=/i.test(line)) {
52
+ continue
53
+ }
54
+ filtered.push(line)
55
+ } else {
56
+ if (/^\s*\)\s*$/.test(line)) {
57
+ skipBlock = false
58
+ }
59
+ }
60
+ }
44
61
  if (filtered.length !== lines.length) {
45
62
  const eol = content.includes("\r\n") ? "\r\n" : "\n"
46
63
  await fs.promises.writeFile(script, filtered.join(eol))
package/kernel/shell.js CHANGED
@@ -973,6 +973,11 @@ class Shell {
973
973
  }
974
974
 
975
975
  const activate_root = this.kernel.bin.path("miniconda/etc/conda/activate.d")
976
+ const logDir = this.kernel.path("cache", "logs")
977
+ await fs.promises.mkdir(logDir, { recursive: true }).catch(() => {})
978
+ const logSuffix = this.id || Date.now()
979
+ const compiler_log = path.resolve(logDir, `vs-${logSuffix}.log`)
980
+ const cuda_log = path.resolve(logDir, `cuda-${logSuffix}.log`)
976
981
  const compiler_candidates = [
977
982
  path.resolve(activate_root, "pinokio", "vs2019_compiler_vars.bat"),
978
983
  path.resolve(activate_root, "pinokio", "vs2022_compiler_vars.bat"),
@@ -987,9 +992,9 @@ class Shell {
987
992
  }
988
993
  }
989
994
  if (compiler_script) {
990
- conda_activation.push(`CALL "${compiler_script}" > nul 2>&1`)
995
+ conda_activation.push(`CALL "${compiler_script}" > "${compiler_log}" 2>&1`)
991
996
  } else if (vcvars_path && arg) {
992
- conda_activation.push(`CALL "${vcvars_path}" ${arg} > nul 2>&1`)
997
+ conda_activation.push(`CALL "${vcvars_path}" ${arg} > "${compiler_log}" 2>&1`)
993
998
  }
994
999
  const cuda_candidates = [
995
1000
  path.resolve(activate_root, "pinokio", "~cuda-nvcc_activate.bat"),
@@ -1003,7 +1008,7 @@ class Shell {
1003
1008
  }
1004
1009
  }
1005
1010
  if (cuda_script) {
1006
- conda_activation.push(`CALL "${cuda_script}" > nul 2>&1`)
1011
+ conda_activation.push(`CALL "${cuda_script}" > "${cuda_log}" 2>&1`)
1007
1012
  }
1008
1013
  } catch (e) {
1009
1014
  console.log('vc vars setup', e)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "5.1.32",
3
+ "version": "5.1.34",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {