Skip to content

Commit 63e3333

Browse files
committed
Fix actions test loading library
1 parent c89e0e0 commit 63e3333

4 files changed

Lines changed: 33 additions & 11 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@ jobs:
2424
runs-on: ${{ matrix.image }}
2525
steps:
2626
- uses: actions/checkout@v3
27-
- uses: actions/setup-node@v2
27+
- uses: actions/setup-node@v4
2828
with:
2929
node-version: '16'
3030
- run: |
3131
sudo apt-get install -y nvidia-driver-535
3232
sudo apt-get install -y libnvidia-ml-dev
3333
if: matrix.kernel == 'linux-x64'
34+
- uses: conda-incubator/setup-miniconda@v3
35+
with:
36+
activate-environment: nvml-tools
37+
if: matrix.kernel == 'win32-x64'
38+
- run: |
39+
conda install cuda-nvml-dev -c nvidia/label/cuda-12.9.1
40+
if: matrix.kernel == 'win32-x64'
3441
- run: npm run install-dependencies
3542
- run: npm run prebuild
3643
- uses: actions/upload-artifact@v4
@@ -76,19 +83,22 @@ jobs:
7683
runs-on: ${{ matrix.image }}
7784
needs: [pack-module]
7885
steps:
79-
- uses: actions/setup-node@v2
8086
- uses: actions/checkout@v3
8187
name: Fetch tests
8288
with:
8389
sparse-checkout: |
8490
test/
8591
sparse-checkout-cone-mode: false
92+
- uses: actions/setup-node@v2
8693
- uses: actions/download-artifact@v4
8794
name: Load bundled module
8895
id: download-module
8996
with:
9097
name: package
91-
- run: npm i ${{ needs.pack-module.outputs.tgz_name }}
98+
- run: ls
99+
- run: |
100+
npm init -y
101+
npm i ${{ needs.pack-module.outputs.tgz_name }}
92102
93103
- name: Basic CPU Test | Build Test
94104
run: npm exec tsc ./test/test_cpu_basic.ts

binding.gyp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,27 @@
1010
],
1111
"include_dirs": [
1212
"./node_modules/node-addon-api",
13-
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.9/include"
13+
"<!(echo %CUDA_PATH%)/include",
14+
"<!(echo %CONDA_PREFIX%)/Library/include",
1415
],
1516
"ldflags": [
1617
"-lpsapi", # gcc/g++
1718
"-lnvidia-ml",
1819
],
1920
"link_settings": {
2021
"libraries": [
21-
"psapi.lib" # msvc
22+
"psapi.lib", # msvc
23+
],
24+
"variables": {
25+
'has_cuda_path': '<!(if defined CUDA_PATH (echo 1) else (echo 0))',
26+
},
27+
"conditions": [
28+
['has_cuda_path==1', { # normal cuda toolkit install (used locally)
29+
"libraries": ["<!(echo %CUDA_PATH%)/lib/x64/nvml.lib"],
30+
}],
31+
['has_cuda_path==0', { # conda (used in github actions)
32+
"libraries": ["<!(echo %CONDA_PREFIX%)/Library/lib/nvml.lib"],
33+
}],
2234
]
2335
},
2436
"cflags!": [ "-fno-exceptions" ],

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "kaih2o",
66
"url": "https://github.com/2kai2kai2"
77
},
8-
"version": "1.4.1",
8+
"version": "1.5.0",
99
"keywords": [
1010
"process",
1111
"processes",
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"node-gyp": "^10.0.1",
28-
"node-gyp-build": "^4.8.4"
28+
"node-gyp-build": "^4.2.0"
2929
},
3030
"devDependencies": {
3131
"@types/node": "^16.9.6",
@@ -46,4 +46,4 @@
4646
},
4747
"type": "commonjs",
4848
"types": "index.d.ts"
49-
}
49+
}

0 commit comments

Comments
 (0)