Ubuntu 16.04 configures cuda4.0 and compiles cuda4.0_ SDK

Time:2021-6-7

Installing gcc-4.4 and G + + – 4.4

If VIM is not installed, you can use GEDIT

sudo vim /etc/apt/sources.list 
sudo gedit /etc/apt/sources.list

Add at the end of the file:

deb [URL] trusty main universe
deb [URL] trusty-updates main universe

[url] represents your source address. For example, my system source address is main server, so add:

deb http://archive.ubuntu.com/ubuntu/ trusty main universe
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main universe

Then update the system source and install gcc-4.4 and G + + – 4.4

sudo apt-get update
sudo apt-get install g++-4.4

Command to install G + + – 4.4 automatically installs gcc-4.4 by default, and there is no need to install gcc-4.4.

Switch GCC version

Please refer to another article:GCC multi version switch

Dependent package installation

sudo apt-get install git-core build-essential xutils-dev bison zlib1g-dev flex libglu1-mesa-dev libxi-dev libxmu-dev freeglut3-dev binutils libboost-system-dev libboost-filesystem-dev libopenmpi-dev openmpi-bin  gfortran libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev libboost-all-dev libopenblas-dev liblapack-dev libatlas-base-dev libgoogle-glog-dev liblmdb-dev cmake libgles2-mesa-dev

Cuda4.0 and cuda4.0_ SDK Download

CUDA version download address

Cuda4.0 and cuda4.0_ SDK installation

To add executable permissions to the installation package:

sudo chmod +x cudatoolkit_4.0.*
sudo chmod +x gpucomputingsdk_4.0.*

Install cuda4.0 and cuda4.0_ SDK (installation path can be changed according to your own needs)

sudo ./cudatoolkit_4.0.17_linux_64_ubuntu10.10.run
sudo ./gpucomputingsdk_4.0.17_linux.run

Configure environment variables

Open the ~ /. Bashrc file and add the following at the end of the file:

sudo vi ~/.bashrc
export CUDA_INSTALL_PATH=/usr/local/cuda
export NVIDIA_CUDA_SDK_LOCATION=~/NVIDIA_GPU_Computing_SDK
export LD_LIBRARY_PATH=$CUDA_INSTALL_PATH/lib64

export PATH=$CUDA_INSTALL_PATH/bin:$PATH

Compiling cuda4.0_ SDK

cd ~
sudo chmod -R 777 NVIDIA_GPU_Computing_SDK/
cd NVIDIA_GPU_Computing_SDK/
sudo make

This work adoptsCC agreementReprint must indicate the author and the link of this article