nvcc

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

亡梦爱人 提交于 2019-12-21 07:42:43
问题 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 , compute_11 , etc. code specifies the real architecture, which can be sm_10 , sm_11 , etc. So a command like this: nvcc x.cu -arch=compute_13 -code=sm_13 Will generate 'cubin' code for devices with 1.3 compute capability. Please correct me if I'm wrong.

nvcc warning in cuda 8.0

别来无恙 提交于 2019-12-21 02:21:31
问题 I am getting this warning when I try to execute nvcc. I have cuda toolket 8.0 I have Nvidia GTX 480 in my system. nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). Can anyone explain this warning? Please let me know if you need more information. 回答1: This is the CUDA development teams (i.e. NVIDIA) way of letting CUDA developers (i.e. you) know that compute

CUDA compiler (nvcc) macro

你离开我真会死。 提交于 2019-12-20 20:03:38
问题 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 argument to the nvcc compiler (-D), but it would be great if there is one already defined. 回答1: __CUDACC__ I don't think it will be that trivial. Check the following thread http://forums.nvidia.com/index.php?showtopic=32369&st=0&p=179913&#entry179913 回答2:

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

五迷三道 提交于 2019-12-19 17:04:22
问题 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 S tudio 11.0\VC\bin/../..' I'm using vs 2012 express edition. What can be the solution? 回答1: I have managed to solve the issue and make work with MS Visual Studio Express 2012, here what I did: Installed MS Visual Studio 2012 Express Installed cuda_5

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

谁都会走 提交于 2019-12-18 08:57:42
问题 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 nvcc uses Intel's C Compiler icl.exe . 回答1: Unfortunately you cannot (or at least its HIGHLY unrecommended). The only compiler supported on windows is visual studio. Unless something has changed and they now support intel's compilers i wouldn't

cuda shared library linking: undefined reference to cudaRegisterLinkedBinary

主宰稳场 提交于 2019-12-18 04:01:47
问题 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: ./libMYLIB.so: undefined reference to __cudaRegisterLinkedBinary_39_tmpxft_000018cf_00000000_6_MYLIB_cpp1_ii_74c599a1 simplified makefile: libMYlib.so : MYLIB.o g++ -shared -Wl,-soname,libMYLIB.so -o libMYLIB.so MYLIB.o -L/the/cuda/lib/dir -lcudart MYLIB.o : MYLIB.cu

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

淺唱寂寞╮ 提交于 2019-12-17 22:37:27
问题 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 *.cu files when run through nvcc, I have done this many times. I'd now like to take a *.cpp file and link it against the host code in this static library using g++ or whatever, but not nvcc. If I attempt this, I get compiler errors like undefined

Compile cuda code for CPU

99封情书 提交于 2019-12-17 20:17:55
问题 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. 回答1: CUDA toolkits since at least CUDA 4.0 have not supported an ability to run cuda code without a GPU. If you simply want to compile code, refer to this question. If you want to run CUDA codes compiled with CUDA 5.5, you will need a CUDA capable GPU. If you're willing to use older CUDA

CUDA: How to use -arch and -code and SM vs COMPUTE

守給你的承諾、 提交于 2019-12-17 07:24:40
问题 I am still not sure how to properly specify the architectures for code generation when building with nvcc. I am aware that there is machine code as well as PTX code embedded in my binary and that this can be controlled via the controller switches -code and -arch (or a combination of both using -gencode ). Now, according to this apart from the two compiler flags there are also two ways of specifying architectures: sm_XX and compute_XX , where compute_XX refers to a virtual and sm_XX to a real

Has Anyone Actually gotten NVCC and the intel compiler to work together?

那年仲夏 提交于 2019-12-14 02:43:57
问题 Lots of questions out there on trying to get NVCC to use the intel compiler. It doesn't work, I get that. The most common answer that people give is to compile the device code into a library using NVCC/cl.exe and then compile the host code separately and link them. I'm attempting this, but am getting nowhere. In VS2012 I have created a solution with 2 projects - one CUDA, the other a console application. I have set the CUDA project to compile with VS2012 into a static library. It compiles no