pinokiod 3.228.0 → 3.229.0
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.
- package/kernel/bin/cuda.js +35 -1
- package/package.json +1 -1
- package/server/views/app.ejs +23 -0
package/kernel/bin/cuda.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const semver = require('semver')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
const path = require('path')
|
|
2
4
|
class Cuda {
|
|
3
5
|
async install(req, ondata) {
|
|
4
6
|
if (this.kernel.platform === "win32") {
|
|
@@ -14,6 +16,18 @@ class Cuda {
|
|
|
14
16
|
"conda install -y nvidia/label/cuda-12.8.1::cuda"
|
|
15
17
|
]
|
|
16
18
|
}, ondata)
|
|
19
|
+
const folder = this.kernel.bin.path("miniconda/etc/conda/activate.d")
|
|
20
|
+
let deactivate_list = [
|
|
21
|
+
"~cuda-nvcc_activate.bat",
|
|
22
|
+
"vs2019_compiler_vars.bat",
|
|
23
|
+
"vs2022_compiler_vars.bat",
|
|
24
|
+
]
|
|
25
|
+
for(let item of deactivate_list) {
|
|
26
|
+
const old_name = path.resolve(folder, item)
|
|
27
|
+
const new_name = path.resolve(folder, item + ".disabled")
|
|
28
|
+
console.log("rename", { old_name, new_name })
|
|
29
|
+
await fs.promises.rename(old_name, new_name)
|
|
30
|
+
}
|
|
17
31
|
} else {
|
|
18
32
|
await this.kernel.bin.exec({
|
|
19
33
|
message: [
|
|
@@ -45,7 +59,27 @@ class Cuda {
|
|
|
45
59
|
console.log("cuda version", coerced)
|
|
46
60
|
if (semver.satisfies(coerced, ">=12.8.1")) {
|
|
47
61
|
console.log("cuda satisfied")
|
|
48
|
-
|
|
62
|
+
let deactivate_list = [
|
|
63
|
+
"~cuda-nvcc_activate.bat",
|
|
64
|
+
"vs2019_compiler_vars.bat",
|
|
65
|
+
"vs2022_compiler_vars.bat",
|
|
66
|
+
]
|
|
67
|
+
const folder = this.kernel.bin.path("miniconda/etc/conda/activate.d")
|
|
68
|
+
let at_least_one_exists = false
|
|
69
|
+
for(let item of deactivate_list) {
|
|
70
|
+
let exists = await this.kernel.exists("bin/miniconda/etc/conda/activate.d/" + item)
|
|
71
|
+
if (exists) {
|
|
72
|
+
// break if at least one exists
|
|
73
|
+
at_least_one_exists = true
|
|
74
|
+
break
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
console.log("nvcc_activate exists?", at_least_one_exists)
|
|
78
|
+
if (at_least_one_exists) {
|
|
79
|
+
return false
|
|
80
|
+
} else {
|
|
81
|
+
return true
|
|
82
|
+
}
|
|
49
83
|
}
|
|
50
84
|
}
|
|
51
85
|
}
|
package/package.json
CHANGED
package/server/views/app.ejs
CHANGED
|
@@ -6492,6 +6492,29 @@ body.dark .pinokio-fork-dropdown-remote, body.dark .pinokio-publish-dropdown-rem
|
|
|
6492
6492
|
if (target) {
|
|
6493
6493
|
e.preventDefault()
|
|
6494
6494
|
e.stopPropagation()
|
|
6495
|
+
if (typeof e.stopImmediatePropagation === "function") {
|
|
6496
|
+
e.stopImmediatePropagation()
|
|
6497
|
+
}
|
|
6498
|
+
const parentLink = target.closest(".frame-link")
|
|
6499
|
+
if (parentLink) {
|
|
6500
|
+
let selectorCandidate = ""
|
|
6501
|
+
const targetAttr = parentLink.getAttribute("target")
|
|
6502
|
+
if (targetAttr) {
|
|
6503
|
+
const escapedTarget = escapeTargetSelector(targetAttr)
|
|
6504
|
+
if (escapedTarget) {
|
|
6505
|
+
selectorCandidate = `.frame-link[target="${escapedTarget}"]`
|
|
6506
|
+
}
|
|
6507
|
+
}
|
|
6508
|
+
if (!selectorCandidate && parentLink.href) {
|
|
6509
|
+
const escapedHref = escapeTargetSelector(parentLink.getAttribute("href"))
|
|
6510
|
+
if (escapedHref) {
|
|
6511
|
+
selectorCandidate = `.frame-link[href="${escapedHref}"]`
|
|
6512
|
+
}
|
|
6513
|
+
}
|
|
6514
|
+
if (selectorCandidate) {
|
|
6515
|
+
global_selector = selectorCandidate
|
|
6516
|
+
}
|
|
6517
|
+
}
|
|
6495
6518
|
let shell = target.closest("[data-shell]")
|
|
6496
6519
|
if (shell) {
|
|
6497
6520
|
let shell_id = shell.getAttribute("data-shell")
|