Linear Algebra
Friday, January 22, 2010
Tuesday, January 19, 2010
Setting up CUDA projects with Visual Studio 2008
1. Download the latest CDUA Tookit and CUDA SDK from here and install them.
2. Set System Environment Variables $(CUDA_INC_PATH), $(CUDA_LIB_PATH), $(NVSDKCUDA_ROOT)
3. Create an empty project in Visual Studio 2008, right click the name of the project and from the pop menu, choose "Custom Build Rules...". Then import "Cuda.Rules" from $(NVSDKCUDA_ROOT)/C/common and check "CUDA Build Rule".
4. Set up the properties of the project.
Set the configuration to 'All configurations' then
C/C++ -> General -> Additional Included Directories:
$(CUDA_INC_PATH);$(NVSDKCUDA_ROOT)/common/inc
Linker -> General -> Additional Library Directories:
$(CUDA_LIB_PATH);$(NVSDKCUDA_ROOT)\common\lib
Linker -> Input -> Additional Dependecy:
cudart.lib cutil32.lib
5. Create two new configurations, EmuDebug and EmuRelease. Right click the name of solution and select "Configuration Manager...".
In the popped up dialog, create 'EmuDebug' by copying the 'Debug' configuration and 'EmuRelease' configuration by copying 'Release' configuration.
6. set Debug configuration,
C/C++ -> General -> Debug Information Format: Program Database (/Zi)
C/C++ -> Code Generation -> Runtime Library: Multi-threaded Debug (/MTd)
7. set EmuDebug configuration,
CUDA Build Rule -> General -> Generate Debug Information: Yes(-D_DEBUG)
CUDA Build Rule -> General -> Emulation Mode: Yes(-deviceemu -D_DEVICEEMU)
CUDA Build Rule -> General -> Optimization: Disabled(/Od)
8. Some .cu files can be Excluded from Build.
2. Set System Environment Variables $(CUDA_INC_PATH), $(CUDA_LIB_PATH), $(NVSDKCUDA_ROOT)
3. Create an empty project in Visual Studio 2008, right click the name of the project and from the pop menu, choose "Custom Build Rules...". Then import "Cuda.Rules" from $(NVSDKCUDA_ROOT)/C/common and check "CUDA Build Rule".
4. Set up the properties of the project.
Set the configuration to 'All configurations' then
C/C++ -> General -> Additional Included Directories:
$(CUDA_INC_PATH);$(NVSDKCUDA_ROOT)/common/inc
Linker -> General -> Additional Library Directories:
$(CUDA_LIB_PATH);$(NVSDKCUDA_ROOT)\common\lib
Linker -> Input -> Additional Dependecy:
cudart.lib cutil32.lib
5. Create two new configurations, EmuDebug and EmuRelease. Right click the name of solution and select "Configuration Manager...".
In the popped up dialog, create 'EmuDebug' by copying the 'Debug' configuration and 'EmuRelease' configuration by copying 'Release' configuration.
6. set Debug configuration,
C/C++ -> General -> Debug Information Format: Program Database (/Zi)
C/C++ -> Code Generation -> Runtime Library: Multi-threaded Debug (/MTd)
7. set EmuDebug configuration,
CUDA Build Rule -> General -> Generate Debug Information: Yes(-D_DEBUG)
CUDA Build Rule -> General -> Emulation Mode: Yes(-deviceemu -D_DEVICEEMU)
CUDA Build Rule -> General -> Optimization: Disabled(/Od)
8. Some .cu files can be Excluded from Build.
Subscribe to:
Posts (Atom)