cudafe++ reserves internal error indices 3457--3794 (338 slots) for CUDA-specific diagnostics. These are displayed to users as numbers 20000--20337 using the formula display = internal + 16543. Of the 338 slots, approximately 210 carry unique message templates; the remainder are reserved or share templates with parametric fill-ins. Every CUDA error can be controlled by its numeric code or diagnostic tag name via --diag_suppress, --diag_warning, --diag_error, or the #pragma nv_diagnostic system.
This page is a flat lookup table. For the diagnostic pipeline architecture (severity stack, pragma scoping, SARIF output), see Diagnostic Overview. For narrative discussion of each category with implementation details, see CUDA Errors.
These fire when --expt-relaxed-constexpr is not enabled.
Tag
Sev
Message
unsafe_device_call
W
calling a constexpr __device__ function(%sq1) from a __host__ function(%sq2) is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
unsafe_device_call
W
calling a constexpr __device__ function(%sq1) from a __host__ __device__ function(%sq2) is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
unsafe_device_call
W
calling a constexpr __host__ function(%sq1) from a __device__ function(%sq2) is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
unsafe_device_call
W
calling a constexpr __host__ function(%sq1) from a __global__ function(%sq2) is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
unsafe_device_call
W
calling a constexpr __host__ function(%sq1) from a __host__ __device__ function(%sq2) is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
unsafe_device_call
W
calling a constexpr __host__ function from a __host__ __device__ function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
A type that is defined inside a class and has private or protected access (%t) cannot be used in the template argument type of a __global__ function template instantiation, unless the class is local to a __device__ or __global__ function
global_private_template_arg
E
A template that is defined inside a class and has private or protected access cannot be used in the template template argument of a __global__ function template instantiation
global_unnamed_type_arg
E
An unnamed type (%t) cannot be used in the template argument type of a __global__ function template instantiation, unless the type is local to a __device__ or __global__ function
global_func_local_template_arg
E
A type defined inside a __host__ function (%t) cannot be used in the template argument type of a __global__ function template instantiation
global_lambda_template_arg
E
The closure type for a lambda (%t%s) cannot be used in the template argument type of a __global__ function template instantiation, unless the lambda is defined within a __device__ or __global__ function, or the flag '-extended-lambda' is specified and the lambda is an extended lambda
local_type_used_in_global_function
W
a local type %t (defined in %sq1) used in global function %sq2 template argument, the global function cannot be launched from host code.
(private/protected type in variable template instantiation)
variable_template_private_template_arg
E
(private template template arg in variable template)
variable_template_unnamed_type_template_arg
E
An unnamed type (%t) cannot be used in the template argument type of a variable template instantiation, unless the type is local to a __device__ or __global__ function
variable_template_func_local_template_arg
E
A type defined inside a __host__ function (%t) cannot be used in the template argument type of a variable template instantiation
variable_template_lambda_template_arg
E
The closure type for a lambda (%t%s) cannot be used in the template argument type of a variable template instantiation, unless the lambda is defined within a __device__ or __global__ function, or the lambda is an 'extended lambda' and the flag --extended-lambda is specified
Extended lambdas (__device__ or __host__ __device__ lambdas in host code, enabled by --extended-lambda) must have closure types serializable for device transfer.
An extended %s lambda cannot capture an array variable whose element type (%t) is not default constructible on the host
extended_lambda_init_capture_array
E
An extended %s lambda cannot init-capture variables with array type
extended_lambda_init_capture_initlist
E
An extended %s lambda cannot have init-captures with type std::initializer_list
extended_lambda_capture_in_constexpr_if
E
An extended %s lambda cannot first-capture variable in constexpr-if context
this_addr_capture_ext_lambda
W
Implicit capture of 'this' in extended lambda expression
extended_lambda_hd_init_capture
E
init-captures are not allowed for extended __host__ __device__ lambdas
--
E
Unless enabled by language dialect, *this capture is only supported when the lambda is either __device__ only, or is defined within a __device__ or __global__ function
A type local to a function (%t) cannot be used in the type of a variable captured by an extended __device__ or __host__ __device__ lambda
extended_lambda_capture_private_type
E
A type that is a private or protected class member (%t) cannot be used in the type of a variable captured by an extended __device__ or __host__ __device__ lambda
extended_lambda_call_operator_local_type
E
A type local to a function (%t) cannot be used in the return or parameter types of the operator() of an extended __device__ or __host__ __device__ lambda
extended_lambda_call_operator_private_type
E
A type that is a private or protected class member (%t) cannot be used in the return or parameter types of the operator() of an extended __device__ or __host__ __device__ lambda
extended_lambda_parent_local_type
E
A type local to a function (%t) cannot be used in the template argument of the enclosing parent function (and any parent classes) of an extended __device__ or __host__ __device__ lambda
extended_lambda_parent_private_type
E
A type that is a private or protected class member (%t) cannot be used in the template argument of the enclosing parent function (and any parent classes) of an extended __device__ or __host__ __device__ lambda
extended_lambda_parent_private_template_arg
E
A template that is a private or protected class member cannot be used in the template argument of the enclosing parent function (and any parent classes) of an extended %s lambda
The enclosing parent %n for an extended %s lambda cannot be a template which has a unnamed parameter
extended_lambda_multiple_parameter_packs
E
The enclosing parent template function (%sq2) for an extended %s1 lambda cannot have more than one variadic parameter, or it is not listed last in the template parameter list.
An extended %s1 lambda cannot be defined inside a generic lambda expression(%sq2).
extended_lambda_enclosing_function_hd_lambda
E
An extended %s1 lambda cannot be defined inside an extended __host__ __device__ lambda expression(%sq2).
extended_lambda_inaccessible_ancestor
E
An extended %s1 lambda cannot be defined inside a class (%sq2) with private or protected access within another class
extended_lambda_inside_constexpr_if
E
For this host platform/dialect, an extended lambda cannot be defined inside the 'if' or 'else' block of a constexpr if statement
extended_lambda_multiple_parent
E
Cannot specify multiple __nv_parent directives in a lambda declaration
extended_host_device_generic_lambda
E
__host__ __device__ extended lambdas cannot be generic lambdas
--
E
If an extended %s lambda is defined within the body of one or more nested lambda expressions, each of these enclosing lambda expressions must be defined within the immediate or nested block scope of a function.
__host__ or __device__ annotation on lambda requires --extended-lambda nvcc flag
extended_lambda_constexpr
E
The %s1 specifier is not allowed for an extended %s2 lambda
lambda_operator_annotated
E
The operator() function for a lambda cannot be explicitly annotated with execution space annotations (__host__/__device__/__global__), the annotations are derived from its closure class
A non-constexpr __device__ function (%sq1) with "auto" deduced return type cannot be directly referenced %s2, except if the reference is absent when __CUDA_ARCH__ is undefined
JIT mode (-dc for device-only compilation) restricts host constructs.
Tag
Sev
Message
no_host_in_jit
E
A function explicitly marked as a __host__ function is not allowed in JIT mode
unannotated_function_in_jit
E
A function without execution space annotations (__host__/__device__/__global__) is considered a host function, and host functions are not allowed in JIT mode. Consider using -default-device flag to process unannotated functions as __device__ functions in JIT mode
unannotated_variable_in_jit
E
A namespace scope variable without memory space annotations (__device__/__constant__/__shared__/__managed__) is considered a host variable, and host variables are not allowed in JIT mode. Consider using -default-device flag to process unannotated namespace scope variables as __device__ variables in JIT mode
unannotated_static_data_member_in_jit
E
A class static data member with non-const type is considered a host variable, and host variables are not allowed in JIT mode. Consider using -default-device flag to process such data members as __device__ variables in JIT mode
host_closure_class_in_jit
E
The execution space for the lambda closure class members was inferred to be __host__ (based on context). This is not allowed in JIT mode. Consider using -default-device to infer __device__ execution space for namespace scope lambda closure classes.
An inline __device__/__constant__/__managed__ variable must have internal linkage when the program is compiled in whole program mode (-rdc=false)
template_global_no_def
E
when "-static-global-template-stub=true" in whole program compilation mode ("-rdc=false"), a __global__ function template instantiation or specialization (%sq) must have a definition in the current translation unit
extern_kernel_template
E
when "-static-global-template-stub=true", extern __global__ function template is not supported in whole program compilation mode ("-rdc=false")
--
W
address of internal linkage device function (%sq) was taken (nv bug 2001144). mitigation: no mitigation required if the address is not used for comparison, or if the target function is not a CUDA C++ builtin
A texture or surface variable cannot be declared within an inline unnamed namespace
--
E
A texture or surface variable cannot be used in the non-type template argument of a __device__, __host__ __device__ or __global__ function template instantiation
reference_to_text_surf_type_in_device_func
E
a reference to texture/surface type cannot be used in __device__/__global__ functions
reference_to_text_surf_var_in_device_func
E
taking reference of texture/surface variable not allowed in __device__/__global__ functions
addr_of_text_surf_var_in_device_func
E
cannot take address of texture/surface variable %sq in __device__/__global__ functions
addr_of_text_surf_expr_in_device_func
E
cannot take address of texture/surface expression in __device__/__global__ functions
indir_into_text_surf_var_in_device_func
E
indirection not allowed for accessing texture/surface through variable %sq in __device__/__global__ functions
indir_into_text_surf_expr_in_device_func
E
indirection not allowed for accessing texture/surface through expression in __device__/__global__ functions
All 286 CUDA-specific diagnostic tag names extracted from the cudafe++ binary, organized alphabetically within functional groups. Every tag can be used with --diag_suppress, --diag_warning, --diag_error, or #pragma nv_diag_suppress / nv_diag_warning / nv_diag_error.
The following standard EDG error codes (0--3456) are repurposed or frequently triggered by CUDA-specific validation. These display with their original number (not the 20000-D series).
Internal #
Display #
Context
21
21
CUDA auto type with template deduction
147
147
redeclaration mismatch
149
149
illegal CUDA storage class at namespace scope
246
246
static member of non-class type
298
298
typedef/using with template name
325
325
thread_local in CUDA
337
337
calling convention mismatch
453
453
in template instantiation context
551
551
not a member function
795
795
definition in class scope with external linkage (CUDA)
799
799
definition in class scope (C++20 CUDA)
891
891
anonymous type in variable declaration
892
892
auto with __constant__ variable
893
893
auto with CUDA variable
948
948
calling convention mismatch on redeclaration
992
992
fatal error (suppress-all sentinel)
1034
1034
explicit instantiation with conflicting attributes
1063
1063
in include file context
1118
1118
CUDA attribute on namespace-scope variable
1150
1150
context lines truncated
1158
1158
auto return type with __global__
1306
1306
CUDA memory space mismatch on redeclaration
1418
1418
incomplete type in definition
1430
1430
function attribute mismatch in template
1560
1560
CUDA constexpr class with non-trivial destructor
1580
1580
redeclaration with different template parameters
1655
1655
tentative definition of constexpr
2384
2384
constexpr mismatch on redeclaration (CUDA)
2442
2442
extern variable at block scope with CUDA attribute
2443
2443
extern variable at block scope with CUDA attribute (variant)
2502
2502
no_unique_address mismatch
2503
2503
no_unique_address mismatch (variant)
2656
2656
internal error (assertion failure)
2885
2885
CUDA attribute on deduction guide
2937
2937
structured binding with CUDA attribute
3033
3033
incompatible constexpr CUDA target
3116
3116
restrict qualifier on definition
3414
3414
auto with volatile/atomic qualifier
3510
3510
__shared__ variable with VLA
3566
3566
__constant__ with constexpr with auto
3567
3567
CUDA variable with VLA type
3568
3568
__constant__ with constexpr
3578
3578
CUDA attribute in discarded constexpr-if branch
3579
3579
CUDA attribute at namespace scope with structured binding