Use of NVIDIA Tools Extension under Visual Studio 2010 - visual-studio-2010

I'm trying to use the NVIDIA Tools Extension to perform a more accurate performance assessment of a CUDA code with the Visual Profiler. I'm using Visual Studio 2010 for developing the code.
To setup Visual Studio 2010 for this feature, I have added
Properties -> Linker -> General -> Additional Library Directories -> $(NVTOOLSEXT_PATH)\lib\$(Platform);
Properties -> Linker -> General -> Input -> Additional Dependencies -> nvToolsExt32_1.lib;
However, when I use
#include <nvToolsExt>
the compiler says
Error 1 error C1083: Cannot open include file: 'nvToolsExt': No such file or directory
The environmental variable NVTOOLSEXT_PATH is set as
NVTOOLSEXT_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\nvToolsExt\
but the directory C:\Program Files\NVIDIA GPU Computing Toolkit\nvToolsExt\ is not present on my system and so I think that the NVIDIA Tools Extension is not installed.
I have two questions:
1) Is the above procedure to set up Visual Studio 2010 for the NVIDIA Tools Extension feature correct?
2) How to install the tools?
Thanks in advance.

In the Nsight User Guider for Visual Studio 2.2 \ NVIDIA Tools Extension Library \ Section 5. Adding NVTX to a Project has the following instructions:
The NVTX API is installed by the NVIDIA Nsight “host” installer (by
default) into the following location:
On a 32-bit system: C:\Program Files\NVIDIA GPU Computing
Toolkit\nvToolsExt
On a 64-bit system: C:\Program Files (x86)\NVIDIA GPU Computing
Toolkit\nvToolsExt
Both the header files and the library files themselves (.lib, .dll),
are located underneath this path.
By default, the NVIDIA Nsight installer will set up the environment
variable NVTOOLSEXT_PATH to point to the aforementioned location that
matches the system's bits.
5.1 C++ Project
In order to compile your project with NVTX support in Visual Studio,
use the following steps to setup your project accordingly:
Open the project properties dialog.
Navigate to Configuration > Properties > C/C++ > General.
Add the following path to the Additional Include Directories: $(NVTOOLSEXT_PATH)\include
Navigate to Configuration Properties > Linker > General.
Add the following path to the Additional Library Directories:
$(NVTOOLSEXT_PATH)\lib\$(Platform)
Navigate to Configuration > Properties > Linker > Input.
Add nvToolsExt32_1.lib or nvToolsExt64_1.lib (according to your system specifications), to the
Additional Dependencies.
5.2 CUDA (.cu file)
In case you use NVTX to annotate code in .cu files, please also make
sure the following configuration is setup (this is in addition to the
steps discussed in the previous section):
Open the project properties dialog. Navigate to Configuration Properties > CUDA C/C++ > Common. > Add the following path to the
Additional Include Directories: $(NVTOOLSEXT_PATH)\include
In the question you have skipped step 5.1.2 which adds NVTX to the Additional Include Paths. Without the updated include path the compiler will fail to find the NvToolsExt.h.
Section 5.3 and 5.4 recommend moving the NVTX library into your source tree (vs. using the default location) and adding a deploy to step to copy the DLLs to the project bin directory.

Related

QT QSqlDatabase, Add to Visual Studio Project

I am looking for direction on how I might include the QT ODBC source in my Visual Studio 2010 executable. My project requires a modification of the SQLResult class and prefer to include the source in my application instead of linking in the object configure -static.
FWIW: I am a registered Enterprise user with a valid license.
Many thanks!
This is what I did... I do hope that these steps are useful to others.
My Environment: Visual Studio 2010 Ultimate
Download build from QT
Extract Build to directory...
C:\Qt\qt-everywhere-enterprise-src-5.2.1\
For each (x86/x64) platforms:
Program \Visual Studio Tools \ command prompt
create directory for QT platform
In my case: c:\qt\x86 and c:\qt\x64
Set the environment path to QT base:
QTDIR=C:\Qt\x86\qt-everywhere-enterprise-src-5.2.1\qtbase
At the command prompt:
set PATH=%CD%\qtbase\bin;%PATH%
Include any modules: Note -static
configure -static -prefix %CD%\qtbase -qt-sql-odbc -opengl desktop
nmake
For sql plug in:
cd src/sql
Create a VSProj file and include in your project.
qmake -tp vc
In Visual Studio ensure the VS Addin is installed on the system. At the VS Menu Qt5 menu. Selection options. Create a build
to associate the VS addin to.
c/C++ hive
General Additional Include:
.\GeneratedFiles;.;$(QTDIR)\include;
.\GeneratedFiles\$(ConfigurationName);
$(QTDIR)\include\QtCore;
$(QTDIR)\include\QtGui;
$(QTDIR)\include\QtSql;
$(QTDIR)\include\QtWidgets;
$(QTDIR)\include\QtNetwork;
$(QTDIR)\include\QtConcurrent;
.\header;
$(QTDIR)\plugins\platforms;
%(AdditionalIncludeDirectories)
Ensure all libraries are referenced in VS Project properties\linker\input\additional dependencies
Linker \ General \ Additional Library Directories
$(QTDIR)\lib;$(QTDIR)\plugins\platforms;%(AdditionalLibraryDirectories)

How to include <cuda_runtime.h> in .cpp file

I have problem to include <cuda_runtime.h> in .cpp file. Error: Cannot include file: cuda_runtime.h: No such file or directory.
I am trying to complie code from Rob Farber ( http://www.drdobbs.com/architecture-and-design/222600097?pgno=1 ).
I have compiled few cuda codes before but <cuda_runtime.h> was allways included in .cu file.
I am using VS 2008 Express.
Q: Do I have to link VS somehow different so it knows where to look for <cuda_runtime.h>?
In Visual Studio 2008, add the path of the include files in Visual C++ directories.
"Installation Path"\NVIDIA GPU Computing Toolkit\CUDA\"version"\include\
Here is the procedure:
In Visual Studio 2008, go to
- Tools -> Options -> Projects And Solutions -> Visual C++ Directories.
- Select include files from the drop down list named "Show Directories For".
- Add new item by clicking the yellow button below the drop down list.
- Paste the include fles path here.
- Verify the correctness of path by clicking the check button on left of yellow button
- Click ok and restart visual studio.
Now Visual Studio 2008 will know where the include file is located.
Instead of setting up a hard-coded path - which you will most likely have when locating CUDA installation on your machine - you can also add cudart.lib as additional dependency for the linker.
Right click on the project > Properties > Linker > Input > Additional Dependencies. Add cudart.lib there.

Trouble building Boost Libraries

OS: Win7
IDE: Visual Studio 2010 Professional
Boost Lib Version: 1.47
Downloaded "boost_1_47_setup.exe" installer from http://www.boostpro.com/download/
Initially installed everything for VS 10, then just checked every box (5+ GB install!)
Added the "boost\boost_1_47" path into "Additional Include Directories" in C++->General
Copy/Pasted code from "Getting Started on Windows: 4 - Build a Simple Program Using Boost"
Compiled without issue
Included boost/regex.hpp and re-compiled
Received Error:
LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc100-mt-gd-1_47.lib'
Expected, haven't built the binaries yet.
Ran "Visual Studio Command Prompt" from tools folder in my VS 10 installation as admin
cd'ed to boost root
Ran bootstrap.bat from command line
Received Error:
Building Boost.Build engine
The system cannot find the path specified.
'.\build.bat' is not recognized as an internal or external command,
operable program or batch file.
Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.
Everything I did came from the Getting Started page on Boost.org. Not sure if its just dated or if I'm doing something wrong.
Came here looking for answers, found some similar issues, namely the following:
Problem with C++ Boost installation (can't find file) in VC++ 2010
Problem with C++ Boost installation (can't find file) in VC++ 2010
Boost C++ Libraries linker error libboost_serialization-vc100-mt-gd-1_47.lib
Boost C++ Libraries linker error libboost_serialization-vc100-mt-gd-1_47.lib
No dice. Any help would be appreciated. Thanks
The compiler cannot find the BOOST's library file. To fix the issue you have to find on your computer the libboost_regex-vc100-mt-gd-1_47.lib file and add its folder path to the Project->YourProjectName Properties (Alt+F7)->Configuration Properties->Linker->General->Additional Library Directories. After recompile your project.
This is the answer to the above comment of #Johnny 5....thousand. In VS10 the compiler-wide additional libraries are deprecated. I solved the problem by adding a new project property sheet to all my projects. It is possible to do it by calling the Property Manager Tab (View->Property Manager). In the Property Manager Tab is necessary to click right mouse button on the project, select Add New Project Property Sheet, Save the sheet to a well-known place. After to define a new User Macro - Name:BOOST, Value: Your Boost Path, for example c:\boost_1_47_0\, also add the $(BOOST) to the Additional Include Directories and ad the $(BOOST)\lib to the Additional Library Directories. That's all. For all other projects is required to add existing property sheet.

Including a dependency in VS2010 - Visual Leak Detector

I'm trying to use Visual Leak Detector 1.9h beta in a Visual C++ project on Visual Studio 2010. When I build and run my project I get the following error:
The program can't start because
vld.dll is missing from your computer.
Try reinstalling the program to fid
this problem.
The README that comes with VLD states for Visual C++ 8 and 9:
Go to Tools ->
Options -> Projects and Solutions ->
VC++ Directories. Select "Include
files" from the "Show Directories For"
drop-down menu. Add the include
subdirectory from the Visual Leak
Detector installation directory. Move
it to the bottom of the list. Then
select "Library files" from the
drop-down menu and add the lib
subdirectory from the Visual Leak
Detector installation directory.
Again, move it to the bottom of the
list.
The menus suggested is deprecated in VS2010. What would be the equivalent for VS2010?
I tried the following without success:
Right click on the project \ properties \ Configuration Properties \ C\C++ \ General \ Additional Include Directories -> add ";C:\Program Files (x86)\Visual Leak Detector\include"
Right click on the project \ properties \ Configuration Properties \ Linker \ General \ Additional Library Directories -> add ";C:\Program Files (x86)\Visual Leak Detector\lib\vld.lib"
but as you can guess, it didn't work...
The error message you got isn't fixable with any of the settings you're browsing through. It is a straight-forward runtime error, Windows just cannot find the DLL that the tool needs.
First thing you need to do is find out where the installer put the vld.dll file. You are clearly running a 64-bit operating system. First look in c:\windows\system32, move it to c:\windows\syswow64 if you find it there so that 32-bit programs can find the DLL. Also check if the installer messed with the system environment PATH variable (Control Panel + System, Advanced), you may have to restart Visual Studio to make the change effective. Adding the install directory to this variable would be another solution. The last ditch make-it-work effort is to copy vld.dll into your build directory.

Where do I input DLL dependencies in Visual Studio C++ project?

I am converting some Qt project files (.pro) that run on Linux and Mac into Visual Studio project files (.vcproj) The Qt Visual Studio add-in converted everything fine except the DLL dependencies. Where do I put these in Visual Studio 2008?
If I put the DLLs in Configuration Properties > Linker > Input > Additional Dependencies, I get:
fatal error LNK1107: invalid or corrupt file: cannot read at 0xABC
Where do dynamically-linked dependencies go?
Project Properties -> Linker -> Input -> Additional Dependencies
In that field put xxxx.lib for whatever library you need.
You might want to check what’s the differences between .dll , .lib, .h files ?.
You need to specify the corresponding .lib file at link time. not the dll.

Resources