pinokiod 5.1.24 → 5.1.25

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,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 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 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.restoreCudaActivationScript()
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.restoreCudaActivationScript()
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
@@ -992,6 +992,20 @@ class Shell {
992
992
  } else if (vcvars_path && arg) {
993
993
  conda_activation.push(`CALL "${vcvars_path}" ${arg} > ${compiler_log} 2>&1`)
994
994
  }
995
+ const cuda_candidates = [
996
+ path.resolve(activate_root, "pinokio", "~cuda-nvcc_activate.bat"),
997
+ path.resolve(activate_root, "~cuda-nvcc_activate.bat"),
998
+ ]
999
+ let cuda_script = null
1000
+ for (const candidate of cuda_candidates) {
1001
+ if (await this.exists(candidate)) {
1002
+ cuda_script = candidate
1003
+ break
1004
+ }
1005
+ }
1006
+ if (cuda_script) {
1007
+ conda_activation.push(`CALL "${cuda_script}" > ${compiler_log} 2>&1`)
1008
+ }
995
1009
  conda_activation.push("@echo off")
996
1010
  conda_activation.push("set TORCH_CUDA_ARCH_LIST=")
997
1011
  conda_activation.push("set CUDAARCHS=")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "5.1.24",
3
+ "version": "5.1.25",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {