pinokiod 5.1.22 → 5.1.24

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.
Files changed (2) hide show
  1. package/kernel/shell.js +19 -8
  2. package/package.json +1 -1
package/kernel/shell.js CHANGED
@@ -972,16 +972,27 @@ class Shell {
972
972
  console.log(`Unsupported arch: os.arch()=${architecture}, process.arch=${armArchitecture}`)
973
973
  }
974
974
 
975
- const compiler_cmd = [
976
- `if exist "%CONDA_PREFIX%\\etc\\conda\\activate.d\\pinokio\\vs2019_compiler_vars.bat" (call "%CONDA_PREFIX%\\etc\\conda\\activate.d\\pinokio\\vs2019_compiler_vars.bat")`,
977
- `else if exist "%CONDA_PREFIX%\\etc\\conda\\activate.d\\pinokio\\vs2022_compiler_vars.bat" (call "%CONDA_PREFIX%\\etc\\conda\\activate.d\\pinokio\\vs2022_compiler_vars.bat")`,
978
- `else if exist "%CONDA_PREFIX%\\etc\\conda\\activate.d\\vs2019_compiler_vars.bat" (call "%CONDA_PREFIX%\\etc\\conda\\activate.d\\vs2019_compiler_vars.bat")`,
979
- `else if exist "%CONDA_PREFIX%\\etc\\conda\\activate.d\\vs2022_compiler_vars.bat" (call "%CONDA_PREFIX%\\etc\\conda\\activate.d\\vs2022_compiler_vars.bat")`,
975
+ const compiler_log = '"%TEMP%\\pinokio-vs.log"'
976
+ const activate_root = this.kernel.bin.path("miniconda/etc/conda/activate.d")
977
+ const compiler_candidates = [
978
+ path.resolve(activate_root, "pinokio", "vs2019_compiler_vars.bat"),
979
+ path.resolve(activate_root, "pinokio", "vs2022_compiler_vars.bat"),
980
+ path.resolve(activate_root, "vs2019_compiler_vars.bat"),
981
+ path.resolve(activate_root, "vs2022_compiler_vars.bat"),
980
982
  ]
981
- if (vcvars_path && arg) {
982
- compiler_cmd.push(`else if exist "${vcvars_path}" (CALL "${vcvars_path}" ${arg})`)
983
+ let compiler_script = null
984
+ for (const candidate of compiler_candidates) {
985
+ if (await this.exists(candidate)) {
986
+ compiler_script = candidate
987
+ break
988
+ }
989
+ }
990
+ if (compiler_script) {
991
+ conda_activation.push(`CALL "${compiler_script}" > ${compiler_log} 2>&1`)
992
+ } else if (vcvars_path && arg) {
993
+ conda_activation.push(`CALL "${vcvars_path}" ${arg} > ${compiler_log} 2>&1`)
983
994
  }
984
- conda_activation.push(compiler_cmd.join(" "))
995
+ conda_activation.push("@echo off")
985
996
  conda_activation.push("set TORCH_CUDA_ARCH_LIST=")
986
997
  conda_activation.push("set CUDAARCHS=")
987
998
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "5.1.22",
3
+ "version": "5.1.24",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {