LinuxCommandLibrary

nvcc

The NVIDIA CUDA Compiler Driver.

TLDR

Compile a CUDA program

$ nvcc [path/to/source.cu] -o [path/to/executable]
copy


Generate debu[g] information
$ nvcc [path/to/source.cu] -o [path/to/executable] --debug --device-debug
copy


Include libraries from a different path
$ nvcc [path/to/source.cu] -o [path/to/executable] -I[path/to/includes] -L[path/to/library] -l[library_name]
copy


Specify the compute capability for a specific GPU architecture
$ nvcc [path/to/source.cu] -o [path/to/executable] --generate-code arch=[arch_name],code=[gpu_code_name]
copy

Copied to clipboard