Installation of the CUDA OpenCL on the Ubuntu

[CS/OpenCL]
This is how to install CUDA OpenCL on the Ubuntu.
I experience on my computer, ubuntu 9.04 and the graphic card is the NVIDIA 9600GT.
If you want to use CUDA openCL, please check your graphic card that supports GPGPU programming.
I know that version of kernel must be 2.6 distribution. Maybe after ubuntu 8.10, kernel version is larger than 2.6

This post is based on the CUDA OpenCL tutorial "OpenCL for NVIDIA GPUs" supported by NVIDIA.
You can get the tutorial from NVIDIA homepage.
Actually, I think this is very similar with the tutorial. However, I write some minor problem and the answer not in the tutorial...
And most of all, I'm korean...so my english is not well..so I hope that you can understand the semantic of the post.
And now, to install CUDA openCL, you must check your system.

First, verify the system has a CUDA-capable GPU.
In NVIDIA CUDA Web site, "http://www.nvidia.com/object/cuda_learn_products.html"

And gcc OpenCL support gcc version 3.4 as well as 4.x.
Type the following on the command to know the gcc version.

$gcc --version

If you have gcc or show the error message from the command, you must install the development tools such as build-essential and libraries.

Now, download the NVIDIA driver. As you know, in the linux, setting graphic driver has many problem.
I also took a problem. During install NVIDIA driver, my x window is broken. I wasted a lot of time to solve this problem. However, the answer is very simple-_-;;;

Download the NVIDIA driver from "http://developer.nvidia.com/object/opencl-download.html#Linux".
You must download NVIDIA Drivers for Linux, and GPU Computing SDK code samples and more.
And, must check your computer's driver, maybe verison of the NVIDIA driver is lower than 190.*.
For using CUDA OpenCL, must re-install driver download from above web page.

Before install NVIDIA driver, please get rid of old NVIDIA installations. Because new verison of driver will come into conflict with old version. So you can see the this messages when you want to start x.

"Error: API mismatch: the NVIDIA kernel module has version 180.44,
but this NVIDIA driver component has version 190.36. Please make
sure that the kernel module and all NVIDIA driver components
have the same version."

So that, if you want to meet the above message, follow these.
In X, "Ctrl+Alt+F1" , go to tty1, and then type

$nvidia-installer --uninstall
$apt-get remove --perge nvidia*

#stop xserver
$/etc/init.d/gdm stop

#make driver file executable
$chmod +x nvdrivers_2.3_linux_64_190.29.run

#execute
$./nvdrivers_2.3_linux_64_190.29.run

#restart xserver
$/etc/init.d/gdm start
$startx

#validate the version of NVIDIA driver
Execute terminal in X window, command line, run
$/usr/bin/nvidia-settings

You can see the version of driver is 190.*.

Finally, install GPU Computing SDK, if you follow these step and clear, installation of SDK is very easy...;;;;
Just type this command;;

$chmod +x gpucomputingsdk_2.3b_linux.run
$./gpucomputingsdk_2.3b_linux.run

The default path is /{HOME_DIR}/NVIDIA_GPU_Computing_SDK/
In there, you verify the installation.
In {default path}/OpenCL/, type make.

If you meet with the library link error (maybe, /usr/bin/ld:cannot find -lglut"), type like this.

$ls /usr/lib64 |grep glut

It will display "libglut.so.3  libglut.so.3.8.0"
$ln -s /usr/lib64/libglut.so.3 /usr/lib64/libglut.so

Now, all program in OpenCL folder, you excute in {default path}/OpenCL/bin/linux/release/~~~.
There are many programs. You choose one program, and run.

Now, you can enjoy the CUDA OpenCL, good luck to you.


Reference : Getting started OpenCL for NVIDIA GPUs Installation and Verification On Linux
                   (Oct. 5, 2009)
TAG. , ,

이 글의 트랙백 주소 :: http://kuls.net/~bluesks/tt/trackback/50

::: 사람과 사람의 교감! 人터넷의 첫 시작! 댓글을 달아주세요! :::

  1. Omar [2010/03/27 19:36]  [댓글주소]  [수정/삭제]  [댓글쓰기]

    when I type nvidia-installer --uninstall in tty1, (nvidia-installer command not found) error appears.

    • 이카도르 [2010/04/01 15:43]  [댓글주소]  [수정/삭제]

      check whether your computer has nvidia driver. If you don't have driver, maybe nvidia-installer cannot be founded. This process is to remove nvidia driver clearly

  2. Omar [2010/03/27 19:36]  [댓글주소]  [수정/삭제]  [댓글쓰기]

    when I type nvidia-installer --uninstall in tty1, (nvidia-installer command not found) error appears.