File tree 2 files changed +32
-8
lines changed
2 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,10 @@ jobs:
67
67
- id : dist
68
68
uses : casperdcl/deploy-pypi@v2
69
69
with :
70
+ requirements : twine setuptools wheel setuptools_scm[toml] tqdm miutil[web]
70
71
build : true
71
72
password : ${{ secrets.PYPI_TOKEN }}
72
73
upload : ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
73
- requirements : twine setuptools>=42 wheel setuptools_scm[toml]>=3.4 tqdm miutil[web]>=0.7.0
74
74
- name : Changelog
75
75
run : git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
76
76
- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
Original file line number Diff line number Diff line change 23
23
24
24
prefix = sys .prefix
25
25
pyhdr = get_python_inc () # Python header paths
26
- mincc = 35 # minimum required CUDA compute capability
26
+ minc_c = 3 , 5 # minimum required CUDA compute capability
27
+ mincc = minc_c [0 ] * 10 + minc_c [1 ]
27
28
28
29
29
30
def path_niftypet_local ():
@@ -103,17 +104,40 @@ def dev_setup():
103
104
104
105
from miutil import cuinfo
105
106
107
+ # map from CUDA device order (CC) to NVML order (PCI bus)
108
+ nvml_id = [
109
+ i
110
+ for _ , i in sorted (
111
+ ((cuinfo .compute_capability (i ), i ) for i in range (cuinfo .num_devices ())),
112
+ reverse = True ,
113
+ )
114
+ ]
106
115
if "DEVID" in Cnt :
107
116
devid = int (Cnt ["DEVID" ])
108
- ccstr = cuinfo .nvcc_flags (devid )
109
- ccs = ["{:d}{:d}" .format (* cuinfo .compute_capability (devid ))]
117
+ ccstr = cuinfo .nvcc_flags (nvml_id [ devid ] )
118
+ ccs = ["{:d}{:d}" .format (* cuinfo .compute_capability (nvml_id [ devid ] ))]
110
119
else :
111
- devid = cuinfo .num_devices () - 1
112
- if devid == - 1 :
120
+ devid = 0
121
+ devs = cuinfo .num_devices ()
122
+ if devs < 1 :
123
+ return ""
124
+ ccstr = ";" .join (
125
+ sorted (
126
+ {
127
+ cuinfo .nvcc_flags (i )
128
+ for i in range (devs )
129
+ if cuinfo .compute_capability (i ) >= minc_c
130
+ }
131
+ )
132
+ )
133
+ if not ccstr :
113
134
return ""
114
- ccstr = ";" .join (set (map (cuinfo .nvcc_flags , range (devid + 1 ))))
115
135
ccs = sorted (
116
- {"{:d}{:d}" .format (* cuinfo .compute_capability (i )) for i in range (devid + 1 )}
136
+ {
137
+ "{:d}{:d}" .format (* cuinfo .compute_capability (i ))
138
+ for i in range (devs )
139
+ if cuinfo .compute_capability (i ) >= minc_c
140
+ }
117
141
)
118
142
119
143
# passing this setting to resources.py
You can’t perform that action at this time.
0 commit comments