pinokiod 5.1.30 → 5.1.32

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/bin/cuda.js +28 -2
  2. package/package.json +1 -1
@@ -1,7 +1,33 @@
1
1
  const semver = require('semver')
2
2
  const fs = require('fs')
3
3
  const path = require('path')
4
+ const { glob } = require('glob')
4
5
  class Cuda {
6
+ async hasNvTargetHeader() {
7
+ const prefix = this.kernel.bin.path("miniconda")
8
+ const patterns = [
9
+ "Library/include/nv/target",
10
+ "include/nv/target",
11
+ "Library/targets/*/include/nv/target",
12
+ "targets/*/include/nv/target",
13
+ ]
14
+ for (const pattern of patterns) {
15
+ if (pattern.includes("*")) {
16
+ try {
17
+ const matches = await glob(pattern, { cwd: prefix, absolute: true, nodir: true })
18
+ if (matches && matches.length > 0) {
19
+ return true
20
+ }
21
+ } catch (e) {}
22
+ } else {
23
+ try {
24
+ await fs.promises.stat(path.resolve(prefix, pattern))
25
+ return true
26
+ } catch (e) {}
27
+ }
28
+ }
29
+ return false
30
+ }
5
31
  async patchCudaActivationScript() {
6
32
  if (this.kernel.platform !== "win32") {
7
33
  return
@@ -60,7 +86,7 @@ class Cuda {
60
86
  await this.kernel.bin.exec({
61
87
  message: [
62
88
  "conda clean -y --all",
63
- "conda install -y nvidia/label/cuda-12.8.1::cuda nvidia/label/cuda-12.8.1::cuda-cccl"
89
+ "conda install -y nvidia/label/cuda-12.8.1::cuda conda-forge::cuda-cccl"
64
90
  ]
65
91
  }, ondata)
66
92
  await this.stashActivationScripts()
@@ -98,7 +124,7 @@ class Cuda {
98
124
  console.log("cuda version", coerced)
99
125
  if (semver.satisfies(coerced, ">=12.8.1")) {
100
126
  console.log("cuda satisfied")
101
- if (!this.kernel.bin.installed.conda.has("cuda-cccl")) {
127
+ if (!(await this.hasNvTargetHeader())) {
102
128
  return false
103
129
  }
104
130
  let deactivate_list = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "5.1.30",
3
+ "version": "5.1.32",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {