pinokiod 5.1.28 → 5.1.29

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.
@@ -2,6 +2,24 @@ const semver = require('semver')
2
2
  const fs = require('fs')
3
3
  const path = require('path')
4
4
  class Cuda {
5
+ async patchCudaActivationScript() {
6
+ if (this.kernel.platform !== "win32") {
7
+ return
8
+ }
9
+ const script = this.kernel.bin.path("miniconda/etc/conda/activate.d/pinokio/~cuda-nvcc_activate.bat")
10
+ let content
11
+ try {
12
+ content = await fs.promises.readFile(script, "utf8")
13
+ } catch (e) {
14
+ return
15
+ }
16
+ const lines = content.split(/\r?\n/)
17
+ const filtered = lines.filter((line) => !/set\s+\"?(TORCH_CUDA_ARCH_LIST|CUDAARCHS)=/i.test(line))
18
+ if (filtered.length !== lines.length) {
19
+ const eol = content.includes("\r\n") ? "\r\n" : "\n"
20
+ await fs.promises.writeFile(script, filtered.join(eol))
21
+ }
22
+ }
5
23
  async stashActivationScripts() {
6
24
  if (this.kernel.platform !== "win32") {
7
25
  return
@@ -28,6 +46,7 @@ class Cuda {
28
46
  }
29
47
  }
30
48
  }
49
+ await this.patchCudaActivationScript()
31
50
  }
32
51
  async install(req, ondata) {
33
52
  if (this.kernel.gpu === "nvidia") {
package/kernel/shell.js CHANGED
@@ -1005,8 +1005,6 @@ class Shell {
1005
1005
  if (cuda_script) {
1006
1006
  conda_activation.push(`CALL "${cuda_script}" > nul 2>&1`)
1007
1007
  }
1008
- conda_activation.push("set TORCH_CUDA_ARCH_LIST=")
1009
- conda_activation.push("set CUDAARCHS=")
1010
1008
  } catch (e) {
1011
1009
  console.log('vc vars setup', e)
1012
1010
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "5.1.28",
3
+ "version": "5.1.29",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {