interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / om / tools / doctor.om

919 lines · 27770 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note doctor: the checklist decisions and text of tools/doctor/cudapp_doctor.c. The C shell probes (fopen and
3note fgets of the version file, access of the device files and nvcc paths, the PCI scan and chip table, the
4note meminfo sscanf, uname) and passes the facts here; this unit picks every line, parses the module
5note version, formats the memory figures (fmt.om) and counts the FAIL lines.
6note facts f (ulong 256), texts in the blob b (uchar 262144) as offset and length pairs:
7note 0,1 root; 2,3 ABI; 4,5 compiler; 6 uname ok; 7..12 sysname, release, machine; 13 version file read;
8note 14,15 its first line; 16..18 nvidiactl, nvidia0, nvidia-uvm (0 ok, 1 missing, 2 not rw); 19 GPU count
9note as scanned, this unit reports the first 16); 20 PCI scan failed; 21 meminfo read; 22 MemTotal kB; 23 MemAvailable kB; 24 nvcc
10note (0 none, 1 /usr/local/cuda/bin/nvcc, 2 /usr/bin/nvcc). GPU i at 32 + 12 i: 0,1 bdf; 2 in the chip
11note table; 3 device is GB10 (0x2e12); 4..9 name, sm, receipt when known, else 4,5 the refusal text.
12note Returns fails * 2^32 + output length, or 2^63 + 1 when the ABI or compiler text holds % or a newline
13note (the C printed them as part of a printf format), 2^63 + 2 when a refusal text has no newline or is
14note shorter than its "GPU <bdf>: " prefix.
15const DCGPU ulong 32
16const DCMB f64 1048576.0
17fn dc_s o edit uchar 786432 p ulong w ulong n ulong to ulong
18i = ulong 0
19while lt i n bound 9
20put o add p i uchar and shr w mul i 8 255
21i = add i 1
22end
23ret add p n
24end
25fn dc_cp o edit uchar 786432 p ulong b view uchar 262144 at ulong n ulong to ulong
26for i ulong n
27put o add p i get b add at i
28end
29ret add p n
30end
31fn dc_ft o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 i ulong to ulong
32ret dc_cp o p b get f i get f add i 1
33end
34fn dc_u o edit uchar 786432 p ulong v ulong to ulong
35w = fm_ndig v
36k = add p w
37x = v
38for i ulong w
39k = sub k 1
40put o k uchar add 48 rem x 10
41x = div x 10
42end
43ret add p w
44end
45note dc_tag: " %-5s " of FAIL (0), warn (1), ok (2), info (3); a FAIL counts in st 0.
46fn dc_tag o edit uchar 786432 p ulong st edit ulong 4 t ulong to ulong
47if eq t 0
48put st 0 add get st 0 1
49note s " FAIL "
50p = dc_s o p 2314934085979873312 8
51ret p
52end
53if eq t 1
54note s " warn "
55p = dc_s o p 2314971646008959008 8
56ret p
57end
58if eq t 2
59note s " ok "
60p = dc_s o p 2314885532081922080 8
61ret p
62end
63note s " info "
64p = dc_s o p 2314972694198165536 8
65ret p
66end
67note dc_more: one line " <segment>" per newline-ended segment of b at..at+n-1, plus the last one when
68note it is not empty (the C loop stops at the terminating zero).
69fn dc_more o edit uchar 786432 p ulong b view uchar 262144 at ulong n ulong to ulong
70s = at
71e = add at n
72while lt s e bound 262145
73note s " "
74p = dc_s o p 2314885530818453536 8
75k = s
76while lt k e bound 262145
77if eq get b k uchar 10
78break
79end
80k = add k 1
81end
82p = dc_cp o p b s sub k s
83put o p uchar 10
84p = add p 1
85s = add k 1
86end
87ret p
88end
89note dc_m8: 1 when b pos.. holds the n (<= 8) bytes of the little-endian word w before e.
90fn dc_m8 b view uchar 262144 pos ulong e ulong w ulong n ulong to ulong
91if gt add pos n e
92ret ulong 0
93end
94for i ulong n
95if ne ulong get b add pos i and shr w mul i 8 255
96ret ulong 0
97end
98end
99ret ulong 1
100end
101note dc_bad: 1 when the text at..at+n-1 holds % or a newline.
102fn dc_bad b view uchar 262144 at ulong n ulong to ulong
103for i ulong n
104c = get b add at i
105if eq c uchar 37
106ret ulong 1
107end
108if eq c uchar 10
109ret ulong 1
110end
111end
112ret ulong 0
113end
114note dc_mstart: index of the first "Module" in at..e-1 (strstr), at when there is none.
115fn dc_mstart b view uchar 262144 at ulong e ulong to ulong
116s = at
117while lt s e bound 262145
118note s "Module"
119if ne dc_m8 b s e 111516500389709 6 0
120ret s
121end
122s = add s 1
123end
124ret at
125end
126note dc_open: 1 when at..e-1 contains "Open Kernel Module".
127fn dc_open b view uchar 262144 at ulong e ulong to ulong
128s = at
129while lt s e bound 262145
130note s "Open Ker" "nel Modu" "le"
131a = dc_m8 b s e 8243077295634739279 8
132c = dc_m8 b add s 8 e 8459008377155773806 8
133d = dc_m8 b add s 16 e 25964 2
134if ne and and a c d 0
135ret ulong 1
136end
137s = add s 1
138end
139ret ulong 0
140end
141fn dc_dig c ulong to ulong
142if ge c 48
143if le c 57
144ret ulong 1
145end
146end
147ret ulong 0
148end
149note dc_ver: the first run of digits and dots after "Module" (or from the start) with more than two bytes,
150note a dot and fewer than 64 bytes: returns its offset * 256 + length, 0 when there is none.
151fn dc_ver b view uchar 262144 at ulong n ulong to ulong
152e = add at n
153s = dc_mstart b at e
154while lt s e bound 262145
155if ne dc_dig ulong get b s 0
156k = ulong 0
157dt = ulong 0
158while lt add s k e bound 262145
159c = ulong get b add s k
160if eq c 46
161dt = ulong 1
162else
163if eq dc_dig c 0
164break
165end
166end
167k = add k 1
168end
169if gt k 2
170if ne dt 0
171if lt k 64
172ret or shl s 8 k
173end
174end
175end
176s = add s sub k 1
177end
178s = add s 1
179end
180ret ulong 0
181end
182note dc_eq: 1 when the texts at a (length n) and at c (length m) are equal.
183fn dc_eq b view uchar 262144 a ulong n ulong c ulong m ulong to ulong
184if ne n m
185ret ulong 0
186end
187for i ulong n
188if ne get b add a i get b add c i
189ret ulong 0
190end
191end
192ret ulong 1
193end
194fn dc_abi o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 to ulong
195ret dc_ft o p f b 2
196end
197fn dc_mnone o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 st edit ulong 4 to ulong
198p = dc_tag o p st 0
199note s "NVIDIA kernel module: not loaded ("
200p = dc_s o p 7719241544247105102 8
201p = dc_s o p 8029109360601756261 8
202p = dc_s o p 8029390620829971812 8
203p = dc_s o p 7234298746084532340 8
204p = dc_s o p 10272 2
205p = dc_ft o p f b 0
206note s "/proc/driver/nvidia/version does not exist)\n"
207p = dc_s o p 8242765322112888879 8
208p = dc_s o p 7599382571296061033 8
209p = dc_s o p 8318823019982186852 8
210p = dc_s o p 8315174762841010025 8
211p = dc_s o p 7599935561254530592 8
212p = dc_s o p 170488947 4
213note s " CUDA++ uses no NVIDIA user-space software, but it talks to NVIDIA's kernel module.\n"
214p = dc_s o p 2314885530818453536 8
215p = dc_s o p 8439793166470894915 8
216p = dc_s o p 5629622052994639219 8
217p = dc_s o p 8319591351411034454 8
218p = dc_s o p 7305790156121666149 8
219p = dc_s o p 8242000134883210016 8
220p = dc_s o p 7575182620743445605 8
221p = dc_s o p 2338330744771059828 8
222p = dc_s o p 5279425298211827572 8
223p = dc_s o p 7958535002297411393 8
224p = dc_s o p 7815263158106352741 8
225p = dc_s o p 667237 3
226note s " Do this: sudo modprobe nvidia && sudo modprobe nvidia-uvm\n"
227p = dc_s o p 2314885530818453536 8
228p = dc_s o p 4211825973867343684 8
229p = dc_s o p 8029109373470339872 8
230p = dc_s o p 7935454016877785188 8
231p = dc_s o p 2748920225308371318 8
232p = dc_s o p 8029109373470339872 8
233p = dc_s o p 7935454016877785188 8
234p = dc_s o p 8535778565153909110 8
235p = dc_s o p 2669 2
236note s " If modprobe finds no module, install NVIDIA's open kernel module "
237p = dc_s o p 2314885530818453536 8
238p = dc_s o p 8246201347450365513 8
239p = dc_s o p 7236837538582061679 8
240p = dc_s o p 7237123112283545715 8
241p = dc_s o p 8317701148704599157 8
242p = dc_s o p 5284497113930817908 8
243p = dc_s o p 8101729933614729540 8
244p = dc_s o p 7308905025183444581 8
245p = dc_s o p 7308345369542074476 8
246p = dc_s o p 32 1
247p = dc_abi o p f b
248note s " (the open-gpu-kernel-modules release of that number), then run make doctor again.\n"
249p = dc_s o p 8101729874579040288 8
250p = dc_s o p 7722958061638086245 8
251p = dc_s o p 8029123654252917349 8
252p = dc_s o p 7309940825170670948 8
253p = dc_s o p 7381153934383080812 8
254p = dc_s o p 8461736434098271264 8
255p = dc_s o p 8367736664178909805 8
256p = dc_s o p 2336934389682693480 8
257p = dc_s o p 7165055622473015661 8
258p = dc_s o p 7593464113577226100 8
259p = dc_s o p 667246 3
260ret p
261end
262fn dc_mwrong o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 v ulong to ulong
263note s "NVIDIA kernel module: version "
264p = dc_s o p 7719241544247105102 8
265p = dc_s o p 8029109360601756261 8
266p = dc_s o p 7311066480264377700 8
267p = dc_s o p 35658687673202 6
268p = dc_cp o p b shr v 8 and v 255
269note s " is loaded; CUDA++ speaks the "
270p = dc_s o p 7233184986725312800 8
271p = dc_s o p 4702977657673573477 8
272p = dc_s o p 7737577168441453355 8
273p = dc_s o p 35619916226675 6
274p = dc_abi o p f b
275note s " interface\n"
276p = dc_s o p 7018422849374152992 8
277p = dc_s o p 681315 3
278note s " Why: CUDA++ builds its driver calls from the "
279p = dc_s o p 2314885530818453536 8
280p = dc_s o p 4923915573298554967 8
281p = dc_s o p 7811904092957780801 8
282p = dc_s o p 7214893546864669540 8
283p = dc_s o p 7017488320073984370 8
284p = dc_s o p 7885647255505693804 8
285p = dc_s o p 139140297760 5
286p = dc_abi o p f b
287note s " open-module headers\n"
288p = dc_s o p 8029123662842982176 8
289p = dc_s o p 7018130082676634980 8
290p = dc_s o p 44886549860 5
291note s " (third_party/nvidia-open-"
292p = dc_s o p 2314885530818453536 8
293p = dc_s o p 8097301097592943656 8
294p = dc_s o p 7599382571414483553 8
295p = dc_s o p 7954887939624888676 8
296p = dc_s o p 45 1
297p = dc_abi o p f b
298note s "). The layout of those calls can change between module versions,\n"
299p = dc_s o p 7791338854113357353 8
300p = dc_s o p 7381153998842067297 8
301p = dc_s o p 7142820555474367520 8
302p = dc_s o p 7953747407939595361 8
303p = dc_s o p 2334385705639764768 8
304p = dc_s o p 2336916743122085218 8
305p = dc_s o p 8511914812230627181 8
306p = dc_s o p 3203025184780153445 8
307p = dc_s o p 10 1
308note s " and a wrong layout fails in strange ways, so the doctor refuses instead of guessing.\n"
309p = dc_s o p 2314885530818453536 8
310p = dc_s o p 8248096844079722081 8
311p = dc_s o p 8032558527420001903 8
312p = dc_s o p 8317138478892610677 8
313p = dc_s o p 7021802806838192416 8
314p = dc_s o p 8320788950816221038 8
315p = dc_s o p 7307218078066221100 8
316p = dc_s o p 2338053702233842720 8
317p = dc_s o p 2338324178100708722 8
318p = dc_s o p 2334097595258072681 8
319p = dc_s o p 8319104491599193711 8
320p = dc_s o p 43728203369 5
321note s " This is the only version CUDA++ asks you to match: no toolkit, no framework build, no extension build.\n"
322p = dc_s o p 2314885530818453536 8
323p = dc_s o p 2338328219631577172 8
324p = dc_s o p 8749489599637973108 8
325p = dc_s o p 7957695011148363296 8
326p = dc_s o p 2317993992531559200 8
327p = dc_s o p 8462115405134787425 8
328p = dc_s o p 7166460028376806432 8
329p = dc_s o p 8031079698469501544 8
330p = dc_s o p 7935391421923290223 8
331p = dc_s o p 8603402928459751535 8
332p = dc_s o p 7811904092961993327 8
333p = dc_s o p 8675375920160189540 8
334p = dc_s o p 2336927755350730100 8
335p = dc_s o p 2865758617564514 7
336note s " Do this: install the "
337p = dc_s o p 2314885530818453536 8
338p = dc_s o p 4211825973867343684 8
339p = dc_s o p 7812726606361684256 8
340p = dc_s o p 139140297760 5
341p = dc_abi o p f b
342note s " open kernel module, or port the client to your version\n"
343p = dc_s o p 7307970478859120416 8
344p = dc_s o p 7237123112232644210 8
345p = dc_s o p 2338053340533189749 8
346p = dc_s o p 7307218078150061936 8
347p = dc_s o p 2338615488351593248 8
348p = dc_s o p 2338060278192697204 8
349p = dc_s o p 751660686516577654 8
350note s " (CONTRIBUTING.md, \"Port a driver version\": copy the new headers, rebuild, run make test and make hello-gpu).\n"
351p = dc_s o p 2314885530818453536 8
352p = dc_s o p 4776439401847669544 8
353p = dc_s o p 7236491060045239381 8
354p = dc_s o p 2338619928923480108 8
355p = dc_s o p 8243124888234369121 8
356p = dc_s o p 7957695011148363296 8
357p = dc_s o p 2340025105102420514 8
358p = dc_s o p 2339450055106586740 8
359p = dc_s o p 3203029539791922536 8
360p = dc_s o p 7236274654160450080 8
361p = dc_s o p 7020303052929376300 8
362p = dc_s o p 2338620986089301355 8
363p = dc_s o p 7308041941661544033 8
364p = dc_s o p 7434721071324293152 8
365p = dc_s o p 43724141936 5
366ret p
367end
368fn dc_mod o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 st edit ulong 4 to ulong
369if eq get f 13 0
370ret dc_mnone o p f b st
371end
372at = get f 14
373n = get f 15
374v = dc_ver b at n
375if eq v 0
376p = dc_tag o p st 0
377note s "NVIDIA kernel module: loaded, but its version could not be read from: "
378p = dc_s o p 7719241544247105102 8
379p = dc_s o p 8029109360601756261 8
380p = dc_s o p 8028827670876550500 8
381p = dc_s o p 8458358425190229089 8
382p = dc_s o p 7311066725328953460 8
383p = dc_s o p 8026294619592029042 8
384p = dc_s o p 2338616625292668021 8
385p = dc_s o p 2334097595219076450 8
386p = dc_s o p 35435316212326 6
387k = n
388if gt k 120
389k = ulong 120
390end
391p = dc_cp o p b at k
392note s "\n Do this: report it with the output of `cat /proc/driver/nvidia/version` attached.\n"
393p = dc_s o p 2314885530818453514 8
394p = dc_s o p 8316293034885989408 8
395p = dc_s o p 8390891584273653818 8
396p = dc_s o p 7526756837609466144 8
397p = dc_s o p 8391735665605768224 8
398p = dc_s o p 6926648854367729008 8
399p = dc_s o p 8030604433265287523 8
400p = dc_s o p 8243124888234372963 8
401p = dc_s o p 3414125872510561839 8
402p = dc_s o p 6948613773778380150 8
403p = dc_s o p 7307199665625391392 8
404p = dc_s o p 667236 3
405ret p
406end
407if eq dc_eq b shr v 8 and v 255 get f 2 get f 3 0
408p = dc_tag o p st 0
409ret dc_mwrong o p f b v
410end
411if eq dc_open b at add at n 0
412p = dc_tag o p st 1
413note s "NVIDIA kernel module: the closed module "
414p = dc_s o p 7719241544247105102 8
415p = dc_s o p 8029109360601756261 8
416p = dc_s o p 7526676312424740196 8
417p = dc_s o p 7234315298837569637 8
418p = dc_s o p 2334391233313467680 8
419p = dc_cp o p b shr v 8 and v 255
420note s " is loaded; CUDA++ was qualified on the open module of that version\n"
421p = dc_s o p 7233184986725312800 8
422p = dc_s o p 4702977657673573477 8
423p = dc_s o p 8151642187988216619 8
424p = dc_s o p 7234304265016861045 8
425p = dc_s o p 2334386829831073568 8
426p = dc_s o p 7237123112266199151 8
427p = dc_s o p 8367800735125302389 8
428p = dc_s o p 8318823019731771752 8
429p = dc_s o p 175009641 4
430note s " It uses the same calls and should work. If anything fails, switch to the open module and say so in your report.\n"
431p = dc_s o p 2314885530818453536 8
432p = dc_s o p 2338324178096125001 8
433p = dc_s o p 7308604917384833140 8
434p = dc_s o p 6998720730445734688 8
435p = dc_s o p 7815275222770148462 8
436p = dc_s o p 2318908997382905956 8
437p = dc_s o p 7526774392225818185 8
438p = dc_s o p 7811882119909043817 8
439p = dc_s o p 7166468868806814835 8
440p = dc_s o p 7307218078066286696 8
441p = dc_s o p 8029109369191821088 8
442p = dc_s o p 7236828442999420260 8
443p = dc_s o p 2337213314941154080 8
444p = dc_s o p 2338060278192696937 8
445p = dc_s o p 733651824152700274 8
446ret p
447end
448p = dc_tag o p st 2
449note s "NVIDIA kernel module: open module "
450p = dc_s o p 7719241544247105102 8
451p = dc_s o p 8029109360601756261 8
452p = dc_s o p 8101729689844610404 8
453p = dc_s o p 7815263158106353253 8
454p = dc_s o p 8293 2
455p = dc_cp o p b shr v 8 and v 255
456note s " (CUDA++ speaks "
457p = dc_s o p 3110651729373505568 8
458p = dc_s o p 2338330697593287456 8
459p = dc_abi o p f b
460note s ")\n"
461p = dc_s o p 2601 2
462ret p
463end
464fn dc_node o edit uchar 786432 p ulong i ulong to ulong
465if eq i 0
466note s "/dev/nvidiactl"
467p = dc_s o p 7599382571363165231 8
468p = dc_s o p 119247139334500 6
469ret p
470end
471if eq i 1
472note s "/dev/nvidia0"
473p = dc_s o p 7599382571363165231 8
474p = dc_s o p 811690340 4
475ret p
476end
477note s "/dev/nvidia-uvm"
478p = dc_s o p 7599382571363165231 8
479p = dc_s o p 30811018106071396 7
480ret p
481end
482fn dc_nod o edit uchar 786432 p ulong f view ulong 256 st edit ulong 4 to ulong
483bad = ulong 0
484for i ulong 3
485s = get f add 16 i
486if eq s 1
487p = dc_tag o p st 0
488note s "device files: "
489p = dc_s o p 7358993268768925028 8
490p = dc_s o p 35435416218729 6
491p = dc_node o p i
492note s " is missing\n"
493p = dc_s o p 8319108854100224288 8
494p = dc_s o p 174550633 4
495if eq i 2
496note s " Do this: sudo modprobe nvidia-uvm (creates /dev/nvidia-uvm; CUDA++ maps GPU memory through it)\n"
497p = dc_s o p 2314885530818453536 8
498p = dc_s o p 4211825973867343684 8
499p = dc_s o p 8029109373470339872 8
500p = dc_s o p 7935454016877785188 8
501p = dc_s o p 8535778565153909110 8
502p = dc_s o p 7310014169164554349 8
503p = dc_s o p 7306016311923274849 8
504p = dc_s o p 7019251898354904950 8
505p = dc_s o p 6143789756275127597 8
506p = dc_s o p 8097873589919498564 8
507p = dc_s o p 7308533321083330675 8
508p = dc_s o p 8243966800727011181 8
509p = dc_s o p 2987128040764962159 8
510p = dc_s o p 10 1
511else
512note s " Do this: sudo modprobe nvidia (or run nvidia-modprobe once, which creates the device files)\n"
513p = dc_s o p 2314885530818453536 8
514p = dc_s o p 4211825973867343684 8
515p = dc_s o p 8029109373470339872 8
516p = dc_s o p 7935454016877785188 8
517p = dc_s o p 2314885811220539766 8
518p = dc_s o p 2336934389682958120 8
519p = dc_s o p 7867051229370218094 8
520p = dc_s o p 2334380212662330479 8
521p = dc_s o p 7527520677224738415 8
522p = dc_s o p 7018141364397826921 8
523p = dc_s o p 2334386829831398772 8
524p = dc_s o p 7358993268768925028 8
525p = dc_s o p 11173145963625 6
526end
527bad = add bad 1
528end
529if eq s 2
530p = dc_tag o p st 0
531note s "device files: "
532p = dc_s o p 7358993268768925028 8
533p = dc_s o p 35435416218729 6
534p = dc_node o p i
535note s " exists but this user cannot open it for reading and writing\n"
536p = dc_s o p 2338340670574978336 8
537p = dc_s o p 8316293034886329698 8
538p = dc_s o p 7017488320073790752 8
539p = dc_s o p 7309464380405411438 8
540p = dc_s o p 8245921732316700782 8
541p = dc_s o p 7453010313196433952 8
542p = dc_s o p 7598266502335062304 8
543p = dc_s o p 44684962164 5
544note s " Do this: ask the machine's owner to add you to the group that owns it (ls -l on the file shows it),\n"
545p = dc_s o p 2314885530818453536 8
546p = dc_s o p 4211825973867343684 8
547p = dc_s o p 7307218077999128864 8
548p = dc_s o p 7308895142333738272 8
549p = dc_s o p 8243116152216122151 8
550p = dc_s o p 2334100875203540000 8
551p = dc_s o p 8367810652205838201 8
552p = dc_s o p 8103505641670206824 8
553p = dc_s o p 8606133097150837792 8
554p = dc_s o p 7793514839516672878 8
555p = dc_s o p 2336927441696399475 8
556p = dc_s o p 7308332182666569844 8
557p = dc_s o p 7575181530044592928 8
558p = dc_s o p 170666356 4
559note s " or set the module option NVreg_DeviceFileMode=0666.\n"
560p = dc_s o p 2314885530818453536 8
561p = dc_s o p 8367816086726406767 8
562p = dc_s o p 7815263158106350952 8
563p = dc_s o p 7957695015410409573 8
564p = dc_s o p 4926770202774228512 8
565p = dc_s o p 7811852429924333157 8
566p = dc_s o p 3904688382616227173 8
567p = dc_s o p 170800694 4
568bad = add bad 1
569end
570end
571if eq bad 0
572p = dc_tag o p st 2
573note s "device files: /dev/nvidiactl /dev/nvidia0 /dev/nvidia-uvm can be opened by this user\n"
574p = dc_s o p 7358993268768925028 8
575p = dc_s o p 7219024163114413161 8
576p = dc_s o p 7594310829029160549 8
577p = dc_s o p 7306016311806813025 8
578p = dc_s o p 7019251898354904950 8
579p = dc_s o p 7939694845922058288 8
580p = dc_s o p 8535778565153909110 8
581p = dc_s o p 7305437204000743533 8
582p = dc_s o p 2334102031707434784 8
583p = dc_s o p 2338328528881219938 8
584p = dc_s o p 44868924277 5
585end
586ret p
587end
588note dc_ref: the FAIL line of a refused GPU g (facts base g). The first line is the refusal text after
589note "GPU <bdf>: " up to its first newline (to its end when that newline is inside the prefix, as printf
590note "%.*s" with a negative precision prints all); the rest goes to dc_more.
591fn dc_ref o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 st edit ulong 4 g ulong to ulong
592at = get f add g 4
593n = get f add g 5
594e = add at n
595fi = add add at 6 get f add g 1
596nl = at
597while lt nl e bound 262145
598if eq get b nl uchar 10
599break
600end
601nl = add nl 1
602end
603if ge nl e
604put st 2 2
605ret p
606end
607if gt fi e
608put st 2 2
609ret p
610end
611p = dc_tag o p st 0
612note s "GPU "
613p = dc_s o p 542462023 4
614p = dc_ft o p f b g
615note s ": "
616p = dc_s o p 8250 2
617if ge nl fi
618p = dc_cp o p b fi sub nl fi
619else
620p = dc_cp o p b fi sub e fi
621end
622put o p uchar 10
623p = add p 1
624ret dc_more o p b add nl 1 sub e add nl 1
625end
626fn dc_gok o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 st edit ulong 4 g ulong to ulong
627p = dc_tag o p st 2
628note s "GPU "
629p = dc_s o p 542462023 4
630p = dc_ft o p f b g
631note s ": "
632p = dc_s o p 8250 2
633p = dc_ft o p f b add g 4
634note s " ("
635p = dc_s o p 10272 2
636p = dc_ft o p f b add g 6
637note s "), supported target (historical summary: "
638p = dc_s o p 8030041785346567209 8
639p = dc_s o p 8241996475536864370 8
640p = dc_s o p 8316292708468811111 8
641p = dc_s o p 2336349386297208692 8
642p = dc_s o p 4213524689155093875 8
643p = dc_s o p 32 1
644p = dc_ft o p f b add g 8
645note s ")\n"
646p = dc_s o p 2601 2
647note s " raw M16 evidence unavailable; not current-commit qualification\n"
648p = dc_s o p 2314885530818453536 8
649p = dc_s o p 2321096865283006834 8
650p = dc_s o p 7305804402280461925 8
651p = dc_s o p 7811882189719500064 8
652p = dc_s o p 8029390625124934241 8
653p = dc_s o p 7954890152741118068 8
654p = dc_s o p 8388356097741892980 8
655p = dc_s o p 7594873735819391264 8
656p = dc_s o p 2936174556766563 7
657if ne get f add g 3 0
658put st 1 1
659end
660ret p
661end
662fn dc_gpu o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 st edit ulong 4 to ulong
663if ne get f 20 0
664p = dc_tag o p st 0
665note s "GPU: cannot read "
666p = dc_s o p 7953747406981779527 8
667p = dc_s o p 7233174017378905966 8
668p = dc_s o p 32 1
669p = dc_ft o p f b 0
670note s "/sys/bus/pci/devices\n"
671p = dc_s o p 8319663842577183535 8
672p = dc_s o p 8531335223917637679 8
673p = dc_s o p 44885697385 5
674note s " Do this: run make doctor on the machine itself, not in a container without /sys.\n"
675p = dc_s o p 2314885530818453536 8
676p = dc_s o p 4211825973867343684 8
677p = dc_s o p 7737585620858794528 8
678p = dc_s o p 8245937413158084709 8
679p = dc_s o p 2334386829831073568 8
680p = dc_s o p 2334393380863435117 8
681p = dc_s o p 2318340523933529193 8
682p = dc_s o p 6998715218728873838 8
683p = dc_s o p 7955997369423586080 8
684p = dc_s o p 8027794332106912357 8
685p = dc_s o p 3347152483685266549 8
686p = dc_s o p 10 1
687ret p
688end
689n = get f 19
690if eq n 0
691p = dc_tag o p st 0
692note s "GPU: no NVIDIA GPU found in /sys/bus/pci/devices\n"
693p = dc_s o p 2337207816325255239 8
694p = dc_s o p 5125168158881699406 8
695p = dc_s o p 7236850772546180432 8
696p = dc_s o p 8320808432788465952 8
697p = dc_s o p 7594036745779634735 8
698p = dc_s o p 8315161591618561071 8
699p = dc_s o p 10 1
700note s " Do this: check the GPU is seated and powered (lspci | grep -i nvidia).\n"
701p = dc_s o p 2314885530818453536 8
702p = dc_s o p 4211825973867343684 8
703p = dc_s o p 8367806182301655840 8
704p = dc_s o p 7575148376516224360 8
705p = dc_s o p 7234316338103263347 8
706p = dc_s o p 8606220697354527008 8
707p = dc_s o p 8317066731434898021 8
708p = dc_s o p 8243593360416793456 8
709p = dc_s o p 8533793980014424165 8
710p = dc_s o p 2865505029940329 7
711ret p
712end
713if gt n 16
714n = ulong 16
715end
716for i ulong n
717g = add DCGPU mul i 12
718if ne get f add g 2 0
719p = dc_gok o p f b st g
720else
721p = dc_ref o p f b st g
722end
723end
724ret p
725end
726note dc_gib: "%.1f" of kB / 1048576.0, the kB count rounded to f64 first as (double) does.
727fn dc_gib o edit uchar 786432 p ulong v ulong to ulong
728t = new uchar 1600 0
729n = fm_f div f64 v DCMB 1 t
730for i ulong n
731put o add p i get t i
732end
733ret add p n
734end
735fn dc_mem o edit uchar 786432 p ulong f view ulong 256 st edit ulong 4 to ulong
736if eq get f 21 0
737p = dc_tag o p st 3
738note s "memory: cannot read /proc/meminfo\n"
739p = dc_s o p 2322302090265585005 8
740p = dc_s o p 8223700941521445219 8
741p = dc_s o p 8030604433264238949 8
742p = dc_s o p 7380952757880827747 8
743p = dc_s o p 2671 2
744ret p
745end
746if ne get st 1 0
747p = dc_tag o p st 2
748note s "memory: "
749p = dc_s o p 2322302090265585005 8
750p = dc_gib o p get f 22
751note s " GiB shared by the CPU and the GPU, "
752p = dc_s o p 7018986601647261472 8
753p = dc_s o p 8367821570011587954 8
754p = dc_s o p 6998687624145692008 8
755p = dc_s o p 5125207875246908526 8
756p = dc_s o p 539776336 4
757p = dc_gib o p get f 23
758note s " GiB available now\n"
759p = dc_s o p 7022907460111910688 8
760p = dc_s o p 7935454059608239209 8
761p = dc_s o p 685935 3
762ret p
763end
764p = dc_tag o p st 3
765note s "memory: "
766p = dc_s o p 2322302090265585005 8
767p = dc_gib o p get f 22
768note s " GiB system memory, "
769p = dc_s o p 8320808368934045472 8
770p = dc_s o p 8029185230041343348 8
771p = dc_s o p 539785586 4
772p = dc_gib o p get f 23
773note s " GiB available now\n"
774p = dc_s o p 7022907460111910688 8
775p = dc_s o p 7935454059608239209 8
776p = dc_s o p 685935 3
777ret p
778end
779fn dc_tk o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 st edit ulong 4 to ulong
780t = get f 24
781p = dc_tag o p st 3
782if eq t 0
783note s "CUDA toolkit: not needed and not used by CUDA++ (none installed)\n"
784p = dc_s o p 8029764342507656515 8
785p = dc_s o p 8029390621081430892 8
786p = dc_s o p 7234298763096760436 8
787p = dc_s o p 8390045716217487648 8
788p = dc_s o p 8746589041877808416 8
789p = dc_s o p 2317993992531559200 8
790p = dc_s o p 7955925836743274024 8
791p = dc_s o p 2982620369575310451 8
792p = dc_s o p 10 1
793else
794note s "CUDA toolkit: not needed and not used by CUDA++ (one is installed at "
795p = dc_s o p 8029764342507656515 8
796p = dc_s o p 8029390621081430892 8
797p = dc_s o p 7234298763096760436 8
798p = dc_s o p 8390045716217487648 8
799p = dc_s o p 8746589041877808416 8
800p = dc_s o p 2317993992531559200 8
801p = dc_s o p 2338328219397025576 8
802p = dc_s o p 7308335461136821865 8
803p = dc_s o p 139391475812 5
804if eq t 1
805note s "/usr/local/cuda/bin/nvcc"
806p = dc_s o p 7165064483209180463 8
807p = dc_s o p 3414120447861550177 8
808p = dc_s o p 7161698048063465826 8
809else
810note s "/usr/bin/nvcc"
811p = dc_s o p 7955998172649846063 8
812p = dc_s o p 426870468143 5
813end
814note s "; that is fine)\n"
815p = dc_s o p 7575182534950264891 8
816p = dc_s o p 732227939313524851 8
817end
818p = dc_tag o p st 3
819note s "compiler: this doctor was built by "
820p = dc_s o p 8243113893085146979 8
821p = dc_s o p 7214893499608735802 8
822p = dc_s o p 7023117819775837039 8
823p = dc_s o p 2338613306708861043 8
824p = dc_s o p 2128226 3
825p = dc_ft o p f b 4
826note s "; CUDA++ needs only make and a C compiler\n"
827p = dc_s o p 3110651729373503547 8
828p = dc_s o p 8007527012499811872 8
829p = dc_s o p 7308041941662919790 8
830p = dc_s o p 4836972791547715872 8
831p = dc_s o p 7308332226908742432 8
832p = dc_s o p 2674 2
833ret p
834end
835fn dc_head o edit uchar 786432 p ulong f view ulong 256 b view uchar 262144 st edit ulong 4 to ulong
836note s "cudapp doctor: is this machine ready for CUDA++?\n"
837p = dc_s o p 7214890231020156259 8
838p = dc_s o p 7575118836407755631 8
839p = dc_s o p 7863411845950087283 8
840p = dc_s o p 8223684444467782497 8
841p = dc_s o p 8245921732400275813 8
842p = dc_s o p 4551779407707325216 8
843p = dc_s o p 10 1
844note s "Diagnostic only: direct library use has no driver-version or PCI-ID admission guard.\n"
845p = dc_s o p 8391173050692888900 8
846p = dc_s o p 4213518147948405609 8
847p = dc_s o p 2338603393874486304 8
848p = dc_s o p 2340027244252129644 8
849p = dc_s o p 2338319731383432053 8
850p = dc_s o p 7311146985109614446 8
851p = dc_s o p 8028074745930329458 8
852p = dc_s o p 5279151288497414254 8
853p = dc_s o p 7596838514759846189 8
854p = dc_s o p 8459766083726439283 8
855p = dc_s o p 43728007777 5
856if ne get f 6 0
857p = dc_tag o p st 3
858note s "system: "
859p = dc_s o p 2322288840375761267 8
860p = dc_ft o p f b 7
861put o p uchar 32
862p = add p 1
863p = dc_ft o p f b 9
864put o p uchar 32
865p = add p 1
866p = dc_ft o p f b 11
867put o p uchar 10
868p = add p 1
869end
870ret p
871end
872fn dc_foot o edit uchar 786432 p ulong nf ulong to ulong
873if eq nf 0
874note s "READY. Next: make hello-gpu\n"
875p = dc_s o p 5629550495145215314 8
876p = dc_s o p 7737585619986315365 8
877p = dc_s o p 3273954666935230565 8
878p = dc_s o p 175468647 4
879ret p
880end
881note s "NOT READY: "
882p = dc_s o p 4918288487097323342 8
883p = dc_s o p 2112089 3
884p = dc_u o p nf
885note s " problem"
886p = dc_s o p 7882825892814286880 8
887if ne nf 1
888put o p uchar 115
889p = add p 1
890end
891note s " above. Fix the first FAIL line and run make doctor again.\n"
892p = dc_s o p 2318902417491648800 8
893p = dc_s o p 2334386829831727430 8
894p = dc_s o p 4703482545360234854 8
895p = dc_s o p 2334393380926147657 8
896p = dc_s o p 2336934389682040417 8
897p = dc_s o p 7165055622473015661 8
898p = dc_s o p 7593464113577226100 8
899p = dc_s o p 667246 3
900ret p
901end
902fn doctor f view ulong 256 b view uchar 262144 o edit uchar 786432 to ulong
903if ne or dc_bad b get f 2 get f 3 dc_bad b get f 4 get f 5 0
904ret or shl ulong 1 63 1
905end
906st = new ulong 4 0
907p = dc_head o 0 f b st
908p = dc_mod o p f b st
909p = dc_nod o p f st
910p = dc_gpu o p f b st
911if ne get st 2 0
912ret or shl ulong 1 63 2
913end
914p = dc_mem o p f st
915p = dc_tk o p f b st
916nf = get st 0
917p = dc_foot o p nf
918ret or shl nf 32 p
919end