Environment variables

I am running performance analysis of application from Visual Studio which was executed with additional environment variables. These variables are not inherited to analyzed application. Is there some way how to achieve it?

Thank You


This should work if you launch the Nsight Monitor from a command line where it has the environment variables that are needed for the target application.

Let me know if that works for you.

It doesn’t work. I didn’t have this problem in previous beta version so I was curious what has changed. It seems it’s caused because Nsight Monitor is now executed with different privileges and it doesn’t inherit environment variables from its parent process.


When you mentioned ‘previous beta version’, which version/build are you referring to (that worked) and which one are you trying right now (that doesn’t work)?
What OS version are you working on?


I have a similar problem with environment variables: the to-be-debugged or profiled application does not inherit the environment that visual studio was started with.
I have a rather convoluted PATH, pointing to various locations for dlls. Trying to start cuda-debugging or profiling with nsight from within visual studio (2010 btw) fails because it cannot find the required dlls.
A work-around is to copy the dlls next to the exe. Would be nice if that’d work out of the box.

This is with the recent 3.1 final, on windows 8 64-bit, vs 2010.

It worked for me on first 3.0 beta version, now I am at 3.1 final & VS 2008 & Windows 7 64-bit

jtotz, unfortunately this is a known issue with Windows 8 due to changes in user security.

Hi jtotz, tchabada,

This could most likely be, because when you run the command prompt, it is not under an elevated (meaning “Administrator”) privileges, and when the Nsight Monitor runs, it elevates, therefore the environment block is not being inherited. Could you verify this is the case? Just make sure that when you first run the command prompt, you right click and say “run as administrator”, then set your env vars needed and run the monitor.
Please confirm this is the case.

jtotz, and on Win8 there is no way to say ‘always run this as an administrator’ like on Win7 :-( I’ve read some hacks, but I wouldn’t recommend it, so you always have to do this… :-(


it works when you run command prompt as administrator, inject your environment variables, run Nsight Monitor, but it’s little bit uncomfortable.

Confirming, that work around works.