CUDA Compile Environment with VS 2008

2009. 12. 18. 11:55·Computer/CUDA
728x90
728x90

To set up CUDA compile environment with VS 2008.

 

Step 1: Adding Cuda.Rules to your project.

Project > Custom Build Rules...

Untitled(1).jpg

Click Find Existing...

Select %CUDA_SDK%\C\common\Cuda.Rules

Untitled.jpg

 

Step 2: Now set up your Include directory, library directory, and Executable directory.

Tools > Options... > Projects and Solutions > VC++ Directories

 

Select Platform. In my case, x64 was selected.

And select Show directories for: as Include files.

Add following three directories

%CUDA%\include

%CUDA%\include\crt

%CUDA_SDK%\C\common\inc

Untitled(2).jpg

 

And select Show directories for: as Library files.

Add following two directories

%CUDA%\lib64

%CUDA_SDK%\C\common\lib

Untitled(3).jpg

 

Simillarly, select Excutable files for the dropdown and specify:

%CUDA%\bin64

%CUDA_SDK%\C\bin\win64\EmuDebug

%CUDA_SDK%\C\bin\win64\EmuRelease

Untitled(8).jpg

Step 3 : Specify the CUDA Runtime and CUTIL64D.lib.

Project > Properties

Select Configuration Properties > Linker > Input

Specify Additional Dependencies as cudart.lib and cutil64D.lib for Debug configuration

Untitled(5).jpg

Similarly, for Release configuration, specify Additional Dependencies as cudart.lib and cutil64.lib.

Untitled(6).jpg

 

Step 4: Set up for CUDA syntax highlighting

Find the CUDA syntax highlighting supporting file :

%CUDA_SDK%\C\doc\syntax_highlighting\visual_studio_8\usertype.dat

Copy this file into

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE

Then, configure VS text editor.

Tools > Options > Text Editor > File Extension

combine cu extension with Microsfot Visula C++

Untitled(7).jpg

 

Step 5: In order to debug your code, add cutil64D.dll into your PATH environment variable.

 

You can also do a "Post build" event in VS2008 to copy over the requisite dll files to the target directory where the exe gets generated. 

copy "$(NVSDKCUDA_ROOT)\bin\win64\$(ConfigurationName)\*.dll" "$(TargetDir)" 

 

 

Reference

http://www.programmerfish.com/how-to-run-cuda-on-visual-studio-2008-vs08/

http://forums.nvidia.com/index.php?showtopic=87705&mode=threaded&pid=503328

이 글은 스프링노트에서 작성되었습니다.

728x90

'Computer > CUDA' 카테고리의 다른 글

[ML] WSL2 : Install Tensorflow (GPU)  (0) 2022.07.17
CUDA 3D, 2D data processing.  (0) 2009.12.18
'Computer/CUDA' 카테고리의 다른 글
  • [ML] WSL2 : Install Tensorflow (GPU)
  • CUDA 3D, 2D data processing.
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (787)
      • Private Life (15)
      • Programming (206)
        • DIP (116)
        • ML (35)
      • Computer (17)
        • CE (54)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (368)
        • Signals and Systems (115)
        • Math (176)
        • Linear Algebra (33)
        • Physics (43)
        • 인성세미나 (1)
      • 정리필요. (61)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (7)
        • PET Study 2009 (1)
        • 방사선 장해방호 (5)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    linear algebra
    fourier transform
    인허가제도
    math
    cv2
    SS
    SIGNAL
    ML
    Term
    Optimization
    Programming
    Python
    signals_and_systems
    Probability
    opencv
    Vector
    function
    random
    signal_and_system
    numpy
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
CUDA Compile Environment with VS 2008
상단으로

티스토리툴바