Cuda (8.0) project using Eclipse Nsight on Ubuntu (18)

Graphics Card: NVidia GTX 1080 (Compute compatibility 6.1)


[ Installation ]

  • Nvidia Cuda 8.0 supports gcc compiler verion below 5.0
  • gcc-4.9
    • https://stackoverflow.com/questions/48398475/fail-to-install-gcc-4-9-in-ubuntu17-04
    • mkdir ~/Downloads/gcc-4.9-deb && cd ~/Downloads/gcc-4.9-debwget http://launchpadlibrarian.net/247707088/libmpfr4_3.1.4-1_amd64.deb
      wget http://launchpadlibrarian.net/253728424/libasan1_4.9.3-13ubuntu2_amd64.deb
      wget http://launchpadlibrarian.net/253728426/libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb
      wget http://launchpadlibrarian.net/253728314/gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb
      wget http://launchpadlibrarian.net/253728399/cpp-4.9_4.9.3-13ubuntu2_amd64.deb
      wget http://launchpadlibrarian.net/253728404/gcc-4.9_4.9.3-13ubuntu2_amd64.deb
      wget http://launchpadlibrarian.net/253728432/libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb
      wget http://launchpadlibrarian.net/253728401/g++-4.9_4.9.3-13ubuntu2_amd64.debsudo dpkg -i gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb
      sudo dpkg -i libmpfr4_3.1.4-1_amd64.deb
      sudo dpkg -i libasan1_4.9.3-13ubuntu2_amd64.deb
      sudo dpkg -i libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb
      sudo dpkg -i cpp-4.9_4.9.3-13ubuntu2_amd64.deb
      sudo dpkg -i gcc-4.9_4.9.3-13ubuntu2_amd64.deb
      sudo dpkg -i libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb
      sudo dpkg -i g++-4.9_4.9.3-13ubuntu2_amd64.deb
  • gcc-6.0 (cuda9.2)
    • sudo apt-get update && \ sudo apt-get install build-essential software-properties-common -y && \ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ sudo apt-get update && \ sudo apt-get install gcc-6 g++-6 -y && \ sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-6 60 –slave /usr/bin/g++ g++ /usr/bin/g++-6 && \ gcc -v

[ Create Project ]

  1. Cuda C/C++ Project
    • Static Library > Empty Project
    • Toolchain: CUDA Toolkit 8.0
  2. Comput compatibility: 6.1 (PTX/GPU)
  3. Finish

[ Properties ] (Build > Settings > Tool Setting)

  1. NVCC Compiler
    1. Symbols: Update Defintion
    2. Includes:
      1. /usr/local/cuda/include/
      2. /usr/local/cuda/samples/common/inc/
    3. Optimization: -use_fast_math
    4. Code Generation: -std=c++1
    5. Build Stages: -ccbin=/usr/bin/gcc-4.9
  2. NVCC Linker (not shown always, why?)
    1. Libraries
      1. CUDA Runtime Library: Static
    2. Miscellaneous
      1. -ccbin=/usr/bin/gcc-4.9
      2. -shared
      3. Link with OpenGL libraries

 

still updating

 

 

 

 

Leave a Reply