Getting started with GPU programming to Master (a) CUDA environment installation __cuda

Source: Internet
Author: User


Bo Master due to the needs of the work, began to learn the GPU above the programming, mainly related to the GPU based on the depth of knowledge, in view of the previous did not contact GPU programming, so here specifically to learn the GPU above programming. Have like-minded small partners, welcome to exchange and study, my email: caijinping220@gmail.com. Using the Geforce 103m graphics card on his old notebook, although the graphics card is already very weak relative to the current mainstream series, it is still available for learning. This series of posts also follows the process of documenting your learning from simplicity to complexity.
0. Directory GPU Programming primer to Proficient (i) CUDA environment installation GPU Programming primer to Proficient (ii) running the first program GPU programming to Master (iii) the first GPU program to master GPU programming to Proficient (iv) GPU program excellent The introduction of GPU programming to proficient (v) GPU Program optimization Advanced 1. New characteristics of CUDA-5.5

--Dynamic parallel (dynamical Parallelism): A new GPU acceleration algorithm

GPU threads can dynamically derive new threads to better accommodate data flow.
By maximizing communication with the GPU, dynamic parallel technology can greatly simplify parallel programming,
Let more popular algorithms support GPU acceleration, such as adaptive mesh encryption, computational fluid dynamics, and so on.

--gpu-callable Library: Support for third party ecosystems

The new CUDA BLAS Library allows developers to use dynamic parallelism for their own pu-callable libraries,
such as designing the plug-in API, allowing others to extend the functionality of their kernel, deploying GPU Callback, and customizing the functionality of a Third-party gpu-callable library.
Object linking can compile multiple CUDA source files into different object files and then link to larger applications and libraries, making it easier and more efficient to develop large GPU applications.

--gpudirect support RDMA (Remote Direct Memory Access): Eliminates system memory bottlenecks
Gpudirect Technology establishes the direct communication between the GPU and other pci-e devices, supports the RDMA between the NIC and the GPU, and can greatly reduce the mpisendrecv latency between the GPU nodes in the cluster and improve the overall application performance.

--nvidia nsight Eclipse Edition: Quick and easy generation of GPU code

On Linux, Mac OS X platforms, NVIDIA nsight Eclipse Edition enables developers to develop, debug, and compile GPU applications in a familiar Eclipse IDE environment, with CUDA editors and CUDA examples, to generate faster The CUDA code also integrates expert-level analysis systems, provides automated performance analysis, and wizards to fix performance bottlenecks in code, as well as syntax highlighting for GPU code and CPU code. 2. Operating system Support

CUDA 5 Operating system support includes: Windows XP Desktop, Windows VISTA/7/8 Desktop and notebook, Ubuntu 11.04/11.10, Fedora 16, Red Hat Enterprise Linux 5.x/6.x (the latter only Limited to 64-bit), OpenSUSE 12.1 (64-bit), SUSE Server-sp1/sp2, Mac OS X. 3. Installation Environment detection 3.1. Check if your computer has a GPU that supports CUDA

You can use the following command:

Lspci | Grep-i nvidia

By running the above command, you get the following results:

01:00.0 VGA compatible Controller:nvidia Corporation g98m [GeForce G 103M] (rev A1)

By command, I learned that my notebook is a GPU of the GeForce G 103M model.
Go to the link below to see if your GPU model supports CUDA.
Website link 3.2. Download installation package

CUDA-5.5 installation package Download address

After entering the following download interface, has now come out CUDA-6.5, we just find their own corresponding installation package can, here depending on their respective circumstances, choose their own.

My system is ubuntu12.04 32-bit, so choose to download Ubuntu 12.04 below 32-bit RUN on it, 600m+ 4. CUDA-5.5 installation 4.1. Software Installation

Install the Build-essential installation package to ensure the installation of GCC required for cuda and graphics drivers

Apt-get Install Build-essential

Exit the graphical interface and enter the console

/ETC/INIT.D/LIGHTDM stop

Press "Ctrl" + "alt" + "F1" to enter the console interface and run the following command

sudo sh cuda_5.5.22_linux_32.run

In this process, the beginning will come out a document, relatively long, you can press the button "Q" To exit the document, and then enter "accept" can be installed, has been confirmed, the default installation can, the middle will choose the driver file directory. 4.2. Environment variable Configuration

Add the following statement under/etc/profile:

Export path= $PATH:/usr/local/cuda-5.5/bin
export ld_library_path= $LD _library_path:/usr/local/cuda-5.5/lib

Make the environment variable effective by running the following command:

Source/etc/profile
4.3. Exit the console

Start the LIGHTDM service

Service LIGHTDM Start
5. Compile Sample

Directly run make to compile the samples inside the program

Randomly looking for an example to run as follows:


about the installation of CUDA, introduced here, the follow-up will be concerned about the specific aspects of CUDA programming.
Welcome to discuss and learn about GPU programming with me.
Caijinping220@gmail.com
Http://blog.csdn.net/xsc_c

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.