之前一些實驗需要用到cuda, 所以就大概紀錄一下安裝cuda在visual studio上的文章.
env: win 7 + visual studio 08
cuda version: cuda 3.2
steps:
1. 安裝cuda toolkit
%%假設64bits安裝在C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2
2. 安裝cuda sdk 32bits or 64bits
%%假設64bits安裝在C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2
3. 設定visual studio
Tools->Options ->CV++ Directories:
Executable file:
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\shared\bin\win64\Release
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\bin
include file:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\shared\inc
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\common\inc
lib file:
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\shared\lib
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\common\lib
C:\Program Files (x86)\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64
4. 安裝npp(NVIDIA Performance Primitives library, optional)
%%假設64bitx安裝在C:\NVIDIA\NPP_SDK_0_9_3_1_X64
32bits or 64bits
Tools->Options ->CV++ Directories:
include file:
C:\NVIDIA\NPP_SDK_0_9_3_1_X64\common\npp\include
C:\NVIDIA\NPP_SDK_0_9_3_1_X64\common\FreeImage\include
lib file:
C:\NVIDIA\NPP_SDK_0_9_3_1_X64\common\lib
C:\NVIDIA\NPP_SDK_0_9_3_1_X64\common\FreeImage\lib
5. 編譯example code
%%C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\src
開啟其中一個example, 重編譯, 沒問題的話就是ok了.
note: 若要編譯x32的code, 路徑設定成win32底下即可(或是直接安裝32bits的版本也可).
沒有留言:
張貼留言