NSight environmental variables

Hi!

First of all, I have Win10, VS2015Pro, NSight 5.6, GeForce 960M, display driver 398.36, and CUDA 9.2.

I have a small project which uses CUDA, and I’d like to debug my kernel. The project however needs a certain environmental variable to run, an addendum to PATH, which I don’t want to set globally, via the OS, cause it would mess up other things. Thus, I set it via the visual studio project properties.

Now, the problem is that when I “Start CUDA debugger (Legacy)”, NSight doesn’t pass on the environmental variables I set in VS to the program.

Is there checkbox I’m missing in NSight settings, or is this a feature NSight currently doesn’t support?

Regards,
David

Hi, varkonyidavid91

You can try launch VS from command line.

That is

  1. Find VS2015 command prompt, in my machine, it is under C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2015\Visual Studio Tools\Windows Desktop Command Prompts\

  2. launch it

  3. set the env in the command prompt

  4. execute “devenv” to launch VS2015

Hope this works !

Hi, varkonyidavid91

You can try launch VS from command line.

That is

  1. Find VS2015 command prompt, in my machine, it is under C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2015\Visual Studio Tools\Windows Desktop Command Prompts\

  2. launch it

  3. set the env in the command prompt

  4. execute “devenv” to launch VS2015

Hope this works !

It works! Thanks! I usually open VS via a shortcut, or by directly opening an .sln, and then set the variables on the project properties page.

Is there a way to make that work too? It would be easier to just open .slns then open VS via the console :)

Sorry, I am not sure if there are other ways.

If you really want to know, I think you should ask VS related support team.