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