Installation of OpenCL for NVIDIA to support GPU parallel computing on Ubuntu

 Part of the content comes from the link: http://www.thebigblob.com/getting-started-with-opencl-and-gpu-computing/

Hardware: NVIDIA GTX650
OS: Ubuntu 12.04

1. Install the NVIDIA CUDA Toolkit and Display Driver
*Download the cuda_5.0.35_linux_64_ubuntu11.10-1.run from https://developer.nvidia.com/cuda-downloads or https://developer.nvidia.com/cuda-toolkit
*run the script at the directory where you store the above file: sudo .sh ./cuda_5.0.35_linux_64_ubuntu11.10-1.run.
This script will install 3 items for you:
a. CUDA toolkit
b. CUDA Samples
c. NVIDIA Display Driver
It is always needed to stop the X server to allow the NVIDIA display driver to be installed, by this command:
sudo stop lightdm
You may also meet the failure that the Smaples can not be installed, due to missing required libraries. The log file will tell you that “Missing the required library libglut.so”. To solve this problem, you need to do:
. sudo apt-get install freeglut3
. sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
* After all the libs are installed, specify the PATH and LD_LIBRARY_PATH in ~/.bashrc by adding:
export PATH=$PATH:/usr/local/cuda-5.0/bin:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-5.0/lib:/usr/local/cuda/lib
* Enter the ~/NVIDIA_CUDA-5.0_Samples to build the samples:
sudo make

2. Install the NVIDIA GPU Computing SDK
Download the Computint SDK http://developer.download.nvidia.com/compute/cuda/4_0/sdk/gpucomputingsdk_4.0.17_linux.run from this website https://developer.nvidia.com/cuda-toolkit-40 as the previous sample does not have the OpenCL directory.
You can see the ~/NVIDIA_GPU_Computing_SDK directory and enter the OpenCL / to make

3. Verify the installation by the vector addition example
NOTE!!!! restart the computer before you verify.
cd ~/NVIDIA_GPU_Computing_SDK/OpenCL/bin/linux/release to run
sudo ./oclDeviceQuery
If successfully passed, you can go ahead with your OpenCL on NVIDIA.

An example of vector addition can be used as your first exercise (see the attachment):
gcc -c -Wall -I /usr/local/cuda-5.0/include openclex.cc -o main.o
gcc main.o -o host -L /usr/local/cuda-5.0/lib64 -l OpenCL
Problem Solving:
1. Can not build some of the samples:
sudo apt-get install libxi-dev libxmu-dev
2. clgetplatformids return 1001 when running ./oclDeviceQuery:
restart the computer
or check the /ect/OpenCL/ to see if the .icd file exists, if not, reinstall the NVIDIA driver by sudo apt-get install nvidia-current, and reinstall the CUDA toolkit

Advertisements
Posted in Linux Issues and solutions backup, Parallel Computing, Software Defined Radio | Leave a comment

High Performance Computing References

CUDA full tutorial.

http://www.drdobbs.com/parallel/cuda-supercomputing-for-the-masses-part/207200659

Posted in Draft | Leave a comment

SIMD instructions references.

The information is coming from http://www.g-truc.net/post-0359.html

Instruction sets intrinsic per headers: (/usr/lib/gcc/x86_64-linux-gnu/4.6.3/include)

  • x86intrin.h: x86 instructions
  • mmintrin.h: MMX (Pentium MMX!)
  • mm3dnow.h: 3dnow! (K6-2) (deprecated)
  • xmmintrin.h: SSE + MMX (Pentium 3, Athlon XP)
  • emmintrin.h: SSE2 + SSE + MMX (Pentiuem 4, Ahtlon 64)
  • pmmintrin.h: SSE3 + SSE2 + SSE + MMX (Pentium 4 Prescott, Ahtlon 64 San Diego)
  • tmmintrin.h: SSSE3 + SSE3 + SSE2 + SSE + MMX (Core 2, Bulldozer)
  • popcntintrin.h: POPCNT (Core i7, Phenom subset of SSE4.2 and SSE4A)
  • ammintrin.h: SSE4A + SSE3 + SSE2 + SSE + MMX (Phenom)
  • smmintrin.h: SSE4_1 + SSSE3 + SSE3 + SSE2 + SSE + MMX (Core i7, Bulldozer)
  • nmmintrin.h: SSE4_2 + SSE4_1 + SSSE3 + SSE3 + SSE2 + SSE + MMX (Core i7, Bulldozer)
  • wmmintrin.h: AES (Core i7 Westmere, Bulldozer)
  • immintrin.h: AVX, SSE4_2 + SSE4_1 + SSSE3 + SSE3 + SSE2 + SSE + MMX (Core i7 Sandy Bridge, Bulldozer)

The links for intrinsics, manuals include:

Posted in Draft | Leave a comment

How to edit the ethernet connection in command line at Ubuntu

sudo vi /etc/network/interfaces

Update the file content.

 

## To configure a dynamic IP address
auto eth0
iface eth0 inet dhcp

## Or configure a static IP
auto eth0
iface eth0 inet static
  address 192.168.1.14
  gateway 192.168.1.1
  netmask 255.255.255.0
  network 192.168.1.0
  broadcast 192.168.1.255

For these settings to take effect you need to restart your networking services.

sudo /etc/init.d/networking restart
Posted in Draft | Leave a comment

Access remote computer via hostname through DHCP server.

ssh cri-node-6.ch.dhcp.tntech.edu

Posted in Draft | 1 Comment

Failed to login Ubuntu 12.04 after update or reboot

sudo rm /home/username/.Xauthority*
sudo apt-get install --reinstall xorg
sudo reboot
Posted in Draft | Leave a comment

Latex tool in Ubuntu

It is very easy to setup the latex editing environment in Ubuntu.

Firstly, you need to install the full texlive:

sudo apt-get install texlive-full

Then, install the editior: Kile.

sudo apt-get install kile

That’s all, very simple, unlike in windows which requires a lot of libraries.

In Kile, if you want to do spelling check, just press shift+ctrl+o.

Posted in Linux Issues and solutions backup, Tech | Leave a comment