Installing nvidia cuda template in visual studio - cuda

I installed visual studio 2010 on my notebook , and then i installed cuda version 5.5 on my notebook . I am a beginner in parallel programming . The thing is , why am I not getting Nvidia cuda template installed in visual studio . Whenever I click on new project it shows only CLR , Win32 and General option .
How to install CUDA template in visual studio ?

Check out this answer for getting started with VS2010. You can start with an empty C++ project, when you enable the CUDA build customisation any .cu files will be built with CUDA.

Related

is there a way of configuring a ms compiler?

I have visual studio code installed. however, I do not want to use a third party c++ compiler. is there a way of getting the Microsoft c++ compiler and configuring it to visual studio code without a full version of visual studio?

Issues in cuda toolkit installation

I'm trying to set up cuda toolkit but even if i've already installed visual studio express 2013, cuda toolkit installation warn me that it can't find any visual studio installation.
I'm wondering if it is the 2013 express version that could raise an error ?
Furthermore I would like to code and compile by hand, when I do so I get this error : "nvcc fatal error no cl.exe found"
Thus I put the flag -ccbin"path/to/my/gcc" but I get an error that told me there isn't any supported version of visual studio.
May I understand that it isn't possible to compile by hand without visual studio ?
I installed visual studio community 2013 and it seems, finally, that it worked.

CUDA Developer Toolkit: Display Driver failed installation

I have the Nvidia Quadro NVS4200M along with Intel Integrated Graphics (on my laptop). I can't seem to get the CUDA 5.0 toolkit installation to succeed.
I am running Windows 7 Enterprise Edition 64-bit. I tried the 64-bit desktop & notebook installers and the 32-bit installers.
All of them seem to fail with the error message "Display Driver failed installation". I installed the latest drivers from here, and it is supposed to support CUDA-5.0, and despite that, the installation fails.
After failure, the libraries and binaries are present, but NSight Eclipse (which seems to have no standalone installation link) isn't installed. What could be the possible issue?
I'm not sure why the driver install failed in your case, but if you
have a "recent" driver installed, it's not necessary to use the
driver that comes with the cuda installer. The cuda installer
offers individual options to install the toolkit (required), samples
(optional), and driver (required only if you have an older driver),
so you can just select "no" when prompted for the driver install, to
avoid this, assuming you have a recent driver or installed one such
as the 307.45 driver.
You should always use a 64 bit installer if you have a 64 bit OS.
The only officially supported C/C++ compiler for windows is cl.exe, the microsoft compiler that ships with either Microsoft Visual Studio (the Express edition will do, it is free), or the Windows SDK (for command line use only). You're free to experiment with other stuff, but your mileage may vary. MS VS 2010 (and 2008) are the easiest to use. MS VS 2012 can be made to work but may require extra steps.
I recommend installing cuda after installing Microsoft Visual Studio. This is because the cuda installer should automatically find your VS installation and update some important files to make building cuda projects easier.
nsight Eclipse Edition is a linux-only tool (or mac). It is not for windows use, and will not be installed by the windows cuda installers. nsight EE provides an environment for code building, debugging, and profiling. In windows, the corresponding operations can be done via MS VS IDE for code building, the standalone visual profiler for profiling, and using a separate plug-in, nsight visual studio edition, for debugging and profiling within visual studio. Due to the way visual studio is constructed, nsight visual studio edition will not work with the free versions of visual studio. nsight visual studio has it's own separate installer.
The windows getting started guide may also be of interest.

portability of DLL with CUDA code

I have DLL, which contain CUDA function (image processing). This DLL is compiled with VISUAL STUDIO 2008 Express edition. I call this DLL with LabVIEW.
This DLL and LabVIEW VI are developed on one computer (office) and I need to run same program in differen computer (in lab).
Q1: Do I have to instal cuda toolkit or cuda SDK on computer in lab?
Q2: Do I have to recompile DLL on computer in lab or DLL are completly portable?
Thanks
Yes, you have to install CUDA toolkit and SDK if you use any functions/ wrappers ( like cudaSafeCall) from SDK. In general SDK is not nesessary. You need in compatible NVIDIA GPU driver instaled on Lab computer, too.
You need not recompile if Lab computer and your own have the same Microsoft Visual Studio runtime, CUDA runtime version and Lab computer have GPU device with proper compute capability that your code was compiled for. For more information about CUDA code compatibility see 3.1.2 - 3.1.4 sections in CUDA C programming Guide.

How to create 64-bit CUDA applications? (Win7 x64, CUDA 4, VS 2010 Express)

I'm mostly set up for CUDA development. I've installed the developer drivers, CUDA 4.0 toolkit, and the 4.0 SDK, as well as the bugfix. I'm running Windows 7 x64, and am using Visual C++ 2010 Express. For 32-bit applications, I perform the following steps and my CUDA applications work properly.
Create new empty project
make sure Platform Toolset is set to v100 (normally the default)
check the CUDA 4.0 Build Customization for the project
set the item type of my .cu file to CUDA C/C++
add 'cudart.lib' to Properties->Linker->Input->Additional Dependencies
I can also run non-CUDA 64-bit applications. Visual C++ 2010 Express does not come with 64-bit dependencies automatically, so I had to install the Windows 7.1 SDK w/ .NET Framework 4.0. Then I simply set the Platform Toolset for the VC++ project to Windows7.1SDK, change the Active solution platform to x64, and I'm good to go.
However, I can't seem to do both at the same time - I can't create a 64-bit CUDA application. If I change the Platform Toolset of a CUDA application to Windows7.1SDK, whether the Active solution platform is x64 or Win32, I get the compile error that nvcc.exe exited with code -1. And if I leave the Platform Toolset set to v100 and change the Active solution platform to x64, I get the compile error "fatal error LNK1104: cannot open file 'kernel32.lib'. The only combination that works is v100 and Win32, and obviously that prevents me from running a 64-bit application.
Is there a procedure for enabling this functionality that I just haven't been able to find online? Any ideas or suggestions? Thanks for your time.
Not possible in express edition , ( does not support plugins ) unless you want to setup nvcc manually , and use notepad to write cu files, I very much prefer the VS integration .
You could check that the host compiler properties for the .cu files are set to 64-bit.
Right-click the "Code.cu" file and click 'Properties'.
Expand the "CUDA C/C++" item and select "Common".
Change "Target Machine Platform" to 64-bit.