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

How can I make common C++ compilers print the namespace a certain line is in?

I'm trying to figure where in a bunch of code I'm missing a closing-brace for a namespace (i.e. getting a: At end of source: error: expected a "}" error). Maybe there are smarter ways to go about it, but - I want to try and check, at different…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
4
votes
5 answers

How to solve: "nvcc fatal : Could not set up the environment for Microsoft Visual Studio using vcvars64.bat"

I'm trying to build a CMake project using Visual Studio (open folder mode). Nvcc is required to build the project. I get the following error: The CUDA compiler "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe" is not…
Ryno
  • 403
  • 2
  • 7
  • 11
4
votes
1 answer

nvcc error: string_view.h: constexpr function return is non-constant

I'm trying to compile some TensorFlow native op with CUDA code. I'm using Python 3.6 and TensorFlow 1.11 here, and CUDA 8.0, on Ubuntu 16. More specifically: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) GNU C++11 (Ubuntu…
Albert
  • 65,406
  • 61
  • 242
  • 386
4
votes
2 answers

Relocation R_X86_64_32S against `.bss' can not be used when making a PIE linking error

I'm trying to compile AccNEAT project with CUDA support. It's working fine when I compile it without CUDA support. However, when I compile with CUDA support, I get linker errors. To compile the project, my environment is Ubuntu 18.04 LTS 64 bit with…
user3157855
  • 714
  • 2
  • 9
  • 24
4
votes
2 answers

C++11 function iota() not supported by nvcc?

I tried to compile this code:- #include using namespace std; int main() { vector v(5); iota(v.begin(), v.end(), 0); } And I compiled it with this command:- D:\workspace\test>nvcc main.cpp --std=c++11 (Because without…
dtn34-
  • 321
  • 3
  • 11
4
votes
1 answer

Adapting CMakeList.txt to run with CUDA

I'm working with a slam system, i've install dso, which the code can be seen here:: https://github.com/JakobEngel/dso Everything works fine, I manage to compile and run without errors. But know I want to parallelize the code, using CUDA. I'm having…
César Pereira
  • 249
  • 4
  • 17
4
votes
1 answer

CUDA build shared library

I need to create a shared library for cuda. The compilation of the library works fine but when I try to use it in my program nvcc returns a linker or ptxas error. I reduced the problem to the following code. The library must replace different C…
Tim
  • 41
  • 1
  • 3
4
votes
3 answers

caffe installation: gcc error namespace "std" has no member "isnan"

I'm trying to install (py)caffe on ubuntu 17.10 However when I do make all I get the following error: ./include/caffe/common.hpp(84): error: namespace "std" has no member "isnan" ./include/caffe/common.hpp(85): error: namespace "std" has no member…
Thijser
  • 2,625
  • 1
  • 36
  • 71
4
votes
2 answers

pycuda: nvcc compitalation of kernel.cu failed

I've just installed pyCuda, when i try to compile: import pycuda.autoinit import pycuda.driver as drv import numpy from pycuda.compiler import SourceModule mod = SourceModule(""" __global__ void multiply_them(float *dest, float *a,…
Giuseppe Angora
  • 833
  • 1
  • 10
  • 25
4
votes
2 answers

R gputools: gcc: error: unrecognized command line option ‘-Wp’

I had an error when I install gputools in R, and I cannot find any solution by google. I use command install.packages("gputools") /usr/local/cuda/bin/nvcc -c -Xcompiler "-fpic -I/usr/local/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2…
Mike Brown
  • 331
  • 2
  • 12
4
votes
2 answers

Caffe compilation fails due to unsupported gcc compiler version

I struggle with Caffe compilation. Unfortunately I failed to compile it. Steps I followed: git clone https://github.com/BVLC/caffe.git cd caffe mkdir build cd build cmake .. make all Running make all fails with the following error message: [ 2%]…
patryk.beza
  • 4,876
  • 5
  • 37
  • 56
4
votes
1 answer

nvcc -arch sm_52 gives error "Value 'sm_52' is not defined for option 'gpu-architecture'"

I updated my cuda toolkit from 5.5 to 6.5. Then following command nvcc -arch=sm_52 starts to give me an error nvcc fatal : Value 'sm_52' is not defined for option 'gpu-architecture' Is this a bug ? or nvcc 6.5 does not support Maxwell virtual…
Alex Gao
  • 2,073
  • 4
  • 24
  • 27
4
votes
1 answer

Heisenbug in CUDA kernel, global memory access

About two years ago, I wrote a kernel for work on several numerical grids simultaneously. Some very strange behaviour emerged, which resulted in wrong results. When hunting down the bug utilizing printf()-statements inside the kernel, the bug…
4
votes
1 answer

CUDA *.cpp files

Is there a flag I can pass nvcc to treat a .cpp file like it would a .cu file? I would rather not have to do a cp x.cpp x.cu; nvcc x.cu; rm x.cu. I ask because I have cpp files in my library that I would like to compile with/without CUDA based on…
user1493321
4
votes
2 answers

NVCC compile to ptx using CMAKE's cuda_compile_ptx

I have the simple kernel in file kernel.cu __global__ void add1( double * pi, double c ) { *pi += c; } and can easily compile it to a ptx file kernel.ptx with: nvcc -ptx kernel.cu now, I wanted to reproduce the same behaviour using cmake…
adrelino
  • 160
  • 2
  • 10