Sign in to follow this  
Misery

CUDA installation

Recommended Posts

Hi Guys,

For several days I have been trying to run CUDA Hello world program. I have tried to go trough a few tutorials...
But i can't make it work :(
Woluld someone be so kind to write step by step what I do need to install and how to configure Microsoft Visual Studio 2008
to use with CUDA. I think I have installed everything, or at least everything that was mentioned but I still have no working CUDA API.

I am interested to use CUDA v4.0 with MSVS 2008 with C++ language.

I am absolute noob in GPU programming and I can hardly begin to do it myself.

I'll be grateful for any help.
Thanks in advance,
Regards

Share this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='1310932430' post='4836461']
How about you tell us what you're actually having a problem with?
[/quote]

Really, I have a problem with absolutely everything concerning CUDA.
I have tried following tutorials and solutions and none of them worked:
[url="http://www.programmerfish.com/how-to-run-cuda-on-visual-studio-2008-vs08/"]tutorial 1[/url]
[url="http://forums.nvidia.com/index.php?showtopic=90044"]tutorial2[/url]
[url="http://forums.nvidia.com/index.php?showtopic=157676"]post1[/url]
[url="http://forums.nvidia.com/index.php?showtopic=201051"]post2[/url]
[url="http://forums.nvidia.com/index.php?showtopic=157676"]post3[/url]

I have GTX 480 GPU, intel i7 on asus motherboard.
I have installed Visual Studio Pro (MSDNAA) 2008 SP1 for C/C++ development.
I am using Windows 7 x64 but for now I am trying to build cuda hello world as a 32 bit program and I have included proper libraries.
(x64 didn't work either).

I have installed CUDA: Toolkit v4.0 and CUDA tools v4.0 and sample codes, and newest developer drivers.
After installing Parallel Insight 2.0 I cannot compile anything using Visual Studio 2008 or 2010 because my AVG Anti-Virus detects compiled any program as a threat.
Also programs that use no CUDA. I cannot even compile now a program that is just a Win32 empty template created by MSVS 2008.
Before istallation of nVidia insight AVG caused no problems.

CUDA example programs work well. However when I try to compile their source codes I get error saying that I do not have[b][font="Arial Black"][size="2"] cutil32D.lib[/size][/font][/b].
I am trying to build this library but when I open solution [b]cutil_VS2008.sln[/b] it builds and no lib or dll file is created.
But as far as I managed to find out I dont need this file to compile simple hello program.

I make a VS 2008 project:
C++ -> console Win32 and I make a following code:
[code]
#include "stdafx.h"
#include <cuda.h>

__global__ void HelloGPU(void){}

int _tmain(int argc, _TCHAR* argv[])
{
HelloGPU<<<1,1>>>();
return 0;
}
[/code]
(I did add all required nVidia lib,inc,bin paths to enviroment)
I change the rules to
[b]CUDA Runtime API Build Rule (v4.0)[/b]
and
[b]CUDA Driver API Build Rule (v4.0)[/b]

I also tried:
[b]CUDA Driver API Build Rule
CUDA Runtime API Build Rule[/b]

[b]CUDA Driver API Build Rule (v3.2)
CUDA Runtime API Build Rule (v3.2)[/b]

and of course non of those worked.

(I disabled AVG anti-virus)
I changed file extention to *.cu and build so I get following error:
release:
[code]
1>------ Build started: Project: HelloWorld, Configuration: Release Win32 ------
1>Compiling with CUDA Build Rule...
1>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\\bin\nvcc.exe" -arch sm_10 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\\include" -maxrregcount=0 -m32 -cubin -o "C:\Misery\Moje projekty\CUDA\HelloWorld\Release/HelloWorld.cubin" HelloWorld.cu
1>HelloWorld.cu
1>c:/Misery/Moje projekty/CUDA/HelloWorld/HelloWorld/HelloWorld.cu(10): error: a __global__ function call must be configured
1>1 error detected in the compilation of "C:/Users/Misery/AppData/Local/Temp/tmpxft_00000900_00000000-6_HelloWorld.cpp4.ii".
1>Project : error PRJ0019: A tool returned an error code from "Compiling with CUDA Build Rule..."
1>Build log was saved at "file://c:\Misery\Moje projekty\CUDA\HelloWorld\HelloWorld\Release\BuildLog.htm"
1>HelloWorld - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0
[/code]
debug:
[code]
1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
1>Compiling with CUDA Build Rule...
1>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\\bin\nvcc.exe" -arch sm_10 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\\include" -maxrregcount=0 -m32 -cubin -o "C:\Misery\Moje projekty\CUDA\HelloWorld\Debug/HelloWorld.cubin" HelloWorld.cu
1>HelloWorld.cu
1>c:/Misery/Moje projekty/CUDA/HelloWorld/HelloWorld/HelloWorld.cu(10): error: a __global__ function call must be configured
1>1 error detected in the compilation of "C:/Users/Misery/AppData/Local/Temp/tmpxft_00000910_00000000-6_HelloWorld.cpp4.ii".
1>Project : error PRJ0019: A tool returned an error code from "Compiling with CUDA Build Rule..."
1>Build log was saved at "file://c:\Misery\Moje projekty\CUDA\HelloWorld\HelloWorld\Debug\BuildLog.htm"
1>HelloWorld - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/code]

I also have tried [url="http://sourceforge.net/projects/cudavswizard/"]CUDA WIZARD[/url] and this didn't help either
I have tried many ways to make it work, all failed :(

Therefore I am asking for a detailed step by step tutorial how to run CUDA simpliest program.

[EDIT] At first i tried to compile program using command line and nvcc but then i got linker error altough MS linker has been added to
PATH so I decided that it would be easier to use MSVS integration.

Regards,
Misery

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this