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
9
votes
6 answers

nvcc -Xptxas –v compiler flag has no effect

I have a CUDA project. It consists of several .cpp files that contain my application logic and one .cu file that contains multiple kernels plus a __host__ function that invokes them. Now I would like to determine the number of registers used by my…
Dave O.
  • 2,231
  • 3
  • 21
  • 25
9
votes
2 answers

Creating DLL from CUDA using nvcc

I want to create a .dll from a CUDA code (kernel.cu) in order to use this library from an external C program. After some attempts I just left a simple C function in .cu file. Code follows: kernel.cu #include #include "kernel.h" void…
BobCormorano
  • 650
  • 1
  • 7
  • 14
9
votes
2 answers

undefined reference error for linking CUDA static or shared library with gcc

gcc and CUDA question Hi, I have compiled a CUDA shared library but can't link it with the main program that uses it. I am compiling the main program with gcc. The code: simplemain.c #include #include void…
Bibrak
  • 544
  • 4
  • 20
8
votes
2 answers

cuda with mingw - updated

We have been developing our code in linux, but would like to compile a windows executable. The old non-gpu version compiles just fine with mingw in windows, so I was hoping I'd be able to do the same with the CUDA version. The strategy is to compile…
jmilloy
  • 7,875
  • 11
  • 53
  • 86
8
votes
0 answers

CUDA version mismatch

I tried uninstalling CUDA 10 and installing 9.2. Now nvcc -V returns 9.2, but nvidia-smi says CUDA 10.0. Any idea why this may be happening or how to fix it? Can't find anything else related to 10.0 still left on my system. Edit: added screenshot…
Austin
  • 6,921
  • 12
  • 73
  • 138
8
votes
2 answers

Can I make my compiler use fast-math on a per-function basis?

Suppose I have template void foo(float* data, size_t length); and I want to compile one instantiation with -ffast-math (--use-fast-math for nvcc), and the other instantiation without it. This can be achieved by instantiating…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
8
votes
2 answers

Compiling part of a C++ program for GPU

Is it possible to compile (C++) code for the GPU with nvcc into a shared object (.so file) and load it dynamically from a C++ program (in this case, Cern's ROOT, which is essentially a C++ interpreter ("CINT")). A simple example that I would like to…
Eric O. Lebigot
  • 91,433
  • 48
  • 218
  • 260
8
votes
2 answers

How to link host code with a static CUDA library after separable compilation?

Alright, I have a really troubling CUDA 5.0 question about how to link things properly. I'd be really grateful for any assistance! Using the separable compilation features of CUDA 5.0, I generated a static library (*.a). This nicely links with other…
user2333829
  • 1,301
  • 1
  • 15
  • 25
8
votes
1 answer

Makefile for CUDA and C

I am working on a project that uses .c and .cu files. The original package was written entirely in C and had its own Makefile (it was perfectly working). I added the .cu file to the project and now I want to modify the Makefile so that it compiles…
vburca
  • 208
  • 2
  • 10
7
votes
2 answers

/usr/bin/ld: cannot find -lcudart

I'm getting the following message while trying to compile a CUDA program: /usr/bin/ld: cannot find -lcudart Never got this kind of error before. Is it any problem with my PATH? Here's the compile command: gfortran -g -O2…
GennSev
  • 1,586
  • 4
  • 20
  • 29
7
votes
2 answers

CUDA and nvcc: using the preprocessor to choose between float or double

The problem: Having a .h, I want to define real to be double if compiling for c/c++ or for cuda with computing capability >= 1.3. If compiling for cuda with computing capability < 1.3 then define real to be float. After many hours I came to this…
cibercitizen1
  • 20,944
  • 16
  • 72
  • 95
7
votes
4 answers

nvcc fatal : Unsupported gpu architecture 'compute_86'

I have a Nvidia RTX 3090 ti 24GB with this drivers CUDA Version: 11.4 Driver Version: 470.74 18.04.1-Ubuntu SMP Cuda compilation tools, release 9.1, V9.1.85 I've looked for this card architecture and it is Ampere so the version of library are…
golia
  • 95
  • 1
  • 1
  • 6
7
votes
1 answer

"warning: __host__ annotation on a defaulted function is ignored" <- why?

Switching from CUDA 8.0 to CUDA 9.0 RC, I get a warning about: __host__ __device__ ~Foo() = default; The warning is: path/to/Foo.cuh(69): warning: __host__ annotation on a defaulted function("~Foo") is ignored which I didn't use to get before.…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
7
votes
1 answer

How Can I use my GPU on Ipython Notebook?

OS : Ubuntu 14.04LTS Language : Python Anaconda 2.7 (keras, theano) GPU : GTX980Ti CUDA : CUDA 7.5 I wanna run keras python code on IPython Notebook by using my GPU(GTX980Ti) But I can't find it. I want to test below code. When I run it on to…
user3704652
  • 303
  • 4
  • 6
  • 16
7
votes
4 answers

nvcc.exe linking error Microsoft Visual Studio configuration file 'vcvars64.bat' could not found

I want to use nvcc -ptx from windows command line, but I always get this error message: nvcc : fatal error : Microsoft Visual Studio configuration file 'vcvars64.bat' could not be found for installation at 'C:\Program Files (x86)\Microsoft Visual…
Belabalta
  • 71
  • 1
  • 1
  • 2
1 2
3
45 46