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
4
votes
2 answers

Using GHC with NVCC

As an alternative to accelerate, I'm trying to call CUDA code over Haskell's FFI. Here's a simple program that fails to compile: cuda_code.cu: void cuda_init() { cudaFree (0); cudaThreadSynchronize (); } Test.hs: foreign import ccall…
crockeea
  • 21,651
  • 10
  • 48
  • 101
4
votes
1 answer

CUDA C v. Thrust, am I missing something?

I just started learning CUDA programming. I was trundling through some simple CUDA C examples and everything was going swimmingly. Then! Suddenly! Thrust! I consider myself versed on C++ functors and was taken aback at the difference between CUDA C…
Tyler Jandreau
  • 4,245
  • 1
  • 22
  • 47
4
votes
1 answer

nvcc fatal: A single input file is required for a non-link phase when an outputfile is specified

I'm getting this problem with Nsight Eclipse. I just installed my Cuda Toolkit 5.0 I have a project which uses several C files and one Cuda file. I read that sometimes the problem arises when you use C files along Cuda files in Nsight so I changed…
Atirag
  • 1,660
  • 7
  • 32
  • 60
4
votes
1 answer

C++ keywords on CUDA C code

I am using CUDA to accelerate some parts of a C program. This program makes use of some C++ keywords as identifiers, so it doesn't compile as C++. Now that I changed it with CUDA, how can I compile it with NVCC? For instance, I get the…
lvella
  • 12,754
  • 11
  • 54
  • 106
4
votes
2 answers

How to specify alignment for global device variables in CUDA

I would like to declare the alignment for a global device variable in CUDA. Specifically, I have a string declaration, like __device__ char str1 = "some pre-defined string"; In normal gcc, I can request alignment from the compiler as …
fall3nm0nk
  • 45
  • 1
  • 5
4
votes
1 answer

Specify compiler NVCC uses to compile host-code

When running nvcc, it always uses the Visual C++ compiler (cl.exe). How can I make it use the GCC compiler? Setting the CC environment-variable to gcc didn't fix it. I also couldn't find any option for this in the executeables help-output.
Niklas R
  • 16,299
  • 28
  • 108
  • 203
4
votes
5 answers

Completely disable optimizations on NVCC

I'm trying to measure peak single-precision flops on my GPU, for that I'm modifying a PTX file to perform successive MAD instructions on registers. Unfortunately the compiler is removing all the code because it actually does nothing usefull since I…
Caian
  • 440
  • 4
  • 15
3
votes
1 answer

_ITERATOR_DEBUG_LEVEL of Cuda (NVCC) compiler?

Does anyone know what _ITERATOR_DEBUG_LEVEL the NVCC sets? I'm working in a Cmake project in VS2010 and get a linking error when trying to link the project: 2>warper_cuda.lib(cudakernels.cu.obj) : error LNK2038: mismatch detected for…
Jan Rüegg
  • 9,587
  • 8
  • 63
  • 105
3
votes
1 answer

How to use Intel C++ Compiler with CUDA nvcc?

I'm using NVIDIA CUDA 4.1 on Microsoft Visual studio 2008. I also have Intel Parallel Studio XE 2011 Installed. By default, NVIDIA's C Compiler nvcc.exe uses Microsoft's C Compiler cl.exe to compile its C code. How can I change the settings so that…
sgarizvi
  • 16,623
  • 9
  • 64
  • 98
3
votes
1 answer

How can I setup nvcc to use Visual C++ Express 2010 x64 from Windows SDK 7.1?

I'm building 64-bit apps with Visual C++ Express 2010 extended with Windows SDK 7.1 (to add 64 bit compiler). When I use nvcc in 32-bits mode it works well. When I use it in 64-bits mode I get this error: nvcc fatal : Visual Studio configuration…
fbbdev
  • 380
  • 6
  • 14
3
votes
1 answer

CUDA linker error: undefined reference to main

I'm trying to compile a CUDA program in Linux and I get the following linker error: /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: ld returned 1 exit…
santisan
  • 149
  • 1
  • 11
3
votes
1 answer

compiling cuda file in makefile error

I have made a makefile in order to compile my files: CFLAGS = -O3 -Wall -I /usr/local/cuda/include/ NVCCFLAGS = -O3 -arch sm_20 LDFLAGS = -O3 -L/usr/local/cuda/lib64 -lcudart EXE = runAPP app.o:app.cu $(NVCC)…
olidev
  • 20,058
  • 51
  • 133
  • 197
3
votes
0 answers

nvc++ yields "error: expression must have a constant value" while g++ and clang++ do not

I am writing some software (C++20) in which many things are evaluated during compile time. Using g++ (version > 9) or clang++ (version > 10) the software compiles just fine on Ubuntu 22.04. However, when trying to compile it using nvc++ (version…
3
votes
1 answer

What's the NVCC warning token for " 'long double' is treated as 'double' in device code"?

In this question: How to disable a specific nvcc compiler warnings there's a link to a long "dictionary" mapping tokens to error messages, which seems to fit NVCC ... except it doesn't cover all warnings. Specifically, I want to suppress warning:…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
3
votes
1 answer

How to use nvcc with gprbuild?

I have a code in Ada that must use CUDA without using the Ada binding. So I made an interface that allows the Ada program to call C code. Now I want to compile it. How can I tell gprbuild to not use gcc to compile .cu files by nvcc? If it's not…
Louis Etienne
  • 1,302
  • 3
  • 20
  • 37