LInux CUDA Environment Configuration

Source: Internet
Author: User
Tags cuda toolkit
1. Install Toolkit
(1) cd/home/cuda_train/software/cuda4.1
(2)./cudatoolkit_4.1.28_linux_64_rhel6.x.run
Specify the installation directory
(3) Configure CUDA Toolkit environment variables
(a) Vim ~/.BASHRC
(b) Add the following line to add the path to the Cuda bin to the environment variable path
Export path= $PATH:/usr/local/cuda/bin
(c) Add the following line to add Cuda/lib and cuda/lib64 paths to environment variables Ld_library_path
Export Ld_library_path= $LD _library_path:/usr/local/cuda/lib:/usr/local/cuda/lib64
(d) Make configuration effective
SOURCE ~/.BASHRC

2. Install Cuda SDK
(1) cd/home/cuda_train/software/cuda4.1
(2)./gpucomputingsdk_4.1.28_linux.run
During installation, you need to specify the installation directory and enter the CUDA Toolkit installation directory
(3) Compiling the SDK sample program
Suppose the SDK installation directory is $ (CUDA_SDK) =~/nvidia_gpu_computing_sdk/
(a) before compiling the SDK routines, the Sir becomes a static library
Enter $ (CUDA_SDK)/shared directory, execute make, build libshrutil_x86_64.a
Enter $ (CUDA_SDK)/c/common, execute make, build libcutil_x86_64.a
(b) Compiling the SDK sample program
Sample program source code in the $ (CUDA_SDK)/C/SRC directory, compiled the successful executable file in the $ (CUDA_SDK)/c/bin directory.
Take Devicequery as an example:
Enter $ (CUDA_SDK)/c/src/devicequery directory, execute make compilation
Enter $ (CUDA_SDK)/c/bin/linux/release directory, execute./devicequery Run
To recompile, you can perform make clean; Make
Related Article

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.