Optimus + CUDA in Fedora 20

Recent laptops mostly come with hybrid-graphics system (two GPUs in one machine: an integrated GPU and a discrete GPU). It was first designed to control power consumption in laptops. By default, the operating system will use the integrated GPU which is less power consumption. Only when heavy activities (gaming, graphic rendering, GPU computing, etc) are performed, then operating system will move the workload to the discrete GPU.

For laptop with NVIDIA GPU, there is NVIDIA Optimus Technology for auto-switching between integrated GPU and discrete GPU. Unfortunately, NVIDIA support for this technology in Linux is not as good as in Windows. Since discrete GPU is a secondary card, installing the driver for NVIDIA GPU is not easy and may cause problem with the display manager in Linux. Continue reading

“workspace in use or cannot be created” in eclipse or nvidia nsight

– remove .lock file in workspace’s metadata folder.
rm {YourWorkspaceDir}/.metadata/.lock

– find out the RECENT_WORKSPACES attribute
cd ~/.eclipse
grep -r "RECENT_WORKSPACES" *

– once you got the file where the RECENT_WORKSPACES attribute exists, edit that file by removing the RECENT_WORKSPACES line.

OpenCL di Smartphone

ah, gw telat update dengan berita ini.. ini berkaitan dengan postingan lama,.. komputasi parallel di smartphone..

dan ternyata diem-diem Google sempat menyisipkan OpenCL drivers ke smartphone Nexus 4 dan tablet Nexus 10 di awal tahun ini.. hal ini dilaporkan oleh Kishonti Ltd. setelah mereka berhasil menjalankan CLBenchmark di tablet Nexus 10 (Mali GPU T-604)..

tapi kemudian tercium aroma ketidaksehatan di sini.. tampaknya Google merasa gengsi menggunakan OpenCL.. meskipun sekarang di-“maintain” oleh Khronos Group dan bersifat terbuka, bagaimanapun ide dan pengembangan awal OpenCL berasal dari Apple.. mungkin saja Google merasa risih ada aroma Apple di produknya..

dan bener saja, di update-an firmware untuk Nexus 4 dan Nexus 10 yang rilis agustus lalu.. Google menghapus OpenCL driver dari firmware.. ish ish ish.. sungguh tak dewasa..  [emoji angry face]

sebenarnya Google telah merilis sebuah framework untuk komputasi di Android buatan mereka sendiri, yang diberi nama “RenderScript“.. sama halnya seperti OpenCL, RenderScript juga bersifat cross-platform, mampu memanfaatkan sumber daya komputasi yang tersedia di smartphone (CPU, GPU, DSP).. akan tetapi, tindakan Google menghapus OpenCL driver terkesan “memaksa” Android developer untuk menggunakan RenderScript buatan mereka ketimbang OpenCL… hal ini jadi perdebatan seru di sini..

syukurnya, Qualcomm sebagai produsen mobile processor, tetap terus berusaha mengembangkan OpenCL driver untuk produknya.. dan kabarnya sudah berhasil untuk Snapdragon 600 (Adreno 320 GPU) dan Snapdragon 800 (Adreno 330 GPU)..

ah, ingin segera mencicipi supercomputing di smarphone.. mudah-mudahan segera ada rezeki buat punya Android smartphone dengan Snapdragon 800 di dalamnya.. jadi bisa mencicipi OpenCL dan RenderScript sekaligus.. doain yah..  [emoji grinning face]

lalu bagaimana dengan CUDA ? kabarnya akhir tahun ini NVIDIA akan merilis Tegra 5 yang konon akan support CUDA.. tampaknya era “smartphone computing” akan dimulai tahun depan.. interesting !!  [emoji smirking face]

[ WeekendProjects ] Python and GPU

Wiken kali ini pengen nyobain gimana menggunakan python untuk gpu programming.. ga sampe terlalu detil, cuma instalasi dan running sample codenya doank.. yang penting link-link pentingnya sudah diamankan.. [emoji grinning face with smiling eyes]

1. PyCUDA = python + cuda

Download: pypi/pycuda
Instalasi: PyCuda/Installation
Dokumentasi: documen.tician.de/pycuda/

2. PyOpenCL = python + opencl

Download: pypi/pyopencl
Instalasi: PyOpenCL/Installation
Dokumentasi: documen.tician.de/pyopencl/

Untuk sementara itu dulu.. kalau ada kesempatan dan mood, kita lanjut lagi..  [emoji grinning face with smiling eyes]

installing OpenCV with GPU modul in Mac

I was trying to install OpenCV 2.4.5 with GPU modul in Mac OSX Mountain Lion (10.8.4) but got some errors. Trying to find solution through Google, but didn’t get much information. Finally, after couple hours, I got the idea, it’s coming from several sources, so I just collect them here to help others who may need this.

Follow instructions in OpenCV_GPU

  1. Download and extract the source.
  2. Use Terminal, and create Build folder
  3. Use CMAKE GUI to configure
  4. Use Terminal and go to Build folder, then type make to compile
  5. Type sudo make install to install

And then, you may get this error :

[ 16%] Building NVCC (Device) object modules/ ... /cuda_compile_generated_matrix_
operations.cu.o
cc1plus: error: unrecognized command line option "-Wno-narrowing"
cc1plus: error: unrecognized command line option "-Wno-delete-non-virtual-dtor"
cc1plus: error: unrecognized command line option "-Wno-unnamed-type-template-args"

Solution : Actually, it’s because in Mac use llvm-gcc compiler. So, you have to download the “TRUE” gcc compiler via MacPort. If you don’t have MacPort yet, don’t be lazy, just Google-ing how to install it. 😀 I use gcc 4.6.4, but you can try the latest one if you already have.

sudo port install gcc46

By default, anything you’ve installed via MacPort will go to /opt/local/bin/. So, you have to make a symbolic link to gcc in /usr/bin

#> sudo unlink /usr/bin/gcc
#> sudo ln -s /opt/local/bin/x86_64-apple-darwin12-gcc-4.6.4 /usr/bin/gcc

and try to compile again.


If you get error like this.

Undefined symbols for architecture x86_64:
"std::ctype<char>::_M_widen_init() const", referenced from:
stdDebugOutput(cv::String const&) in cuda_compile_generated_NCV.cu.o
ld: symbol(s) not found for architecture x86_64

Keep calm, and follow solution below. 😀

Solution : You need to set “-fno-inline” flag in CMAKE_CXX_FLAGS. Open your CMAKE GUI, put a checklist in “Advanced“, you’ll see CMAKE_CXX_FLAGS attribute name.

It should be okay, now ! 🙂

installing cuda 5 on ubuntu 12.04

  1. Download CUDA 5 installers from https://developer.nvidia.com/cuda-downloads.
  2. Add execution mode to the run file.
    • $ chmod +x cuda_5.*.run
  3. Change to terminal mode Ctrl-Alt-F1, log on and type
    • $ sudo service lightdm stop
    • $ sudo ./cuda_5.*.run
    • $ sudo shutdown -r now

If you failed to get back to login gui, type this:

  • $ sudo apt-get purge nvidia*
  • $ sudo apt-get install nvidia-current-updates-dev