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

CUDA compiler (nvcc) macro

Is there a #define compiler (nvcc) macro of CUDA which I can use? (Like _WIN32 for Windows and so on.) I need this for header code that will be common between nvcc and VC++ compilers. I know I can go ahead and define my own and pass it as an…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
15
votes
2 answers

nvcc fatal : Value 'sm_20' is not defined for option 'gpu-architecture'

I've looked at many pages and either could not follow what they were saying because they were unclear and/or my knowledge is just not sufficient enough. I am trying to run: luarocks install…
John Lexus
  • 3,576
  • 3
  • 15
  • 33
15
votes
3 answers

Compile cuda code for CPU

I'm study cuda 5.5 but i don't have any Nvidia GPU. In old version of nvcc have a flag --multicore to compile cuda code for CPU. In the new version of nvcc, what's is the option?? I'm working on Linux.
F.N.B
  • 1,539
  • 6
  • 23
  • 39
14
votes
1 answer

What's the difference between PTX and CUBIN w.r.t. the NVCC compiler?

I have CUDA 4.0 installed, and a device with Compute Capability 2.0 (a GTX 460 card). What is the difference between the 'cubin' and the 'ptx' file? I think the cubin is a native code for the gpu so this is micro-architecture specific, and the ptx…
user973764
  • 141
  • 1
  • 1
  • 3
14
votes
3 answers

Howto pass flag to nvcc compiler in CMAKE

I have a C project in Cmake in which I have embedded cuda kernel module. I want to pass --ptxas-options=-v only to nvcc in-order to view Number of registers usage per thread and shared Memory usage per block. By searching on howto pass flags to…
Nouman Tajik
  • 433
  • 1
  • 5
  • 18
14
votes
2 answers

What are the default values for arch and code options when using nvcc?

When compiling your CUDA code, you have to select for which architecture your code is being generated. nvcc provides two parameters to specify this architecture, basically: arch specifies the virtual arquictecture, which can be compute_10,…
Auron
  • 13,626
  • 15
  • 47
  • 54
14
votes
2 answers

cuda shared library linking: undefined reference to cudaRegisterLinkedBinary

Goal: create a shared library containing my CUDA kernels that has a CUDA-free wrapper/header. create a test executable for the shared library. Problem shared library MYLIB.so seems to compile fine. (no problem). Error in linking:…
cmo
  • 3,762
  • 4
  • 36
  • 64
13
votes
4 answers

Cuda with Boost

I am currently writing a CUDA application and want to use the boost::program_options library to get the required parameters and user input. The trouble I am having is that NVCC cannot handle compiling the boost file any.hpp giving errors such…
Dan
  • 12,857
  • 7
  • 40
  • 57
13
votes
1 answer

Nvcc has different version than CUDA

I got installed cuda 7, but when I hit nvcc --version, it prints out 6.5. I would like to install Theano library on GTX 960 card, but it needs nvcc 7.0. Ive tried reinstall cuda, but it didn't update nvcc. When I run apt-get install…
Snurka Bill
  • 973
  • 4
  • 12
  • 29
13
votes
4 answers

differences between virtual and real architecture of cuda

Trying to understand the differences between virtual and real architecture of cuda, and how the different configurations will affect the performance of the program, e.g. -gencode arch=compute_20,code=sm_20 -gencode…
Hailiang Zhang
  • 17,604
  • 23
  • 71
  • 117
12
votes
1 answer

Building GPL C program with CUDA module

I am attempting to modify a GPL program written in C. My goal is to replace one method with a CUDA implementation, which means I need to compile with nvcc instead of gcc. I need help building the project - not implementing it (You don't need to know…
emulcahy
  • 1,055
  • 3
  • 18
  • 28
11
votes
3 answers

Why is NVIDIA Pascal GPUs slow on running CUDA Kernels when using cudaMallocManaged

I was testing the new CUDA 8 along with the Pascal Titan X GPU and is expecting speed up for my code but for some reason it ends up being slower. I am on Ubuntu 16.04. Here is the minimum code that can reproduce the result: CUDASample.cuh class…
user3667089
  • 2,996
  • 5
  • 30
  • 56
10
votes
6 answers

CUDA compile problems on Windows, Cmake error: No CUDA toolset found

so I've been successfully working on my CUDA program on my Linux but I would like to support Windows platform as well. However, I've been struggling with correctly compiling it. I use : Windows 10 Cmake 3.15 Visual Studio 2017 CUDA Toolkit…
Mineral
  • 197
  • 1
  • 1
  • 10
10
votes
6 answers

How to compile PTX code

I need to modify the PTX code and compile it directly. The reason is that I want to have some specific instructions right after each other and it is difficult to write a cuda code that results my target PTX code, So I need to modify ptx code…
user2998135
  • 111
  • 1
  • 1
  • 3
9
votes
3 answers

Cuda - nvcc - No kernel image is available for execution on the device. What is the problem?

I'm trying to use nvcc with the most simple example, but it doesn't work correctly. I'm compiling and execute the example from https://devblogs.nvidia.com/easy-introduction-cuda-c-and-c/, however my server can't execute the global function. I…
ACC_80
  • 91
  • 1
  • 1
  • 3
1
2
3
45 46