Compiling CUDA with Visual Studio 2010

I used Visual Studio 2008 to compile and run CUDA applications before. I switched to Visual Studio 2010 and Windows 7. I tried to install integration all morning, but did not have complete success. I downloaded the toolbox, installed Nsight, made sure the / include / bin paths libraries were installed, check the box to use the CUDA 3.2 build setting, and set the properties of a separate .cu file like CUDA C / C ++ instead of C / C ++. I got the error that I do not support the v100 compiler, so I installed the project platform on v90 and now I load Visual Studio 2008. I was hoping that I would not need to install two versions of the visual studio, but fine. In any case, most of the syntax highlighting is turned on, some keywords, such as "int", are blue, comments are green, and lines are red.However, cuda keywords like __ global__ are not. Also, I checked the include directories and cannot find cutil.h, so I wonder if there is anything else that was not included in the 3.2 SDK installation (instead I included cuda_runtime.h, but I don’t know if it will allow these are my problems). Does anyone know how to fix this?

Edit: I have Visual Studio 2008 installed. When I try to compile, I get a giant list of errors starting with 1> C: \ Program Files (x86) \ Microsoft Visual Studio 9.0 \ VC \ include \ crtdefs.h (490) : error: invalid reuse of name of type "size_t", while most of the following errors have to deal with type of size_t. All errors are included in the included files, most of which I have never seen. Does anyone know what is going on? Or if there is a simple step-by-step guide on using VS2010 to use cuda?

Edit 2: Apparently, I had one of the many current settings as 64-bit and the rest 32-bit. Active configuration change, Cuda C / C ++ Target Machine Platform and Linker | Advanced Target Machine for 32-bit or 64-bit permissions allowed me to compile and run. I still do not know how to fix __ global__ and such syntax highlighting, but this is not so important.

+5
source share
2 answers

Here you will find the complete guide:

How to run CUDA in Visual Studio 2010

+1
source

you can check if the source file containing the kernel is a CUDA / C file and not a C / C ++ file. (Solution Explorer -> File Properties)

0
source

All Articles