pinokiod 5.1.18 → 5.1.21

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.
@@ -99,7 +99,7 @@ report_errors: false`)
99
99
  let pinned_exists = await this.kernel.exists("bin/miniconda/conda-meta")
100
100
  if (pinned_exists) {
101
101
  //await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda ==24.11.3`)
102
- await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), "sqlite ==3.47.2")
102
+ await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), "conda ==25.5.1\nsqlite ==3.47.2")
103
103
  // await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), "")
104
104
  //sqlite ==3.47.2`)
105
105
  // await fs.promises.writeFile(this.kernel.path('bin/miniconda/conda-meta/pinned'), `conda=24.9.0`)
@@ -2,6 +2,36 @@ const semver = require('semver')
2
2
  const fs = require('fs')
3
3
  const path = require('path')
4
4
  class Cuda {
5
+ async restoreCudaActivationScript() {
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 patchCudaActivationScript() {
18
+ if (this.kernel.platform !== "win32") {
19
+ return
20
+ }
21
+ const script = this.kernel.bin.path("miniconda/etc/conda/activate.d/~cuda-nvcc_activate.bat")
22
+ let content
23
+ try {
24
+ content = await fs.promises.readFile(script, "utf8")
25
+ } catch (e) {
26
+ return
27
+ }
28
+ const lines = content.split(/\r?\n/)
29
+ const filtered = lines.filter((line) => !/(TORCH_CUDA_ARCH_LIST|CUDAARCHS)/i.test(line))
30
+ if (filtered.length !== lines.length) {
31
+ const eol = content.includes("\r\n") ? "\r\n" : "\n"
32
+ await fs.promises.writeFile(script, filtered.join(eol))
33
+ }
34
+ }
5
35
  async install(req, ondata) {
6
36
  if (this.kernel.gpu === "nvidia") {
7
37
  if (this.kernel.platform === "win32") {
@@ -17,9 +47,10 @@ class Cuda {
17
47
  "conda install -y nvidia/label/cuda-12.8.1::cuda"
18
48
  ]
19
49
  }, ondata)
50
+ await this.restoreCudaActivationScript()
51
+ await this.patchCudaActivationScript()
20
52
  const folder = this.kernel.bin.path("miniconda/etc/conda/activate.d")
21
53
  let deactivate_list = [
22
- "~cuda-nvcc_activate.bat",
23
54
  "vs2019_compiler_vars.bat",
24
55
  "vs2022_compiler_vars.bat",
25
56
  ]
@@ -55,6 +86,8 @@ class Cuda {
55
86
  async installed() {
56
87
  if (this.kernel.gpu === "nvidia") {
57
88
  if (this.kernel.platform === 'win32') {
89
+ await this.restoreCudaActivationScript()
90
+ await this.patchCudaActivationScript()
58
91
  if (this.kernel.bin.installed.conda.has("cudnn") && this.kernel.bin.installed.conda.has("cuda") && this.kernel.bin.installed.conda.has("libzlib-wapi")) {
59
92
  let version = this.kernel.bin.installed.conda_versions.cuda
60
93
  if (version) {
@@ -63,7 +96,6 @@ class Cuda {
63
96
  if (semver.satisfies(coerced, ">=12.8.1")) {
64
97
  console.log("cuda satisfied")
65
98
  let deactivate_list = [
66
- "~cuda-nvcc_activate.bat",
67
99
  "vs2019_compiler_vars.bat",
68
100
  "vs2022_compiler_vars.bat",
69
101
  ]
@@ -77,7 +109,7 @@ class Cuda {
77
109
  break
78
110
  }
79
111
  }
80
- console.log("nvcc_activate exists?", at_least_one_exists)
112
+ console.log("vs_compiler_vars exists?", at_least_one_exists)
81
113
  if (at_least_one_exists) {
82
114
  return false
83
115
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "5.1.18",
3
+ "version": "5.1.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {