Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Flags Reference

Quick-reference table of every command-line flag recognized by nvlink v13.0.88. Flags are sorted alphabetically for fast lookup. For implementation details (registration addresses, global variable mappings, post-extraction validation, mutual-exclusion rules) see pipeline/cli-options.md.

Total flags65 (including 4 hidden/internal)
Parser entrynvlink_parse_options at 0x427AE0 (30,272 bytes)
Registration calloption_register at 0x42F130, called once per flag
Binarynvlink v13.0.88, CUDA 13.0

Reading the Table

Type -- the parser's internal type code: bool (1-byte 0/1), string (8-byte pointer), int (4-byte dword), file-list (linked list of positional args).

Default -- the value the parser assigns if the flag is absent from the command line. -- means no default (value is zero-initialized or not applicable for booleans).

Visibility -- whether the flag appears in --help output. Hidden flags have registration flag bit 2 (0x04) or bit 3 (0x08) set.

Alphabetical Flag Table

#FlagShortTypeDefaultVisibilityDescription
1--allow-undefined-globals--boolfalsehiddenAllow undefined globals and their relocations in linked executable.
2--arch-archstring(none)publicSpecify the sm_ name of the target GPU architecture. Validated against the supported SM table; must be > sm_19.
3--cpu-arch-cpu-archstringunknownpublicSpecify the host CPU architecture. Allowed values: unknown, X86, X86_64, ARMv7, AARCH64, PPC64LE.
4--cuda-api-version-cuda-api-versionstring(none)hiddenCUDA API version for linking. Parsed as %u.%u; major must match toolkit version.
5--debug-gboolfalsepublicMark this as a debug compile. Enables DWARF processing and forces verbose tkinfo.
6--device-stack-protector-device-stack-protectorboolfalsepublicEnable device-side stack protectors.
7--device-stack-protector-frame-size-threshold-device-stack-protector-frame-size-thresholdint0hiddenSet the minimum frame size (bytes) that triggers stack protector insertion.
8--disable-infos-disable-infosboolfalsepublicSuppress all informational messages.
9--disable-smem-reservation-disable-smem-reservationboolfalsehiddenDisable shared memory reservation. Accepts true/false value.
10--disable-warnings-wboolfalsepublicInhibit all warning messages.
11--dlto-dltoboolfalsepublicEnable link-time optimization (alias for --link-time-opt). Sets the LTO master flag.
12--dont-reserve-null-pointer-dont-reserve-null-pointerboolfalsehiddenDo not reserve address 0 as NULL. Always overrides --reserve-null-pointer regardless of order.
13--dot-file-dotstring(none)hiddenWrite callgraph in DOT format to the specified file.
14--dump-callgraph-dump-callgraphboolfalsepublicDump callgraph information to stderr. Mutually exclusive with --dump-callgraph-no-demangle.
15--dump-callgraph-no-demangle-dump-callgraph-no-demangleboolfalsepublicDump callgraph without C++ name demangling. Mutually exclusive with --dump-callgraph.
16--edbg-edbgint0internalInternal ELF debugging output level. Flag bits = 0x08 (strongest hiding).
17--emit-ptx-emit-ptxboolfalsepublicEmit PTX intermediate file when LTO is used. Requires --lto or --dlto.
18--enable-extended-smem-enable-extended-smemboolfalsehiddenEnable extended (> 48 KB) shared memory. Accepts true/false value.
19--extra-warnings-extrawarnboolfalsepublicEmit extra warnings about possible linking problems.
20--fdcmpt-fdcmptboolfalsehiddenForward-compatibility flag. Requires --uumn; without it a warning is emitted. Both set on SM <= 69 is a fatal error.
21--force-partial-lto-force-partial-ltoboolfalsehiddenForce partial LTO when --dlto is specified. Mutually exclusive with --force-whole-lto.
22--force-rela-force-relaboolfalsehiddenForce RELA relocations in executables instead of REL.
23--force-whole-lto-force-whole-ltoboolfalsehiddenForce whole-program LTO when --dlto is specified. Mutually exclusive with --force-partial-lto.
24--gen-host-linker-script-ghlsstringlcs-abspublicGenerate a host linker script. Allowed values: lcs-aug (augmented), lcs-abs (absolute).
25--help-hbool--publicPrint help information and exit.
26--host-ccbin-host-ccbinstring(none)hiddenPath to host compiler binary (gcc/clang).
27--host-linker-options-Xlinkerstring(none)hiddenOptions forwarded directly to the host linker. Multi-value (accumulates). Ignored by device linker.
28--ignore-host-info-ignore-host-infoboolfalsepublicIgnore host reference information; do not remove potentially host-referenced device code. Mutually exclusive with --use-host-info.
29--keep-system-libraries-keep-system-librariesboolfalsepublicDo not optimize away system library code (e.g. cudadevrt).
30--kernels-used-kernels-usedstring(none)publicSubstring-match list of kernels to keep; all others are treated as dead code. Multi-value.
31--library-lstring(none)publicSpecify libraries for linking. Searched on -L paths. Multi-value.
32--library-path-Lstring(none)publicSpecify library search directories. Multi-value.
33--link-time-opt-ltoboolfalsepublicEnable link-time optimization. Requires --nvvmpath.
34--machine-mint64publicSpecify machine word size. Only 64 is accepted; 32 on SM > 72 is a fatal error.
35--maxrregcount-maxrregcountint0publicMaximum register count per thread. Forwarded to ptxas during LTO.
36--no-opt-no-optboolfalseinternalDisable linker optimization of data resources. Mutually exclusive with --optimize-data-layout.
37--nv-host-nv-hoststring(none)hiddenPath to nv.host file (NVIDIA internal infrastructure).
38--nvvmpath-nvvmpathstring(none)publicPath to libnvvm.so / nvvm64_*.dll. Required when --lto is specified.
39--Ofast-compile-Ofcstring0publicFast-compile level for LTO. Allowed values: 0 (full opt), min, mid, max (fastest compile). Requires --lto/--dlto.
40--optimize-data-layout-optimize-data-layoutboolfalseinternalForce linker optimization of data resources. Mutually exclusive with --no-opt.
41--options-file-optffile-list(none)publicRead additional command-line options from the specified file. Multi-value. Supports @file syntax.
42--output-file-ostring(none)publicName and location of the output file.
43--preserve-relocs-preserve-relocsboolfalsepublicPreserve resolved relocations in linked executable. Warning on SM > 89: not supported.
44--register-link-binaries--string(none)publicOutput file listing cudaRegister routine names for each linked input.
45--relocatable-link-rboolfalsepublicPerform relocatable (incremental) link. Forces --ignore-host-info and partial LTO mode.
46--report-arch-report-archboolfalsepublicInclude SM target architecture name in error messages.
47--reserve-null-pointer-reserve-null-pointerboolfalsehiddenReserve address 0 as NULL pointer. Overridden by --dont-reserve-null-pointer.
48--shared-sharedboolfalsehiddenPropagate nvcc -shared flag for nvlink consumption.
49--split-compile-split-compileint1publicMaximum threads NVVM may use for split compilation. Only effective with LTO.
50--split-compile-extended-split-compile-extendedint1publicMaximum threads the linker may use for extended split compilation. Only effective with LTO.
51--suppress-arch-warning-suppress-arch-warningboolfalsepublicSuppress warnings about objects not containing code for the target architecture.
52--suppress-debug-info-suppress-debug-infoboolfalsepublicDo not preserve debug symbols in output. Requires --debug; fatal error otherwise.
53--suppress-stack-size-warning-suppress-stack-size-warningboolfalsepublicSuppress warnings when stack size cannot be determined.
54--syscall-const-offset-syscall-const-offsetint0hiddenByte offset where syscall constants begin in the constant bank.
55--time-timestring(none)publicAppend CSV timing data to the specified file. Use - for stdout.
56--tool-name-tool-namestring(none)hiddenOverride the tool name shown in diagnostics.
57--trap-into-debugger-_trap_boolfalseinternalInstall signal handlers that trap into a debugger on assertion failure or crash. Flag bits = 0x08.
58--uidx-file-uidxstring(none)publicPath to uidx (unified index) file.
59--uumn-uumnboolfalsehiddenUndocumented companion to --fdcmpt. No help text in binary.
60--use-host-info-use-host-infobooltruepublicUse host reference information to remove unused device code. Default when neither host-info flag is specified. Mutually exclusive with --ignore-host-info.
61--variables-used-variables-usedstring(none)publicSubstring-match list of variables to keep; others are candidates for dead-code elimination. Multi-value.
62--verbose-vboolfalsepublicEnable verbose mode; print code generation statistics.
63--verbose-keep-vkeepboolfalseinternalShow nvlink pipeline steps and keep intermediate files.
64--verbose-tkinfo-verbose-tkinfoboolfalsehiddenEmit object name and command-line arguments into the tkinfo section. Forced on by --debug.
65--version-Vbool--publicPrint version information and exit.
66--warning-as-error-WerrorboolfalsepublicPromote all warnings to errors.
67--Xnvvm-Xnvvmstring(none)publicOptions forwarded to NVVM (cicc) during LTO. Multi-value.
68--Xptxas-Xptxasstring(none)publicOptions forwarded to ptxas during LTO. Multi-value.

Visibility Legend

LabelFlag BitsMeaning
public0x00Shown in --help output
hidden0x04Not shown in --help; accepted silently
internal0x08Strongest hiding; truly internal/debug-only

Public flags use flag bits 0x00 or 0x10 (the 0x10 bit enables --no-<name> negation, not hiding). Hidden flags have bit 2 set. Internal flags have bit 3 set and are reserved for NVIDIA developer use.

Notes

Multi-value flags. Flags marked "Multi-value" in the Description column accept repeated occurrences; each use appends to a linked list. Example: -lcudadevrt -lm -L/usr/local/cuda/lib64.

Boolean-with-value flags. Four bool flags are registered with multiplicity 1, meaning they accept an explicit true/false argument rather than being simple presence-toggles: --disable-smem-reservation, --enable-extended-smem, --verbose-tkinfo, --device-stack-protector.

Response files. nvlink supports --options-file <path> / -optf <path> and the shorthand @<path>. Both are recursive: a response file may reference other response files.

Cross-References

  • CLI Option Parsing -- parser infrastructure, option entry layout, registration sequence, post-extraction validation, mutual-exclusion rules, dependency rules, architecture-gated behavior, global variable map.
  • Pipeline Overview -- how parsed flags drive mode dispatch.
  • LTO Option Forwarding -- how --Xptxas, --Xnvvm, --maxrregcount, and --Ofast-compile are forwarded to cicc/ptxas.
  • Dead Code Elimination -- how --kernels-used, --variables-used, --use-host-info, and --ignore-host-info drive DCE.
  • Debug Options -- detailed semantics of --debug, --suppress-debug-info, --edbg.

Confidence Assessment

Aspect-Level Confidence

AspectConfidenceBasis
Parser entry address (0x427AE0)HIGHFile decompiled/sub_427AE0_0x427ae0.c exists (1,299 lines); contains all sub_42F130 calls
Registration function (0x42F130)HIGHFile decompiled/sub_42F130_0x42f130.c exists; called 68 times in sub_427AE0
Type/multiplicity/flags/defaultsHIGHExtracted directly from sub_42F130 positional parameters in decompiled code
Visibility bits (0x00/0x04/0x08)HIGHRead from sub_42F130 arg-6 (flags) for every registration
Mutual-exclusion rulesHIGHConfirmed in post-extraction validation blocks in sub_427AE0
Description textMEDIUMParaphrased from help-text strings embedded in the binary; hidden flags lack help text

Per-Flag Verification (Exhaustive)

Each row below was verified two ways: (1) the long-name appears as a direct string literal in the sub_42F130(v2, "<name>", ...) call at a known line of decompiled/sub_427AE0_0x427ae0.c, and (2) the name is visible at a specific address in nvlink_strings.json or embedded inside an adjacent help/format string. Five flags (lto, time, split-compile, split-compile-extended, maxrregcount) are registered via integer constants that are mid-string addresses pointing into longer strings -- these are tagged HIGH*.

FlagConfidenceEvidence
--allow-undefined-globalsHIGHstring at 0x1d325c3; registered in sub_427AE0 around line 293
--archHIGHembedded in -arch=%s (0x1eec37a), -arch=compute_%d (0x1d32257), -arch=sm_...; registered in sub_427AE0
--cpu-archHIGHstring at 0x1d326cd; registered in sub_427AE0
--cuda-api-versionHIGHembedded in -cuda-api-version=%s (0x1d33ed7), --cuda-api-version (0x1eec1dc), diagnostic at 0x1d33df0; registered in sub_427AE0
--debugHIGHembedded in Note: This option is ignored if used without --debug option. (0x1d33a..); registered in sub_427AE0
--device-stack-protectorHIGHstring at 0x1d32891; registered in sub_427AE0
--device-stack-protector-frame-size-thresholdHIGHstring at 0x1d33b68; registered in sub_427AE0
--disable-infosHIGHstring at 0x1d32654; registered in sub_427AE0
--disable-smem-reservationHIGHstring at 0x1d3259d; registered in sub_427AE0
--disable-warningsHIGHstring at 0x1d325f0; registered in sub_427AE0
--dltoHIGHembedded in no -dlto (0x1d32a89), Ignoring -dlto option because no LTO objects found (0x1d34998), LTO objects found, use -dlto (0x1d34f28); registered in sub_427AE0
--dont-reserve-null-pointerHIGHstring at 0x1d32583; long help-text at 0x1d32eb8; registered in sub_427AE0
--dot-fileHIGHstring at 0x1d3257a; registered in sub_427AE0
--dump-callgraphHIGHstring at 0x1d32a1a (-dump-callgraph); registered in sub_427AE0
--dump-callgraph-no-demangleHIGHstring at 0x1d329fe (-dump-callgraph-no-demangle); registered in sub_427AE0
--edbgHIGHdirect string literal in sub_42F130 call; registered in sub_427AE0
--emit-ptxHIGHstring at 0x1d32a6f (-emit-ptx); registered in sub_427AE0
--enable-extended-smemHIGHstring at 0x1d328e8; registered in sub_427AE0
--extra-warningsHIGHstrings at 0x1d32735 (long) and 0x1d3272b (extrawarn short); registered in sub_427AE0
--fdcmptHIGHstring at 0x1d32aa4 (-fdcmpt); registered in sub_427AE0 line 619
--force-partial-ltoHIGHstring at 0x1d32a5c (-force-partial-lto), help at 0x1d335a8; registered in sub_427AE0
--force-relaHIGHstring at 0x1d326c2; registered in sub_427AE0
--force-whole-ltoHIGHstring at 0x1d32a4b (-force-whole-lto), help at 0x1d335d0; registered in sub_427AE0
--gen-host-linker-scriptHIGHstring at 0x1d327fc; -ghls diagnostic at 0x1d34e80; registered in sub_427AE0
--helpHIGHdirect literal in sub_42F130 call; use --help for more information at 0x1d34f28; registered in sub_427AE0
--host-ccbinHIGHstring at 0x1d3283d; registered in sub_427AE0
--host-linker-optionsHIGHstring at 0x1d32539; short-name Xlinker at 0x1d32531; registered in sub_427AE0
--ignore-host-infoHIGHstring at 0x1d32a2a (-ignore-host-info), diagnostic ignore -use-host-info because... at 0x1d33d78; registered in sub_427AE0
--keep-system-librariesHIGHstring at 0x1d3267c; registered in sub_427AE0
--kernels-usedHIGHstring at 0x1d32692; referenced in diagnostic at 0x1d33d78; registered in sub_427AE0
--libraryHIGHstring at 0x1d324e6; registered in sub_427AE0
--library-pathHIGHstring at 0x1d324f8; registered in sub_427AE0
--link-time-optHIGH*registered via integer literal 30622350 = 0x1d3428e, which is 0x1d34289 + 5 = inside cicc-lto string at 0x1d34289 (sharing the trailing lto substring); registered in sub_427AE0 line 520
--machineHIGHstring at 0x1d324b2; registered in sub_427AE0
--maxrregcountHIGH*registered via integer literal 32412827 = 0x1ee949b, which is 0x1ee9496 + 5 = inside func-maxrregcount string at 0x1ee9496; also in -maxrregcount=%d (0x1d33ec6); registered in sub_427AE0
--no-optHIGHstring at 0x1d329f6 (-no-opt); registered in sub_427AE0
--nv-hostHIGHstring at 0x1eec1bd (--nv-host); registered in sub_427AE0
--nvvmpathHIGHstring at 0x1d3277b; registered in sub_427AE0
--Ofast-compileHIGHstrings at 0x1d32a79 (--Ofast-compile), 0x1d32324 (-Ofast-compile=), 0x1d33eec (--Ofast-compile=%s), 0x1eec297.. (=max/mid/min); registered in sub_427AE0
--optimize-data-layoutHIGHstring at 0x1d329e0 (-optimize-data-layout); registered in sub_427AE0
--options-fileHIGHstring at 0x1d3293b; registered in sub_427AE0
--output-fileHIGHstring at 0x1d32482; registered in sub_427AE0
--preserve-relocsHIGHstring at 0x1d32aa4 (--preserve-relocs); registered in sub_427AE0
--register-link-binariesHIGHstring at 0x1d32557; registered in sub_427AE0
--relocatable-linkHIGHstring at 0x1d32863; registered in sub_427AE0
--report-archHIGHstring at 0x1d326ee; registered in sub_427AE0
--reserve-null-pointerHIGHdirect literal (paired with --dont-reserve-null-pointer help text); registered in sub_427AE0
--sharedHIGHhelp text at 0x1d33ad0 (Percolate the nvcc -shared option for nvlink's consumption); registered in sub_427AE0
--split-compileHIGH*registered via integer literal 32424538 = 0x1eec25a, which is 0x1eec258 + 2 = inside --split-compile string at 0x1eec258; also in -split-compile=%d (0x1d3229b); registered in sub_427AE0
--split-compile-extendedHIGH*registered via integer literal 30614148 = 0x1d32284, which is 0x1d32283 + 1 = inside -split-compile-extended string at 0x1d32283; also in -split-compile-extended=%d (0x1d32268); registered in sub_427AE0
--suppress-arch-warningHIGHstring at 0x1d3246c; registered in sub_427AE0 line 69
--suppress-debug-infoHIGHstring at 0x1d329cb (-suppress-debug-info); registered in sub_427AE0
--suppress-stack-size-warningHIGHstring at 0x1d32450; registered in sub_427AE0 line 56
--syscall-const-offsetHIGHstring at 0x1d325db; registered in sub_427AE0
--timeHIGH*registered via integer literal 30614333 = 0x1d3233d, which is 0x1d32334 + 9 = inside -compile-time string at 0x1d32334 (sharing the trailing time substring); registered in sub_427AE0
--tool-nameHIGHstring at 0x1d3291b; registered in sub_427AE0
--trap-into-debuggerHIGHstring at 0x1d3294f; short-name _trap_ at 0x1d32948; registered in sub_427AE0
--uidx-fileHIGHdirect literal in sub_42F130 call at sub_427AE0 line 790
--uumnHIGHdirect literal in sub_42F130 call at sub_427AE0 line 620
--use-host-infoHIGHstring at 0x1d32a3c (-use-host-info); registered in sub_427AE0
--variables-usedHIGHstring at 0x1d326a8; referenced in diagnostic at 0x1d33d78; registered in sub_427AE0
--verboseHIGHstring at 0x1d3256e; registered in sub_427AE0
--verbose-keepHIGHstring at 0x1d32700; registered in sub_427AE0
--verbose-tkinfoHIGHstring at 0x1d32744; registered in sub_427AE0
--versionHIGHdirect literal in sub_42F130 call; registered in sub_427AE0
--warning-as-errorHIGHstring at 0x1d32625; registered in sub_427AE0
--XnvvmHIGHstring at 0x1d327c6; registered in sub_427AE0
--XptxasHIGHstring at 0x1d327bf; registered in sub_427AE0; also embedded in diagnostic at 0x1d39b00

Shared with ptxas/cicc. Flags directly shared with the standalone ptxas tool (per the ptxas CLI Options page): --maxrregcount, --Ofast-compile, --split-compile, --device-stack-protector, --device-stack-protector-frame-size-threshold, --cuda-api-version, --nv-host, --tool-name, --trap-into-debugger, --help, --version, --options-file, --verbose, --machine, --warning-as-error, --disable-warnings, --preserve-relocs, --force-rela, --suppress-debug-info, --suppress-stack-size-warning, --disable-smem-reservation, --enable-extended-smem, --reserve-null-pointer, --dont-reserve-null-pointer, --verbose-tkinfo, --fdcmpt, --uumn, --debug (-g). These flow directly from the nvlink CLI into the embedded ptxas via -Xptxas forwarding (see LTO Option Forwarding). The cicc wiki documents a different option surface (-opt, -lnk, -llc) that does not overlap meaningfully with nvlink's flags.