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
1 answer

"modifier is not allowed on a destructor" error when compiled with nvcc in VS2013

I am on Visual Studio 2013 and is trying to compile a CUDA code that utilizes inheritance and C++11. The code below returns "modifier is not allowed on a destructor" error because of the "override". // derived.cuh class derived : public base { …
user3667089
  • 2,996
  • 5
  • 30
  • 56
3
votes
4 answers

Creating a makefile for CUDA programs

I want to automate the compilation of a toy library using CUDA and C++. Then I write a Makefile as follows CC=g++ NVCC=nvcc CXXFLAGS= -fopenmp -O3 -Wextra -std=c++11 CUDAFLAGS= -std=c++11 -c -arch=sm_20 LIBS= -lopenblas -lpthread -lcudart…
pateheo
  • 430
  • 1
  • 5
  • 13
3
votes
1 answer

CUDA __host__ __device__ variables

In CUDA function type qualifiers __device__ and __host__ can be used together in which case the function is compiled for both the host and the device. This allows to eliminate copy-paste. However, there is no such thing as __host__ __device__…
wotopul
  • 115
  • 1
  • 2
  • 10
3
votes
1 answer

how to compile Cuda source with Go language's cgo?

I wrote a simple program in cuda-c and it works on eclipse nsight. This is source code: #include #include __global__ void add( int a,int b, int *c){ *c = a + b; } int main(void){ int c; int…
3
votes
0 answers

Include paths for nvcc on windows

I'm trying to compile a CUDA C code in Windows command line. I've already installed cuda toolkit and nvcc works fine. But the code includes png.h and I'd like to know what is the proper way to provide it. Specifically, I want to learn what are the…
Maxim Blumental
  • 763
  • 5
  • 26
3
votes
2 answers

Theano installation, nvcc not in the path

I have installed theano on windows7,64bit on winpython using their guide http://deeplearning.net/software/theano/install_windows.html and I thought it worked since when I ran their first example I did have the expected results and no errors. I…
PSan
  • 129
  • 1
  • 3
  • 11
3
votes
1 answer

Compiling and Linking pure C and CUDA code [warning: implicit declaration of function]

I am trying to compile and link .c and .cu files and I am getting a warning warning: implicit declaration of function I have a function in the .cu file that I need to call from the .c file. The .c file is compiled using gcc and .cu file is…
anupshrestha
  • 236
  • 5
  • 19
3
votes
1 answer

Can't get rid of "warning: command line option ‘-std=c++11’" using nvcc/CUDA/cmake

When I compile my cuda code with cmake, I can't seem to get the following warning to go away: cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [enabled by default] I have reduced the problem to the compilation,…
jeremy
  • 4,421
  • 4
  • 23
  • 27
3
votes
1 answer

Does 'code=sm_X' embed only binary (cubin) code, or also PTX code, or both?

I am little bit confused about the 'code=sm_X' option within the '-gencode' statement. An example: What does the NVCC compiler option -gencode arch=compute_13,code=sm_13 embed in the library ? Only the machine code (cubin code) for GPUs with CC…
user2454869
  • 105
  • 1
  • 11
3
votes
1 answer

nvlink, relocatable device code and static device libraries

While investigating some issues with relocatable device code, I stumbled upon something I don't quite understand. This is a use case for what is pictured on slide 6. I used an answer of Robert Crovella as a basis for a repro code. The idea is that…
BenC
  • 8,729
  • 3
  • 49
  • 68
3
votes
2 answers

Why does Theano print "cc1plus: fatal error: cuda_runtime.h: No such file or directory"?

I am trying to use the GPU with Theano. I've read this tutorial. However, I can't get theano to use the GPU and I don't know how to continue. Testing machine $ cat /etc/issue Welcome to openSUSE 12.1 "Asparagus" - Kernel \r (\l). $ nvidia-smi -L GPU…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
3
votes
2 answers

CUDA: cudaMemcpy only works in emulation mode

I am just starting to learn how to use CUDA. I am trying to run some simple example code: float *ah, *bh, *ad, *bd; ah = (float *)malloc(sizeof(float)*4); bh = (float *)malloc(sizeof(float)*4); cudaMalloc((void **) &ad,…
Jason
  • 103
  • 1
  • 4
3
votes
0 answers

NVCC extremely slow to compile CUBIN file

I have CU file with a single kernel defined in it. The kernel calls a function which in turn calls one of two other. In total, all the functions combined is only around ~600 lines, however, some of those contain long mathematical expressions that…
Thomas Antony
  • 544
  • 1
  • 7
  • 17
3
votes
1 answer

cython extensions using cuda

I have a conv net implementation as a C++ class. The class is built on top of a template library ( mshadow ) that generates CUDA code, so it takes the form of a header file. Consequently, it can only be used in files compiled using nvcc. I am now…
AatG
  • 685
  • 8
  • 23
3
votes
1 answer

NVCC compilation options for generating the best code (using JIT)

I am trying to understand nvcc compilation phases but I am a little bit confused. Because I don't know the exact hardware configuration of the machine that will run my software, I want to use JIT compilation feature in order to generate the best…
AstrOne
  • 3,569
  • 7
  • 32
  • 54