[CUDA] CUDA 學習筆記


  1. 安裝
    http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions
     
      一定要記得最後一步的
    export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
    每次開機都要執行
    或者是直接修改
    The PATH variable needs to include your cuda /bin directory (by default it is /usr/local/cuda-6.5/bin)
    On Ubuntu you can edit the. bashrc file on your $HOME directory, adding the following;
    export PATH=/usr/local/cuda-6.5/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:$LD_LIBRARY_PATH
    If you are running a 32-bit Ubuntu version, then the paths are:
    export PATH=/usr/local/cuda-6.5/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib:$LD_LIBRARY_PATH
    After editing the bashrc file, source it (or simply restart the terminal):
    source ~/.bashrc
    Of course, if you have changed the default location of your CUDA directory you must change the PATHS accordingly.
    PLUS: there are another options to tell the system where to find a library, a program, etc. like using enviromental modules, specify the complete path to the libraries and programs manually are another options. There are many methods out there!
  2. 學習資源
    [PTT] [分享] CUDA 程式設計(10)
    a5000ml 系列文章
    https://www.ptt.cc/bbs/C_and_CPP/M.1227708346.A.7B4.html
    https://goo.gl/JeY9oa


編譯方式有兩種
 1. 修改MAKEFILE       2. nvcc main.cu -o main
Instruction to run deciveQuery:
1. copy folder /usr/local/cuda/sample/1_Utilities/deviceQuery to directory with writting permission (such as home)
2. Modify Makefile
 line 147: modify to "INCLUDES := -I /usr/local/cuda/samples/common/inc"
 line 200,201,208: comment out
3. make, everything should be OK

To compile your code, please modify targets and dependency in line 195,198,204,207 of this Makefile.
If you have any problem, please contact TA.
https://drive.google.com/open?id=0B59WkwNQJGvORHZ5OS1KQ1JUNU0

使用aws
$0.650 per On Demand Linux g2.2xlarge Instance Hour
$0.9 per On Demand Linux p2.xlarge Instance Hour
各6小時 共噴了 $9.30

留言

這個網誌中的熱門文章

[已解決] 完美解決 iPhone6 iOS8 wifi 斷線問題

【詳解】台大轉學考考古題詳解 98年微積分C 解答