CUDA Profiler 0.9 How to enable Profiler tool?

Hey everybody,

in the “doc” dir of the CUDA Toolkit release 0.9 I found a nice text file “CUDA_Profiler_0.9.txt”. I would like to use this profiler on my WinXP / Visual Studio 2005 system. The text file says I have to set the environment variable “CUDA_PROFILE” to “1” to enable the profiler. Where can I set this variable to “1”?

Thanks in advance and best regards,
Christoph

This is a good question. I came across the same topic some time ago. The only way I found is to start the app from the command line and use “set var=val” in advance. There should be some simpler way to do it in the project settings but I can’t find it…

I also tried to set the env var at program start with Stdlib’s _putenv(“X=Y”) but it doesn’t works. Maybe CUDA runtime is already initialized and running at this time ?

Greetings

Knax

On Linux, just set it in the shell you are running the program from, ie. for a bash do
“export CUDA_PROFILE=1” for a tcsh do “setenv CUDA_PROFILE 1”

On Windows, set it in the DOS box where you run the program from, ie. “set CUDA_PROFILE=1”. If you are running from VisualStudio, set it in the debug environment somewhere when you right click on the exe->Properties. To set it permanently (not recommended), add it as a personal env variable in the Advanced->EnvVar settings dialog of the “My Computer” properties.

Peter

With VS 2003 .net there are no other properties for debug environment than command, command line arguments and working directory.

I tried the command:

set CUDA_PROFILE=1 && $(TargetPath)

but it looks like VS doesn’t understand the same commands as cmd.exe

(windows CLI). I searched the VS documentation (lots and lots of infos on all and every language and SDK in this fabulous realm of MS Windows) but found nothing useful about some simple task as setting an environment variable for a console project from within the IDE project settings.

Hi,

just looked at VS 2005 and :"> yes: there it is - the most advanced feature
MS ever coded for this IDE:

Project->Properties->Configuration Properties->Debugging->Environment

It took MS years and years to figure out how to do this in their IDE. Now I will
switch all my projects to VS2005 for this magical feature :magic:

But no, my boss doesn’t want us to conterminate all and everything with this .Net2 stuff and VS2005 runtimes.

I would have expected the Control Panel → System tool, which lets you set environment variables, would work. Are you saying this didn’t work?

(I’m using Linux, with no intention of putting M$ win-doze on that machine, so I can’t check)

I have tried to set CUDA_PROFILE 1 in the environment variables dialog on windows. However, it seems no cuda_profile.log file generated. Any idea about this?

Execute your code from a shell and set the variable from the command line
(export CUDA_PROFILE=1)

i got it work by below redundant things(maybe you can skip some):

#XP->my computer->properties->advanced->env varibles->both tables add a “CUDA_PROFILE” with 1

#use cmdline, “set CUDA_PROFILE=1”

cd to the exe (\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win32\Release in my case), run the exe, now i got the .log in the same folder(by default).

This worked. Thanks a lot External Media

Thanks for the solution, yk_cadcg. Would just like to add my bit… For me, out of the 3 redundant solutions suggested by yk_cadcg, what finally worked was setting the env var in My Computer>Properties. Looks like the other two may be unnecessary.

Hi,

I tried both and either one of the first two solutions you suggested but did not have any .log file generated in any of the folders :( I also tried to set the variables using nvcc.profile but even that did not help. I cannot use the third method suggested since I am using Matlab+CUDA (nvmex). Can you please suggest how to set the environment with nvmex?

Thanks & regards,

Aditi