NVCC options compatibility (v1.7)

Updated at:
Copy as MD

Option

Description

Status

File and Path Specifications

"-o, --output-file <file>"

Specifies the name and location of the output file.

✅

"-objtemp, --objdir-as-tempdir"

Creates all intermediate files in the same directory as the object file.

✅

"-include, --pre-include <file,…>"

Specifies header files to pre-include during preprocessing.

✅

"-l, --library <library,…>"

Specifies libraries for the linking stage, omitting the file extension.

✅

"-D, --define-macro <def,…>"

Defines macros for use during preprocessing.

✅

"-U --undefine-macro <def,…>"

Undefines an existing macro during preprocessing or compilation.

✅

"-I, --include-path <path,…>"

Specifies include search paths.

✅

"-isystem, --system-include <path,…>"

Specifies system include search paths.

✅

"-L, --library-path <path,…>"

Specifies library search paths.

✅

"-odir, --output-directory <directory>"

Specifies the output file directory.

✅

"-MF, --dependency-output <file>"

Specifies the dependency output file.

✅

"-MP, --generate-dependency-targets"

Adds an empty target for each dependency.

✅

"-ccbin, --compiler-bindir <directory>"

Specifies the directory of the default host compiler executable.

✅

"-allow-unsupported-compiler, --allow-unsupported-compiler"

Disables the nvcc check for supported host compiler versions.

✅

"-arbin, --archiver-binary <executable>"

Specifies the path to the archiver tool for creating a static library with --lib.

✅

"-cudart, --cudart <none|shared|static>"

Specifies the type of CUDA runtime library: none, shared (dynamic), or static.

✅

"-cudadevrt, --cudadevrt <none|static>"

Specifies the type of CUDA device runtime library: none or static.

✅

"-ldir, --libdevice-directory <directory>"

Specifies the directory containing the libdevice library files.

✅

"-target-dir, --target-directory <dir>"

Specifies the subfolder in the targets directory that contains the default include and library paths.

✅

Compilation Phase Specifications

"-link, --link"

Specifies the default behavior: compile and link all input files.

✅

"-lib, --lib"

Compiles input files into object files, if necessary, and adds them to the specified library output file.

✅

"-dlink, --device-link"

Links object files with relocatable device code and other inputs (.ptx, .cubin, .fatbin) into an object file containing executable device code for the host linker.

✅

"-dc, --device-c"

Compiles each source file into an object file containing relocatable device code. Equivalent to --relocatable-device-code=true --compile.

✅

"-dw, --device-w"

Compiles each source file into an object file containing executable device code. Equivalent to --relocatable-device-code=false --compile.

✅

"-cuda, --cuda"

Compiles each .cu input file to a .cu.cpp.ii file. This option is incompatible with --relocatable-device-code=true.

✅

"-c, --compile"

Compiles each source file into an object file.

✅

"-fatbin, --fatbin"

Compiles .cu, .ptx, and .cubin inputs into device-only .fatbin files, discarding any host code.

✅

"-cubin, --cubin"

Compiles .cu and .ptx inputs into device-only .cubin files, discarding any host code.

✅

"-ptx, --ptx"

Compiles .cu input files into device-only .ptx files, discarding any host code.

✅

"-E, --preprocess"

Preprocesses all source input files.

✅

"-M, --generate-dependencies"

Generates a Makefile-compatible dependency file for each source input file.

✅

"-MM, --generate-nonsystem-dependencies"

Same as --generate-dependencies, but skips header files in system directories (Linux only).

✅

"-MD, --generate-dependencies-with-compile"

Cannot be used with -E. Determines the dependency filename: if -MF is used, it sets the name; if -o is used, the name is derived by replacing the output file's suffix with .d; otherwise, it's derived by replacing the input file's suffix with .d.

✅

"-MMD, --generate-nonsystem-dependencies-with-compile"

Same as --generate-dependencies-with-compile, but skips header files in system directories (Linux only).

✅

"-run, --run"

Compiles and links all input files into an executable, then runs it.

✅

"-optix-ir, --optix-ir"

Compiles CUDA source to OptiX IR (.optixir). The resulting IR is for use by OptiX via its APIs. This option is incompatible with link-time optimization (-dlto), lto_NN -arch targets, and -gencode.

✅

"-ltoir, --ltoir"

Compiles CUDA source to LTO IR (.ltoir). This option requires link-time optimization (-dlto) or an lto_NN -arch target.

✅

Compiler/Linker Behavior Specifications

"-pg, --profile"

Instruments the generated code and executable for profiling with gprof.

✅

"-g, --debug"

Generates debug information for host code.

✅

"-G, --device-debug"

Generates debug information for device code.

✅

"-ewp, --extensible-whole-program"

Generates extensible whole-program device code. This allows some calls to remain unresolved until linking with libcudadevrt.

✅

"-no-compress, --no-compress"

Disables compression of device code in the fatbinary.

✅

"-lineinfo, --generate-line-info"

Generates line-number information for device code.

✅

"-opt-info, --optimization-info <kind,…>"

Provides optimization reports for a specified kind. Supported kinds include: inline: Emits remarks about function inlining. The compiler may run the inlining pass multiple times, so a function might be inlined in a later pass even if it was not inlined earlier.

✅

"-O, --optimize <level>"

Specifies the optimization level for host code.

✅

"-dlto, --dlink-time-opt"

Performs link-time optimization of device code. The '-lto' option is an alias for '-dlto'.

✅

"-ftemplate-backtrace-limit, --ftemplate-backtrace-limit <limit>"

Sets the maximum number of template instantiation notes for a single warning or error.

✅

"-ftemplate-depth, --ftemplate-depth <limit>"

Sets the maximum instantiation depth for template classes.

✅

"-noeh, --no-exceptions"

Disables exception handling for host code.

✅

"-shared, --shared"

Generates a shared library during linking.

✅

"-x, --x <c|c++|cu>"

Explicitly specifies the language for the input files, rather than letting the compiler choose a default based on the file name suffix.

✅

"-std, --std <c++03|c++11|c++14|c++17>"

Selects a particular C++ dialect.

✅

"-nohdinitlist, --no-host-device-initializer-list"

Does not implicitly consider member functions of std::initializer_list as __host__ __device__ functions.

✅

"-expt-relaxed-constexpr, --expt-relaxed-constexpr"

Experimental flag: Allows host code to invoke __device__ constexpr functions, and device code to invoke __host__ constexpr functions.

✅

"-extended-lambda, --extended-lambda" "-expt-extended-lambda, --expt-extended-lambda"

Allows __host__ and __device__ annotations in lambda declarations.

✅

"-m, --machine <32|64>" "-m32, --m32" "-m64, --m64"

Specifies a 32-bit or 64-bit architecture.

✅

"-hls, --host-linker-script <use-lcs|gen-lcs>"

Uses the host linker script (GNU/Linux only) to enable support for certain CUDA-specific requirements when building executable files or shared libraries.

✅

"-aug-hls, --augment-host-linker-script"

Enables generation of a host linker script that augments an existing host linker script (GNU/Linux only).

✅

"-r, --host-relocatable-link"

When used with -hls=gen-lcs, this option controls the behavior of -hls=gen-lcs and sets it to generate a host linker script that can be used in a host relocatable link (ld -r linkage).

✅

"-split-compile, --split-compile number "

[Experimental] Performs compiler optimization passes in parallel.

✅

"--split-compile-extended number, -split-compile-extended"

Enables a more aggressive form of parallel compilation than -split-compile. Only available with link-time optimization.

✅

"-gen-opt-lto, --gen-opt-lto"

Runs the optimizer passes before generating the LTO IR.

✅

"-dopt, --dopt <=on>"

Enables device code optimization. When specified with -G, this option enables limited debug information generation for optimized device code (currently, only line number information). When -G is not specified, -dopt=on is implicit.

✅

"-compress-mode, --compress-mode {default|size|speed|balance|none}"

Sets the compression mode for device code in the fatbinary.

✅

"-Ofc, --Ofast-compile <level>"

Specifies the fast-compile level for device code, which controls the trade-off between compilation speed and runtime performance by disabling certain optimizations.

✅

"-frandom-seed, --frandom-seed"

Uses the specified seed to generate deterministic symbol and variable names, enabling the creation of identical PTX and object files across compilations.

✅

"-sanitize, --sanitize"

Enables compiler instrumentation for a specified sanitizer, such as initcheck, racecheck, or memcheck.

✅

Passing Specific Phase Options

"-Xcompiler, --compiler-options <options,…>"

Specifies options directly to the compiler or preprocessor.

✅

"-Xlinker, --linker-options <options,…>"

Specifies options directly to the host linker.

✅

"-Xarchive, --archive-options <options,…>"

Specifies options directly to the library manager.

✅

"-Xptxas, --ptxas-options <options,…>"

Specifies options directly to ptxas, the PTX optimizing assembler.

✅

"-Xnvlink,--nvlink-options <options,…>"

Specifies options directly to nvlink, the device linker.

✅

Guiding Compiler Driver

"-forward-unknown-to-host-compiler, --forward-unknown-to-host-compiler"

Forwards unknown options to the host compiler.

✅

"-forward-unknown-to-host-linker, --forward-unknown-to-host-linker"

Forwards unknown options to the host linker.

✅

"-noprof, --dont-use-profile"

Ignores configurations from the nvcc.profile file.

✅

"-t, --threads number"

Specifies the maximum number of threads to use for executing compilation steps in parallel. This option can improve compilation speed when compiling for multiple architectures.

✅

"-dryrun, --dryrun"

Lists the compilation sub-commands without executing them.

✅

"-v, --verbose"

Lists the compilation sub-commands as they are executed.

✅

"-keep, --keep" "-save-temps, --save-temps"

Keeps all intermediate files that are generated during internal compilation steps.

✅

"-keep-dir, --keep-dir <directory>"

Keeps all intermediate files generated during internal compilation steps in this directory.

✅

"-clean, --clean-targets"

Deletes all the non-temporary files that the same nvcc command would generate without this option.

✅

"-run-args, --run-args <arguments,…>"

Specifies command line arguments for the executable when used with --run.

✅

"-idp, --input-drive-prefix <prefix>"

Specifies the input drive prefix.

✅

"-ddp, --dependency-drive-prefix <prefix>"

Specifies the dependency drive prefix.

✅

"-dp, --drive-prefix <prefix>"

Specifies the drive prefix.

✅

"-MT, --dependency-target-name <target>"

Specifies the target name for the generated rule when generating a dependency file.

✅

"--no-align-double"

Prevents nvcc from passing -malign-double as a compiler argument on 32-bit platforms.

✅

"-nodlink, --no-device-link"

Skips the device link step when linking object files.

✅

"--forward-unknown-opts, -forward-unknown-opts"

Combines the -forward-unknown-to-host-compiler and -forward-unknown-to-host-linker options.

✅

"--forward-slash-prefix-opts, -forward-slash-prefix-opts"

When forwarding of unknown options is enabled, this flag also forwards arguments that begin with /.

✅

"--device-stack-protector {true|false}, -device-stack-protector"

Enables or disables the generation of stack canaries in device code.

✅

"-allow-unsupported-compiler, --allow-unsupported-compiler"

Disables nvcc check for supported host compiler versions.

✅

"--use-local-env, -use-local-env"

Forces nvcc to assume the cl.exe environment is already configured, skipping the MSVC setup batch file. This can significantly reduce compile time.

✅

"-static-global-template-stub, --static-global-template-stub {true|false}"

In whole-program compilation mode (-rdc=false), forces static linkage for host side stub functions generated for __global__ function templates.

✅

"-device-entity-has-hidden-visibility, --device-entity-has-hidden-visibility {true|false} "

This flag applies to __global__ functions and function templates, and to __constant__, __device__, and __managed__ variables and variable templates, when using host compilers that support the visibility attribute (e.g. gcc, clang).

✅

"-force-cl-env-setup, --force-cl-env-setup"

Forces nvcc to always run the MSVC environment setup batch file for cl.exe, matching legacy nvcc behavior.

✅

Steering CUDA Compilation

"-default-stream, --default-stream <legacy|null|per-thread>"

Specifies the default stream to which CUDA commands from the compiled program are sent.

✅

--gpu-architecture

Specifies the name of the class of NVIDIA virtual GPU architecture for which the CUDA input files must be compiled.

✅

Steering GPU Code Generation

"-arch, --gpu-architecture <arch|all|all-major>"

Specifies the name of the class of NVIDIA virtual GPU architecture for which the CUDA input files must be compiled.

✅

"-code, --gpu-code <code,…>"

Specifies the name of the NVIDIA GPU to assemble and optimize PTX for.

✅

"-gencode, --generate-code <specification>"

Provides a generalization for the two options above.

✅

"-rdc, --relocatable-device-code <true|false>"

Enables or disables the generation of relocatable device code. If disabled, executable device code is generated. Relocatable device code must be linked before it can be executed.

✅

"-e, --entries <entry,…>"

Specifies the global entry functions for which code must be generated. PTX is generated for all entry functions, but only the selected entry functions are assembled. Entry function names for this option must be specified in their mangled form.

✅

"-maxrregcount, --maxrregcount <amount>"

Specifies the maximum amount of registers that GPU functions can use.

✅

"-use_fast_math, --use_fast_math"

Makes use of the fast math library. --use_fast_math implies --ftz=true --prec-div=false --prec-sqrt=false --fmad=true.

✅

"-ftz, --ftz <true|false>"

Controls single-precision denormals support. --ftz=true flushes denormal values to zero, and --ftz=false preserves denormal values.

✅

"-prec-div, --prec-div <true|false>"

This option controls single-precision floating-point division and reciprocals. --prec-div=true enables the IEEE round-to-nearest mode, and --prec-div=false enables the fast approximation mode.

✅

"-prec-sqrt, --prec-sqrt <true|false>"

This option controls single-precision floating-point square root. --prec-sqrt=true enables the IEEE round-to-nearest mode, and --prec-sqrt=false enables the fast approximation mode.

✅

"-fmad, --fmad <true|false>"

Enables or disables the contraction of floating-point multiplies and adds/subtracts into floating-point multiply-add operations (FMAD, FFMA, or DFMA).

✅

"-extra-device-vectorization, --extra-device-vectorization"

This option enables more aggressive device code vectorization.

✅

"-astoolspatch, --compile-as-tools-patch"

Compiles patch code for CUDA tools. This implies --keep-device-functions. May only be used in conjunction with --ptx or --cubin or --fatbin. Shall not be used in conjunction with -rdc=true or -ewp.

✅

"-keep-device-functions, --keep-device-functions"

In whole-program compilation mode, preserves user-defined external-linkage __device__ function definitions in the generated PTX.

✅

"--jump-table-density percentage, -jtd"

Specifies the case density percentage in switch statements, which is used as a threshold to decide whether to implement the statement with a jump table.

✅

Generic Tool Options

"-w, --disable-warnings"

Inhibits all warning messages.

✅

"-src-in-ptx, --source-in-ptx"

Interleaves source code in the PTX output.

✅

"-restrict, --restrict"

Asserts that all kernel pointer parameters are restrict pointers.

✅

"-Wno-deprecated-gpu-targets, --Wno-deprecated-gpu-targets"

Suppresses warnings about deprecated GPU target architectures.

✅

"-Wno-deprecated-declarations, --Wno-deprecated-declarations"

Suppresses warning on use of a deprecated entity.

✅

"-Wreorder, --Wreorder"

Generates warnings when member initializers are reordered.

✅

"-Wdefault-stream-launch, --Wdefault-stream-launch"

Generates a warning when an explicit stream argument is not provided in the <<<...>>> kernel launch syntax.

✅

"-Wext-lambda-captures-this, --Wext-lambda-captures-this"

Generates a warning when an extended lambda implicitly captures this.

✅

"-Werror, --Werror <kind,…>"

Makes warnings of the specified kinds into errors. The following kinds are accepted: all-warnings - Treat all warnings as errors. cross-execution-space-call - Be more strict about unsupported cross-execution space calls. The compiler will generate an error instead of a warning for a call from a __host__ __device__ function to a __host__ function. reorder - Generate errors when member initializers are reordered. default-stream-launch - Generate an error when an explicit stream argument is not provided in the <<<...>>> kernel launch syntax. ext-lambda-captures-this - Generate an error when an extended lambda implicitly captures this. deprecated-declarations - Generate an error on use of a deprecated entity.

✅

"-err-no, --display-error-number"

Displays a diagnostic number for messages from the CUDA frontend compiler (not the host compiler).

✅

"-no-err-no, --no-display-error-number"

Disables the display of diagnostic numbers for messages from the CUDA frontend compiler (not the host compiler).

✅

"-diag-error, --diag-error <errNum,…>"

Emits an error for specified diagnostic messages from the CUDA frontend compiler (note: does not affect diagnostics generated by the host compiler/preprocessor).

✅

"-diag-suppress, --diag-suppress <errNum,…>"

Suppresses specified diagnostic messages from the CUDA frontend compiler (note: does not affect diagnostics generated by the host compiler/preprocessor).

✅

"-diag-warn, --diag-warn <errNum,…>"

Emits a warning for specified diagnostic messages from the CUDA frontend compiler (note: does not affect diagnostics generated by the host compiler/preprocessor).

✅

"-res-usage, --resource-usage"

Shows resource usage of the GPU code, such as registers and memory.

✅

"-h, --help"

Prints help information for this tool.

✅

"-V, --version"

Prints version information for this tool.

✅

"-optf, --options-file <file,…>"

Includes command line options from the specified file.

✅

"-time, --time <filename>"

Generates a comma-separated value table with the time taken by each compilation phase and appends it to the specified file. If the file is empty, the column headings are generated in the first row. If the file name is '-', the timing data is generated in stdout.

✅

"-qpp-config, --qpp-config <config>"

Specifies the configuration ([[compiler/]version,][target]) for the q++ host compiler. The argument is forwarded to the q++ compiler's -V flag.

✅

"-code-ls, --list-gpu-code"

Lists the GPU architectures (sm_XX) supported by the tool and exits.

✅

"-arch-ls, --list-gpu-arch"

Lists the virtual device architectures (compute_XX) supported by the tool and exits.

✅

--Wmissing-launch-bounds, -Wmissing-launch-bounds

Generates a warning when a __global__ function does not have an explicit __launch_bounds__ annotation.

✅

Ptxas Options

"-allow-expensive-optimizations, --allow-expensive-optimizations"

Allows the compiler to use maximum available resources (memory and compile time) for expensive optimizations. This is enabled by default at optimization level -O2 and higher.

✅

"-c, --compile-only"

Generates a relocatable object.

✅

"-dlcm, --def-load-cache"

Default cache modifier on global/generic load. Default value: ca.

✅

"-dscm, --def-store-cache"

Default cache modifier on global/generic store.

✅

"-g, --device-debug"

Generates debug information for device code.

✅

"-disable-optimizer-consts, --disable-optimizer-consts"

Disables use of the optimizer constant bank.

✅

"-e, --entry <entry,…>"

Specifies the global entry functions for which code must be generated.

✅

"-fmad, --fmad"

Enables or disables the contraction of floating-point multiplies and adds/subtracts into floating-point multiply-add operations (FMAD, FFMA, or DFMA).

✅

"-flcm, --force-load-cache"

Forces the specified cache modifier on a global or generic load.

✅

"-fscm, --force-store-cache"

Forces the specified cache modifier on a global or generic store.

✅

"-lineinfo, --generate-line-info"

Generates line-number information for device code.

✅

"-arch, --gpu-name <gpuname>"

Specifies the name of the NVIDIA GPU to generate code for. This option also takes virtual compute architectures, in which case code generation is suppressed. This can be used for parsing only. Allowed values for this option: compute_35, compute_37, compute_50, compute_52, compute_53, compute_60, compute_61, compute_62, compute_70, compute_72, compute_75, compute_80, compute_86, compute_87, lto_35, lto_37, lto_50, lto_52, lto_53, lto_60, lto_61, lto_62, lto_70, lto_72, lto_75, lto_80, lto_86, lto_87, sm_35, sm_37, sm_50, sm_52, sm_53, sm_60, sm_61, sm_62, sm_70, sm_72, sm_75, sm_80, sm_86, sm_87

✅

"-h, --help"

Prints help information.

✅

"-m, --machine"

Specifies 32-bit vs. 64-bit architecture.

✅

"-maxrregcount, --maxrregcount <amount>"

Specifies the maximum amount of registers that GPU functions can use.

✅

"-O, --opt-level <N>"

Specifies the optimization level. Default value: 3.

✅

"-optf, --options-file <file,…>"

Includes command line options from the specified file.

✅

"-preserve-relocs, --preserve-relocs"

Instructs ptxas to generate relocatable references for variables and preserve their corresponding relocations in the linked executable.

✅

"-sp-bound-check, --sp-bound-check"

Generates stack-pointer bounds-checking code. This is enabled automatically with --device-debug or --opt-level=0.

✅

"-v, --verbose"

Enables verbose mode, which prints code generation statistics.

✅

"-V, --version"

Prints version information.

✅

"-Werror, --warning-as-error"

Makes all warnings into errors.

✅

"-warn-double-usage, --warn-on-double-precision-use"

Issues a warning if double-precision values are used in an instruction.

✅

"-warn-lmem-usage, --warn-on-local-memory-usage"

Issues a warning if local memory is used.

✅

"-warn-spills, --warn-on-spills"

Issues a warning if register spilling to local memory occurs.

✅

"-astoolspatch, --compile-as-tools-patch"

Compiles patch code for CUDA tools. Cannot be used in conjunction with -Xptxas -c or -ewp.

✅

"-pic, --position-independent-code"

Generates position-independent code.

✅

"-maxntid, --maxntid"

Specifies the maximum number of threads that a thread block can have.

✅

"-minnctapersm, --minnctapersm"

Specifies the minimum number of CTAs to be mapped to an SM.

✅

"--make-errors-visible-at-exit, -make-errors-visible-at-exit"

Generates instructions at kernel exit points to ensure memory faults and errors are reported.

✅

"--oFast-compile, -Ofc"

Specifies the fast-compile level for device code, which controls the trade-off between compilation speed and runtime performance by disabling certain optimizations.

✅

"--device-stack-protector {true|false}, -device-stack-protector"

Enables or disables the generation of stack canaries in device code.

✅

"--override-directive-values, -override-directive-values"

Overrides PTX directive values with those from corresponding command-line options. This is only effective for -minnctapersm, -maxntid, and -maxrregcount.

✅

"--suppress-async-bulk-multicast-advisory-warning, -suppress-async-bulk-multicast-advisory-warning"

Suppresses the warning for using the .multicast::cluster modifier on cp.async.bulk{.tensor} instructions with sm_90.

✅

"--position-independent-code, -pic"

Generates position-independent code.

✅

"-g-tmem-access-check, --g-tensor-memory-access-check"

Enables tensor memory access checks for tcgen05 operations.

✅

"-split-compile, --split-compile"

Specifies the maximum number of concurrent threads to use for compiler optimizations.

✅

Nvlink Options

"-w, --disable-warnings"

Inhibits all warning messages.

✅

"-preserve-relocs, --preserve-relocs"

Preserves resolved relocations in the linked executable.

✅

"-v, --verbose"

Enables verbose mode, which prints code generation statistics.

✅

"-Werror, --warning-as-error"

Makes all warnings into errors.

✅

"-suppress-arch-warning, --suppress-arch-warning"

Suppresses the warning for objects that lack code for the target architecture.

✅

"-suppress-stack-size-warning, --suppress-stack-size-warning"

Suppresses the warning that is otherwise printed when the stack size cannot be determined.

✅

"-dump-callgraph, --dump-callgraph"

Dumps information about the callgraph and register usage.

✅

--dump-callgraph-no-demangle (-dump-callgraph-no-demangle)

Dumps callgraph information without demangling.

✅

--Xptxas (-Xptxas)

Passes options to ptxas. Only used with link-time optimization (-dlto).

✅

--cpu-arch (-cpu-arch)

Specifies the target CPU architecture.

✅

--extra-warnings (-extrawarn)

Emits additional warnings about potential issues.

✅

--gen-host-linker-script (-ghls)

Specifies the type of host linker script to generate.

✅

--ignore-host-info (-ignore-host-info)

Ignores host reference information, which prevents the linker from removing device code that might be referenced by the host.

✅

--keep-system-libraries (-keep-system-libraries)

Prevents the removal of system library code (e.g., cudadevrt) during optimization.

✅

--kernels-used (-kernels-used)

Specifies which kernels are in use. This can be part of a kernel name, in which case any kernel with that string in its name is matched. If this option is used, any other kernels are considered dead code and are removed.

✅

--options-file (-optf)

Includes command-line options from a specified file.

✅

--report-arch (-report-arch)

Includes the target SM architecture in error messages.

✅

--suppress-debug-info (-suppress-debug-info)

Strips debug symbols from the output. This option is ignored if used without --debug.

✅

--variables-used (-variables used)

Specifies which variables are in use. This can be part of a variable name, in which case any variable with that string in its name is matched. If this option is used, any other variables are considered dead code and may be removed if not accessed from other device code.

✅

--device-stack-protector {true|false} (-device-stack-protector)

Enables or disables the generation of stack canaries in device code (LTO only). Stack canaries help mitigate certain memory safety bugs involving stack-local variables. The

❌