1 / 18

Primeiros Passos em CUDA

Primeiros Passos em CUDA. Divino César S. Lucas Pontifícia Universidade Católica de Goiás - PUC. Instalar o GCC 4.3. sudo mkdir /usr/bin/gcc-4.3 sudo mkdir /usr/bin/g++-4.3 sudo mkdir /usr/bin/g++-4.4 sudo apt-get install gcc-4.3 g++-4.3

edith
Download Presentation

Primeiros Passos em CUDA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Primeiros Passos em CUDA Divino César S. Lucas Pontifícia Universidade Católica de Goiás - PUC

  2. Instalar o GCC 4.3 sudo mkdir /usr/bin/gcc-4.3 sudo mkdir /usr/bin/g++-4.3 sudo mkdir /usr/bin/g++-4.4 sudo apt-get install gcc-4.3 g++-4.3 sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.3 40 –slave /usr/bin/g++ g++ /usr/bin/g++-4.3 sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.4 60 –slave /usr/bin/g++ g++ /usr/bin/g++-4.4 sudo update-alternatives –config gcc

  3. Instalar o Driver Remova o driver: sudo apt-get –purge remove nvidia-* Crie o arquivo/etc/modprobe.d/nvidia-graphics-drivers.confcom o seguinteconteúdo: blacklist vga16fb blacklist nouveau blacklist lbm-nouveau blacklist nvidia-173 blacklist nvidia-96 blacklist nvidia-current blacklist nvidiafb

  4. Instalar o Driver Crieouajuste /etc/X11/xorg.confcom o seguinteconteúdo: Section “Device” Identifier “Device0″ Driver “nvidia” VendorName “NVIDIA Corporation” EndSection Reinicie o computador Instale o Driver: chmod +x NVIDIA-Linux-<versao>.run sudo ./NVIDIA-Linux-<versao>.run Reinicie o computador

  5. Instalar o Toolkit Instale o toolkit: chmod +x  cudatoolkit_3.0_linux_<versao>.run sudo ./cudatoolkit_3.0_linux_<versao>.run Edite o .bashrc #### CUDA Settings #### # Toolkit/SDK export PATH=$PATH:/usr/local/cuda/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib Adicione no arquivo /etc/ld.so.conf /usr/local/cuda/lib sudo ./ldconfig

  6. Instalar o SDK Instale o SDK: chmod +x gpucomputingsdk_3.0_linux.run sudo ./gpucomputingsdk_3.0_linux.run Altere ~/NVIDIA_GPU_Computing_SDK/C/common/commom.mk NVCCFLAGS += --compiler-options -fno-strict-aliasing --compiler-options -fno-inline Dependências do SDK: sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev mesa-commondev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxmu-dev freeglut3 libmotif3 sudo ln -s /usr/lib/libglut.so.3 /usr/lib/libglut.so sudo ln -s /usr/lib/libXm.so.6 /usr/lib/libXm.so sudo rm /usr/lib/libGL.so sudo ln -s /usr/lib/libGL.so.1 /usr/lib/libGL.so

  7. Rodando os exemplos do SDK Compilandoosexemplos do SDK: cd <diretório do usuário>/NVIDIA_GPU_Computing_SDK/C Make Executarosexemplos: cd bin/linux/release ./fluidsGL ./particles

  8. Criando um Novo Projeto • Crie um novo projeto: • Cd ~/NVIDIA_GPU_Computing_SDK/C/srccp –R template/ novoProjeto/cd novoProjeto/mv template.cu novoProjeto.curmtemplate_kernel.curmtemplate_gold.cpp

  9. Criando um Novo Projeto • Altere o Makefile: • # Add source files hereEXECUTABLE := novoProjeto# CUDA source files (compiled with cudacc)CUFILES := novoProjeto.cu# CUDA dependency filesCU_DEPS := # C/C++ source files (compiled with gcc/g++)CCFILES = := • Include ../../common/common.mk

  10. Criando um Novo Projeto novoProjeto.cu

  11. Criando um Novo Projeto

  12. Usando o Visual Profiler • Execute o profiler: • mkdirprofilercd /usr/local/cuda/cudaprof/bin./cudaproof & • Crie um novo projeto: • File -> NewnovoProjeto ~/NVIDIA_GPU_Computing_SDK/C/src/novoProjeto/profiler • Session • Launch = "~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release/novoProjeto" W. Dir = ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release • Profiler Counters • Selecione "Select All Counters" clique em "start"

  13. Usando o Visual Profiler

  14. Usando o Visual Profiler

  15. Usando o Visual Profiler

  16. Usando o Visual Profiler

  17. Usando o Visual Profiler

  18. Usando o Visual Profiler

More Related