Questions tagged [nvcc]

"nvcc" is NVIDIA's LLVM-based C/C++ compiler for targeting GPUs with CUDA.

This tag refers to NVIDIA’s compiler toolchain nvcc for the parallel computing architecture (CUDA). Documentation for nvcc is included with the CUDA Toolkit.

You should ask questions about CUDA here on Stack Overflow, but if you have bugs to report you should discuss them on the CUDA forums or report them via the registered developer portal. You may want to cross-link to any discussion here on Stack Overflow.

688 questions
3
votes
2 answers

Link-time optimizations in CUDA 11 - what are they and how to use them?

The CUDA 11 features announcement, it's said that there are now: New link time optimization capabilities what link-time optimizations does nvcc actually employ (e.g. relative to the LTO capabilities in host-side code with g++ or clang++)? Also -…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
3
votes
1 answer

Nsight Eclipse not found/CUDA11.1 installation problems

I can't find Nsight Eclipse Edition after cuda installation. I installed cuda11.1 on Ubuntu18.04(Nvidia Driver was installed before),and no error shows. But when I input "nvcc -V",and "nsight" on terminal, it shows "command 'nvcc' not…
L.K
  • 33
  • 5
3
votes
1 answer

Can I trust NVCC to optimize away std::pair in return types?

Sometimes, one wants to write a (small) CUDA device-side function which returns two values. In C, you would have that function take two out-parameters, e.g.: __device__ void pair_maker(float x, float &out1, float& out2); but in C++, the idiomatic…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
3
votes
1 answer

CUDA Error: name followed by "::" must be a class or namespace

I am working on my first CUDA program and running into error using the nvcc compiler that I do not encounter if I compile with g++. My code: #include #include using namespace std; double distance(double first, double…
HMLDude
  • 1,547
  • 7
  • 27
  • 47
3
votes
1 answer

nvcc fatal : '--ptxas-options=-v': expected a number

Getting the nvcc fatal : '--ptxas-options=-v': expected a number error when I try to build a Windows port of Faster-RCNN. You may reach the setup file (which is a Python script) directly from here. Software Environment: - CUDA v10.1 - VS 2019 -…
talha06
  • 6,206
  • 21
  • 92
  • 147
3
votes
1 answer

Error when executing OpenMPI code (OPAL Error) with nvcc

I am trying to run OpenMPI code on a NVIDIA Jetson TX2. But I am getting an OPAL Error when i run mpiexec. Compilation instruction: $ nvcc -I/home/user/.openmpi/include/ -L/home/user/.openmpi/lib/ -lmpi -std=c++11 *.cu *.cpp -o program nvcc warning…
John.Ludlum
  • 145
  • 3
  • 13
3
votes
1 answer

cudart_static - when is it necessary?

Since newer drivers ship with the CUDA runtime (I can choose 9.1 or 9.2 in the drivers download page) my question is: should my library (which uses a CUDA kernel internally) be shipped with -lcudart_static? I had issues launching kernels compiled…
Dean
  • 6,610
  • 6
  • 40
  • 90
3
votes
1 answer

How would you link a custom CUDA kernel written in C to a Rust project?

I am struggling to link my CUDA kernel with my Rust project using a build.rs file with the crate cc: build.rs extern crate cc; fn main() { println!("cargo:rustc-link-lib=cuda"); println!("cargo:rustc-link-lib=cudart"); …
Ltei
  • 425
  • 1
  • 6
  • 14
3
votes
1 answer

How do you allocate GPU memory in a separate CUDA function?

I'm new to CUDA and sure that I'm doing something that's simple enough to fix, but I'm also not sure what to exactly search to find an answer. I've tried looking around but to no avail. I have a few functions in my code that I want to perform matrix…
3
votes
1 answer

Bazel cuda_add_executable equivalent?

I was exploring using Bazel instead of cmake for building a project. Is there something equivalent to "cuda_add_executable" or "cuda_add_library" in cmake? cc_library doesn't appear to allow ".cu" extensions, so that would require a rename of those…
dfreese
  • 378
  • 1
  • 10
3
votes
2 answers

NVCC register usage report in __device__ function

I'm trying to get some information about register usage in my CUDA kernels using NVCC option --ptxas-options=v and while with global functions everything is ok, I'm having some difficulties with the device ones since the ptxas info : Used N…
3
votes
1 answer

How to compile C code with C headers and CUDA code?

I have a main code wich uses some libraries and I been compiling it like this: gcc importedCFile1.c importedCFile2.c mainCode.c -O3 -lm -Wall -o maincode -lrt Now I have added CUDA code in mainCode and changed its extension to .cu... So, how can I…
user3117891
  • 145
  • 2
  • 12
3
votes
3 answers

How do I use other c++ compilers with CUDA on Windows?

I'm trying to build a simple application with CUDA and I've been trying for hours on end and I just can't make it work on windows. nvcc absolutely refuses to compile without Visual Studio's compiler which doesn't support things I need. I tried…
user3441843
  • 137
  • 1
  • 7
3
votes
2 answers

CUDA SASS to Cubin

With CuObjDump SASS can be generated from Cubin file using cuobjdump -sass , But is there any way to convert the SASS back to Cubin.
Ginu Jacob
  • 1,588
  • 2
  • 19
  • 35
3
votes
1 answer

VS2010 compiler and cuda error: linkage specification is incompatible with previous “hypot”

When I try to build my project on a 64 bit Windows 7 using VS 2010 in Debug 64 bit configuration I get this error along with two other errors. error: linkage specification is incompatible with previous "hypot" in math.h line 161 error: linkage…
Priyank
  • 31
  • 1
  • 4