-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckCudaErrors.cpp
executable file
·760 lines (743 loc) · 38.6 KB
/
checkCudaErrors.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
// Copyright 2019 André Hodapp
#include "checkCudaErrors.hpp"
namespace Unterfunktionen_checkCudaErrors {
/*
* returns the number of columns of the terminal
*/
unsigned int askTerminalSize(){
//use a file fp to save and get output of system command
FILE *fp;
char var[40];
//"tput cols" tells you the number of columns
fp = popen("tput cols", "r");
while (fgets(var, sizeof(var), fp) != NULL)
{
//printf("command line has columns size: %s\n", var);
}
pclose(fp);
unsigned int ret = atoi(var);
//system("tput cols");
return ret;
}
/*
* split a string in C++
* source: http://www.martinbroadhurst.com/how-to-split-a-string-in-c.html
*/
template <class Container>
void split(const std::string& str, Container& cont,
char delim)
{
std::size_t current, previous = 0;
current = str.find(delim);
while (current != std::string::npos) {
cont.push_back(str.substr(previous, current - previous));
previous = current + 1;
current = str.find(delim, previous);
}
cont.push_back(str.substr(previous, current - previous));
}
/*
* this function indents the lines of the descripton to make look nicer :)
*/
std::string descriptionFkt(const std::string& desc) {
//size of each line is defined by the terminal size -24
const unsigned int size_of_line = askTerminalSize()-24;
//split string in words
std::vector<std::string> substrings;
split(desc, substrings);
//variables
char indent[] = " ";
std::string ret = "-->description: \n";
ret = ret + indent;
unsigned int size_of_currentLine = 0;
//Am Anfang steht Deprecated
if(substrings.at(0).compare("Deprecated") == 0){
ret=ret+ " " + "|_DEPRECATED_|" + "\n";
}else{
ret = ret +" "+ substrings.at(0);
size_of_currentLine += substrings.at(0).size();
}
//put words into a string which has lines with
//lenght of size_of_line
for(long unsigned int i=1;i<substrings.size();++i){
if(size_of_currentLine + substrings.at(i).size()> size_of_line){
ret = ret + "\n" + indent;
size_of_currentLine = 0;
}
ret = ret +" "+ substrings.at(i);
size_of_currentLine += substrings.at(i).size();
}
return ret;
}
/*
* returns the type of nvrtc error
* the different errors are in :
* https://docs.nvidia.com/cuda/nvrtc/index.html#group__error_1g31e41ef222c0ea75b4c48f715b3cd9f0
* and the program itself is in https://github.com/ptillet/isaac/blob/master/include/isaac/external/CUDA/nvrtc.h
*/
std::string whichNvrtcResultError(const nvrtcResult& error) {
std::string ret{"Error: "};
ret.append(std::to_string(error));
ret.append("~");
std::string description;
switch (error)
{
case 0:
ret = "NO_Error: 0~NVRTC_SUCCESS";
break;
case 1: //NVRTC_ERROR_OUT_OF_MEMORY
ret = "1~NVRTC_ERROR_OUT_OF_MEMORY";
break;
case 2: //NVRTC_ERROR_PROGRAM_CREATION_FAILURE
ret = "2~NVRTC_ERROR_PROGRAM_CREATION_FAILURE";
break;
case 3: //NVRTC_ERROR_INVALID_INPUT
ret = "3~NVRTC_ERROR_INVALID_INPUT";
break;
case 4: //NVRTC_ERROR_INVALID_PROGRAM
ret = "4~NVRTC_ERROR_INVALID_PROGRAM";
break;
case 5: //NVRTC_ERROR_INVALID_OPTION
ret = "5~NVRTC_ERROR_INVALID_OPTION";
break;
case 6: //NVRTC_ERROR_COMPILATION
ret = "6~NVRTC_ERROR_COMPILATION";
break;
case 7: //NVRTC_ERROR_BUILTIN_OPERATION_FAILURE
ret = "7~NVRTC_ERROR_BUILTIN_OPERATION_FAILURE";
break;
case 8: //NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION
ret = "8~NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION";
break;
case 9: //NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION
ret = "9~NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION";
break;
case 10: //NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID
ret = "10~NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID";
break;
case 11: //NVRTC_ERROR_INTERNAL_ERROR
ret = "11~NVRTC_ERROR_INTERNAL_ERROR";
break;
default:
ret.append("~error_unknown");
description = "''It's a trap! Abort! We never left the CPU o(╥﹏╥)o'' But seriously: I don't know what happened, because it isn't even documented by NVIDIA.";
break;
}
return ret;
}
/*
* returns the type of error
* the different errors are in :
* https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9
*/
std::string whichError(const CUresult& error) {
std::string ret{" Error: "};
ret.append(std::to_string(error));
ret.append("~");
std::string description;
switch (error)
{
case 0:
ret = "NO_Error: 0~CUDA_SUCCESS";
description = "The API call returned with no errors. In the case of query calls, this also means that the operation being queried is complete (see cuEventQuery() and cuStreamQuery()).";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
break;
case 1:
ret.append("CUDA_ERROR_INVALID_VALUE");
description = "This indicates that one or more of the parameters passed to the API call is not within an acceptable range of values.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 2:
ret.append("CUDA_ERROR_OUT_OF_MEMORY");
description = "The API call failed because it was unable to allocate enough memory to perform the requested operation.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 3:
ret.append("CUDA_ERROR_NOT_INITIALIZED");
description = "This indicates that the CUDA driver has not been initialized with cuInit() or that initialization has failed.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 4:
ret.append("CUDA_ERROR_DEINITIALIZED ");
description = "This indicates that the CUDA driver is in the process of shutting down.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 5:
ret.append("CUDA_ERROR_PROFILER_DISABLED");
description = "This indicates profiler is not initialized for this run. This can happen when the application is running with external profiling tools like visual profiler.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 6:
ret.append("CUDA_ERROR_PROFILER_NOT_INITIALIZED");
description = "Deprecated This error return is deprecated as of CUDA 5.0. It is no longer an error to attempt to enable/disable the profiling via cuProfilerStart or cuProfilerStop without initialization.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 7:
ret.append("CUDA_ERROR_PROFILER_ALREADY_STARTED");
description = "Deprecated This error return is deprecated as of CUDA 5.0. It is no longer an error to call cuProfilerStart() when profiling is already enabled.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 8:
ret.append("CUDA_ERROR_PROFILER_ALREADY_STOPPED");
description = "Deprecated This error return is deprecated as of CUDA 5.0. It is no longer an error to call cuProfilerStop() when profiling is already disabled.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 100:
ret.append("CUDA_ERROR_NO_DEVICE");
description = "This indicates that no CUDA-capable devices were detected by the installed CUDA driver.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 101:
ret.append("CUDA_ERROR_INVALID_DEVICE");
description = "This indicates that the device ordinal supplied by the user does not correspond to a valid CUDA device.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 200:
ret.append("CUDA_ERROR_INVALID_IMAGE");
description = "This indicates that the device kernel image is invalid. This can also indicate an invalid CUDA module.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 201:
ret.append("CUDA_ERROR_INVALID_CONTEXT");
description = "This most frequently indicates that there is no context bound to the current thread. This can also be returned if the context passed to an API call is not a valid handle (such as a context that has had cuCtxDestroy() invoked on it). This can also be returned if a user mixes different API versions (i.e. 3010 context with 3020 API calls). See cuCtxGetApiVersion() for more details.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 202:
ret.append("CUDA_ERROR_CONTEXT_ALREADY_CURRENT");
description = "Deprecated This error return is deprecated as of CUDA 3.2. It is no longer an error to attempt to push the active context via cuCtxPushCurrent(). This indicated that the context being supplied as a parameter to the API call was already the active context.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 205:
ret.append("CUDA_ERROR_MAP_FAILED");
description = "This indicates that a map or register operation has failed.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 206:
ret.append("CUDA_ERROR_UNMAP_FAILED");
description = "This indicates that an unmap or unregister operation has failed.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 207:
ret.append("CUDA_ERROR_ARRAY_IS_MAPPED");
description = "This indicates that the specified array is currently mapped and thus cannot be destroyed.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 208:
ret.append("CUDA_ERROR_ALREADY_MAPPED");
description = "This indicates that the resource is already mapped.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 209:
ret.append("CUDA_ERROR_NO_BINARY_FOR_GPU");
description = "This indicates that there is no kernel image available that is suitable for the device. This can occur when a user specifies code generation options for a particular CUDA source file that do not include the corresponding device configuration.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 210:
ret.append("CUDA_ERROR_ALREADY_ACQUIRED");
description = "This indicates that a resource has already been acquired.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 211:
ret.append("CUDA_ERROR_NOT_MAPPED");
description = "This indicates that a resource is not mapped.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 212:
ret.append("CUDA_ERROR_NOT_MAPPED_AS_ARRAY");
description = "This indicates that a mapped resource is not available for access as an array.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 213:
ret.append("CUDA_ERROR_NOT_MAPPED_AS_POINTER");
description = "This indicates that a mapped resource is not available for access as a pointer.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 214:
ret.append("CUDA_ERROR_ECC_UNCORRECTABLE");
description = "This indicates that an uncorrectable ECC error was detected during execution.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 215:
ret.append("CUDA_ERROR_UNSUPPORTED_LIMIT");
description = "This indicates that the CUlimit passed to the API call is not supported by the active device.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 216:
ret.append("CUDA_ERROR_CONTEXT_ALREADY_IN_USE");
description = "This indicates that the CUcontext passed to the API call can only be bound to a single CPU thread at a time but is already bound to a CPU thread.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 217:
ret.append("CUDA_ERROR_PEER_ACCESS_UNSUPPORTED");
description = "This indicates that peer access is not supported across the given devices.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 218:
ret.append("CUDA_ERROR_INVALID_PTX ");
description = "This indicates that a PTX JIT compilation failed.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 219:
ret.append("CUDA_ERROR_INVALID_GRAPHICS_CONTEXT");
description = "This indicates an error with OpenGL or DirectX context.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 220:
ret.append("CUDA_ERROR_NVLINK_UNCORRECTABLE");
description = "This indicates that an uncorrectable NVLink error was detected during the execution.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 221:
ret.append("CUDA_ERROR_JIT_COMPILER_NOT_FOUND");
description = "This indicates that the PTX JIT compiler library was not found.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 300:
ret.append("CUDA_ERROR_INVALID_SOURCE");
description = "This indicates that the device kernel source is invalid.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 301:
ret.append("CUDA_ERROR_FILE_NOT_FOUND");
description = "This indicates that the file specified was not found.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 302:
ret.append("CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND");
description = "This indicates that a link to a shared object failed to resolve.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 303:
ret.append("CUDA_ERROR_SHARED_OBJECT_INIT_FAILED");
description = "This indicates that initialization of a shared object failed.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 304:
ret.append("CUDA_ERROR_OPERATING_SYSTEM");
description = "This indicates that an OS call failed.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 400:
ret.append("CUDA_ERROR_INVALID_HANDLE");
description = "This indicates that a resource handle passed to the API call was not valid. Resource handles are opaque types like CUstream and CUevent.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 401:
ret.append("CUDA_ERROR_ILLEGAL_STATE");
description = "This indicates that a resource required by the API call is not in a valid state to perform the requested operation.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 500:
ret.append("CUDA_ERROR_NOT_FOUND");
description = "This indicates that a named symbol was not found. Examples of symbols are global/constant variable names, texture names, and surface names.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 600:
ret.append("CUDA_ERROR_NOT_READY");
description = "This indicates that asynchronous operations issued previously have not completed yet. This result is not actually an error, but must be indicated differently than CUDA_SUCCESS (which indicates completion). Calls that may return this value include cuEventQuery() and cuStreamQuery().";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 700:
ret.append("CUDA_ERROR_ILLEGAL_ADDRESS");
description = "While executing a kernel, the device encountered a load or store instruction on an invalid memory address. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 701:
ret.append("CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES");
description = "This indicates that a launch did not occur because it did not have appropriate resources. This error usually indicates that the user has attempted to pass too many arguments to the device kernel, or the kernel launch specifies too many threads for the kernel's register count. Passing arguments of the wrong size (i.e. a 64-bit pointer when a 32-bit int is expected) is equivalent to passing too many arguments and can also result in this error.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 702:
ret.append("CUDA_ERROR_LAUNCH_TIMEOUT");
description = "This indicates that the device kernel took too long to execute. This can only occur if timeouts are enabled - see the device attribute CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT for more information. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 703:
ret.append("CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING");
description = "This error indicates a kernel launch that uses an incompatible texturing mode.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 704:
ret.append("CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED");
description = "This error indicates that a call to cuCtxEnablePeerAccess() is trying to re-enable peer access to a context which has already had peer access to it enabled.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 705:
ret.append("CUDA_ERROR_PEER_ACCESS_NOT_ENABLED");
description = "This error indicates that cuCtxDisablePeerAccess() is trying to disable peer access which has not been enabled yet via cuCtxEnablePeerAccess().";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 708:
ret.append("CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE");
description = "This error indicates that the primary context for the specified device has already been initialized.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 709:
ret.append("CUDA_ERROR_CONTEXT_IS_DESTROYED");
description = "This error indicates that the context current to the calling thread has been destroyed using cuCtxDestroy, or is a primary context which has not yet been initialized.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 710:
ret.append("CUDA_ERROR_ASSERT");
description = "A device-side assert triggered during kernel execution. The context cannot be used anymore, and must be destroyed. All existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 711:
ret.append("CUDA_ERROR_TOO_MANY_PEERS");
description = "This error indicates that the hardware resources required to enable peer access have been exhausted for one or more of the devices passed to cuCtxEnablePeerAccess().";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 712:
ret.append("CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED");
description = "This error indicates that the memory range passed to cuMemHostRegister() has already been registered.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 713:
ret.append("CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED");
description = "This error indicates that the pointer passed to cuMemHostUnregister() does not correspond to any currently registered memory region.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 714:
ret.append("CUDA_ERROR_HARDWARE_STACK_ERROR ");
description = "While executing a kernel, the device encountered a stack error. This can be due to stack corruption or exceeding the stack size limit. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 715:
ret.append("CUDA_ERROR_ILLEGAL_INSTRUCTION");
description = "While executing a kernel, the device encountered an illegal instruction. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 716:
ret.append("CUDA_ERROR_MISALIGNED_ADDRESS");
description = "While executing a kernel, the device encountered a load or store instruction on a memory address which is not aligned. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 717:
ret.append("CUDA_ERROR_INVALID_ADDRESS_SPACE");
description = "While executing a kernel, the device encountered an instruction which can only operate on memory locations in certain address spaces (global, shared, or local), but was supplied a memory address not belonging to an allowed address space. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 718:
ret.append("CUDA_ERROR_INVALID_PC");
description = "While executing a kernel, the device program counter wrapped its address space. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 719:
ret.append("CUDA_ERROR_LAUNCH_FAILED");
description = "An exception occurred on the device while executing a kernel. Common causes include dereferencing an invalid device pointer and accessing out of bounds shared memory. Less common cases can be system specific - more information about these cases can be found in the system specific user guide. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 720:
ret.append("CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE");
description = "This error indicates that the number of blocks launched per grid for a kernel that was launched via either cuLaunchCooperativeKernel or cuLaunchCooperativeKernelMultiDevice exceeds the maximum number of blocks as allowed by cuOccupancyMaxActiveBlocksPerMultiprocessor or cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags times the number of multiprocessors as specified by the device attribute CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 800:
ret.append("CUDA_ERROR_NOT_PERMITTED");
description = "This error indicates that the attempted operation is not permitted.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 801:
ret.append("CUDA_ERROR_NOT_SUPPORTED");
description = "This error indicates that the attempted operation is not supported on the current system or device.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 802:
ret.append("CUDA_ERROR_SYSTEM_NOT_READY");
description = "This error indicates that the system is not yet ready to start any CUDA work. To continue using CUDA, verify the system configuration is in a valid state and all required driver daemons are actively running. More information about this error can be found in the system specific user guide.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 803:
ret.append("CUDA_ERROR_SYSTEM_DRIVER_MISMATCH");
description = "This error indicates that there is a mismatch between the versions of the display driver and the CUDA driver. Refer to the compatibility documentation for supported versions.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 804:
ret.append("CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE");
description = "This error indicates that the system was upgraded to run with forward compatibility but the visible hardware detected by CUDA does not support this configuration. Refer to the compatibility documentation for the supported hardware matrix or ensure that only supported hardware is visible during initialization via the CUDA_VISIBLE_DEVICES environment variable.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 900:
ret.append("CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED");
description = "This error indicates that the operation is not permitted when the stream is capturing.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 901:
ret.append("CUDA_ERROR_STREAM_CAPTURE_INVALIDATED");
description = "This error indicates that the current capture sequence on the stream has been invalidated due to a previous error.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 902:
ret.append("CUDA_ERROR_STREAM_CAPTURE_MERGE");
description = "This error indicates that the operation would have resulted in a merge of two independent capture sequences.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 903:
ret.append("CUDA_ERROR_STREAM_CAPTURE_UNMATCHED");
description = "This error indicates that the capture was not initiated in this stream.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 904:
ret.append("CUDA_ERROR_STREAM_CAPTURE_UNJOINED");
description = "This error indicates that the capture sequence contains a fork that was not joined to the primary stream.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 905:
ret.append("CUDA_ERROR_STREAM_CAPTURE_ISOLATION");
description = "This error indicates that a dependency would have been created which crosses the capture sequence boundary. Only implicit in-stream ordering dependencies are allowed to cross the boundary.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 906:
ret.append("CUDA_ERROR_STREAM_CAPTURE_IMPLICIT");
description = "This error indicates a disallowed implicit dependency on a current capture sequence from cudaStreamLegacy.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 907:
ret.append("CUDA_ERROR_CAPTURED_EVENT");
description = "This error indicates that the operation is not permitted on an event which was last recorded in a capturing stream.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 908:
ret.append("CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD");
description = "A stream capture sequence not initiated with the CU_STREAM_CAPTURE_MODE_RELAXED argument to cuStreamBeginCapture was passed to cuStreamEndCapture in a different thread.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
case 999:
ret.append("CUDA_ERROR_UNKNOWN");
description = "This indicates that an unknown internal error has occurred.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
default:
ret.append("~error_unknown");
description = "''It's a trap! Abort! We never left the CPU o(╥﹏╥)o'' But seriously: I don't know what happened, because it isn't even documented by NVIDIA.";
//description is added to the return string
description = descriptionFkt(description);
ret.append("\n ");
ret.append(description);
return ret;
}
}
}