OS Manuals

/usr/local/cuda-12.4/bin/nvlink

CUDA NVCC

From nvidia-cuda-nvcc-12.4 12.4.131-r17 (extra-packages), captured 2026-11-09 by running nvlink --help (exit 0). permalink

Usage  : nvlink [options] <objects>

Options
=======

--Xnvvm <options>,...                               (-Xnvvm)
        Nvvm options (only used with LTO).

--Xptxas <options>,...                              (-Xptxas)
        Ptxas options (only used with LTO).

--arch <gpu architecture name>                      (-arch)
        Specify the 'sm_' name of the target architecture.
        Allowed values for this option:  'compute_50','compute_52','compute_53',
        'compute_60','compute_61','compute_62','compute_70','compute_72','compute_75',
        'compute_80','compute_86','compute_87','compute_89','compute_90','compute_90a',
        'lto_50','lto_52','lto_53','lto_60','lto_61','lto_62','lto_70','lto_72',
        'lto_75','lto_80','lto_86','lto_87','lto_89','lto_90','lto_90a','sm_50',
        'sm_52','sm_53','sm_60','sm_61','sm_62','sm_70','sm_72','sm_75','sm_80',
        'sm_86','sm_87','sm_89','sm_90','sm_90a'.

--cpu-arch <cpu architecture name>                  (-cpu-arch)
        Specify the name of the cpu target architecture.
        Allowed values for this option:  'AARCH64','ARMv7','PPC64LE','X86','X86_64',
        'unknown'.
        Default value:  'unknown'.

--debug                                             (-g)
        Specify that this was a debug compile.

--disable-warnings                                  (-w)
        Inhibit all warning messages.

--dlto                                              (-dlto)
        Do link-time optimization, alias for -lto.

--dump-callgraph                                    (-dump-callgraph)
        Dump callgraph information.

--dump-callgraph-no-demangle                        (-dump-callgraph-no-demangle)
        Dump callgraph information without demangling.

--emit-ptx                                          (-emit-ptx)
        Emit ptx file if LTO is used.

--extra-warnings                                    (-extrawarn)
        Emit extra warnings about possible problems.

--gen-host-linker-script <host linker script type>  (-ghls)
        Specify the type of host linker script to be generated.
        Allowed values for this option:  'lcs-abs','lcs-aug'.

--help                                              (-h)
        Print this help information on this tool.

--ignore-host-info                                  (-ignore-host-info)
        Ignore information about host references, so don't remove device code that
        could potentially be referenced by host.

--keep-system-libraries                             (-keep-system-libraries)
        Don't optimize away system library (e.g. cudadevrt) code.

--kernels-used <kernel>,...                         (-kernels-used)
        Specify kernels that are used. Can be part of a kernel name so any kernels
        with that string in name are matched. If this option is used, then any other
        kernels are considered dead-code and removed.

--library <library>,...                             (-l)
        Specify libraries to be used in the linking stage. The libraries are searched
        for on the library search paths that have been specified using option '-L'.

--library-path <library-path>,...                   (-L)
        Specify library search paths.

--link-time-opt                                     (-lto)
        Do link-time optimization.

--machine <bits>                                    (-m)
        Specify 64 bit architecture.
        Allowed values for this option:  64.
        Default value:  64.

--maxrregcount <amount>                             (-maxrregcount)
        Max regcount (only used with LTO).

--nvvmpath                                          (-nvvmpath)
        Path to libnvvm library.

--options-file <file>,...                           (-optf)
        Include command line options from specified file.

--output-file <file name>                           (-o)
        Specify name and location of the output file.

--preserve-relocs                                   (-preserve-relocs)
        Preserve resolved relocations in linked executable.

--register-link-binaries <file name>                --register-link-binaries <file
        name>
        Specify name and location of output file that will contain names of cudaRegister
        routines for each linked file.

--report-arch                                       (-report-arch)
        Report SM target arch in error messages.

--split-compile <amount>                            (-split-compile)
        Max threads nvvm can use for split compilation (only used with LTO).
        Default value:  1.

--split-compile-extended <amount>                   (-split-compile-extended)
        Max threads linker can use for extended split compilation (only used with
        LTO).
        Default value:  1.

--suppress-arch-warning                             (-suppress-arch-warning)
        Suppress the warning that otherwise is printed when object does not contain
        code for target arch.

--suppress-debug-info                               (-suppress-debug-info)
        Do not preserve debug symbols in output.
        Note: This option is ignored if used without --debug option.

--suppress-stack-size-warning                       (-suppress-stack-size-warning)
        Suppress the warning that otherwise is printed when stack size cannot be
        determined.

--time <file name>                                  (-time)
        Generate a comma separated value table with the time taken by this program
        and sub-component invocations, and append it at the end of the file given
        as the option argument. If the file is empty, the column headings are generated
        in the first row of the table. If the file name is '-', the timing data is
        generated in stdout.

--uidx-file                                         (-uidx)
        Path to uidx file.

--use-host-info                                     (-use-host-info)
        Use information about host references to remove unused device code.

--variables-used <variable>,...                     (-variables-used)
        Specify variables that are used. Can be part of a variable name so any variable
        with that string in name are matched. If this option is used, then any other
        variables are considered dead-code and potentially removed unless have other
        accesses from device code.

--verbose                                           (-v)
        Enable verbose mode which prints code generation statistics.

--version                                           (-V)
        Print version information on this tool.

--warning-as-error                                  (-Werror)
        Make all warnings into errors.
Options (39)
OptionDescriptionSource
--Xnvvm options(-Xnvvm) Nvvm options (only used with LTO).help
--Xptxas options(-Xptxas) Ptxas options (only used with LTO).help
--arch gpu(-arch) Specify the 'sm_' name of the target architecture.help
--cpu-arch cpu(-cpu-arch) Specify the name of the cpu target architecture.help
--debug(-g) Specify that this was a debug compile.help
--disable-warnings(-w) Inhibit all warning messages.help
--dlto(-dlto) Do link-time optimization, alias for -lto.help
--dump-callgraph(-dump-callgraph) Dump callgraph information.help
--dump-callgraph-no-demangle(-dump-callgraph-no-demangle) Dump callgraph information without demangling.help
--emit-ptx(-emit-ptx) Emit ptx file if LTO is used.help
--extra-warnings(-extrawarn) Emit extra warnings about possible problems.help
--gen-host-linker-script host(-ghls) Specify the type of host linker script to be generated.help
--help(-h) Print this help information on this tool.help
--ignore-host-info(-ignore-host-info) Ignore information about host references, so don't remove device code that could potentially be referenced by host.help
--keep-system-libraries(-keep-system-libraries) Don't optimize away system library (e.g. cudadevrt) code.help
--kernels-used kernel(-kernels-used) Specify kernels that are used.help
--library library(-l) Specify libraries to be used in the linking stage.help
--library-path library-path(-L) Specify library search paths.help
--link-time-opt(-lto) Do link-time optimization.help
--machine bits(-m) Specify 64 bit architecture.help
--maxrregcount amount(-maxrregcount) Max regcount (only used with LTO).help
--nvvmpath(-nvvmpath) Path to libnvvm library.help
--options-file file(-optf) Include command line options from specified file.help
--output-file file(-o) Specify name and location of the output file.help
--preserve-relocs(-preserve-relocs) Preserve resolved relocations in linked executable.help
--register-link-binaries file--register-link-binaries <file name> Specify name and location of output file that will contain names of cudaRegister routines for each linked file.help
--report-arch(-report-arch) Report SM target arch in error messages.help
--split-compile amount(-split-compile) Max threads nvvm can use for split compilation (only used with LTO).help
--split-compile-extended amount(-split-compile-extended) Max threads linker can use for extended split compilation (only used with LTO).help
--suppress-arch-warning(-suppress-arch-warning) Suppress the warning that otherwise is printed when object does not contain code for target arch.help
--suppress-debug-info(-suppress-debug-info) Do not preserve debug symbols in output.help
--suppress-stack-size-warning(-suppress-stack-size-warning) Suppress the warning that otherwise is printed when stack size cannot be determined.help
--time file(-time) Generate a comma separated value table with the time taken by this program and sub-component invocations, and append it at the end of the file given as the option argument.help
--uidx-file(-uidx) Path to uidx file.help
--use-host-info(-use-host-info) Use information about host references to remove unused device code.help
--variables-used variable(-variables-used) Specify variables that are used.help
--verbose(-v) Enable verbose mode which prints code generation statistics.help
--version(-V) Print version information on this tool.help
--warning-as-error(-Werror) Make all warnings into errors.help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.