Compile OpenCV 4.5.2 dengan Cuda dan CuDNN pada Ubuntu 20.04

Pre-Requirement Diasumsikan setiap pengguna panduan ini sudah mahir menggunakan komputer, dan browsing internet, serta unduh unduh file dari internet. Lebih khusus lagi, karena kita menggunakan ubuntu, maka kemampuan mengoperasikan terminal di linux juga sudah menjadi hal yg minimal bisa. PC Sebagai starting point, tentu kita membutuhkan PC untuk melakukan ini semua. Kali ini spesifikasi PC yang saya gunakan adalah sebagai berikut : •    Intel Core i7 6th generation •    RAM 32 GB •    Nvidia GForce 745 2GB •    Dan standard power supply. Tidak ada detail kebutuhan khusus untuk PC yang digunakan dalam kegiatan ini, hanya saja satu hal yang musti kita miliki adalah kartu grafis NVIDIA yang sudah support CUDA. Hal ini dapat di cek di situs resmi NVIDIA ( kasih link ). Untuk spesifikasi tentang kemampuan komputasi antara prosesor dan graphic card adalah sebagai berikut   Operating System Untuk system operasi yang saya gunakan...

Install CUDA on Ubuntu 18.04


This is my first post for my daily notes about my machine learning activity. I plan to put a machine learning system inside my laptop. My first objective is to put CUDA engine into this laptop because it already has NVIDIA Graphic Card which is 960 series. For the reference, I would like to use an article from pysearch image blog that in my perspective it is very clear and really specific. 

Installing CUDA dependency for Ubuntu.
we need to make sure that our system is up to date
$ sudo apt-get update
$ sudo apt-get upgrade

And then we have to install all dependency based on this blog

$ sudo apt-get install build-essential cmake git unzip pkg-config
$ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-0
$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
$ sudo apt-get install libxvidcore-dev libx264-dev
$ sudo apt-get install libgtk-3-dev
$ sudo apt-get install libhdf5-serial-dev graphviz
$ sudo apt-get install libopenblas-dev libatlas-base-dev gfortran
$ sudo apt-get install python-tk python3-tk python-imaging-tk

We will use python for coding in the future, so we will have to install this

$ sudo apt-get install python2.7-dev python3-dev

This step is to prepare when we want to switch to NVIDIA-CUDA for default driver

$ sudo apt-get install linux-image-generic linux-image-extra-virtual
$ sudo apt-get install linux-source linux-headers-generic



INSTALL CUDA TOOLKIT
Let us check up first for the CUDA compatibility on this wikipedia page. My GPU is 960M which is using maxwell micro-architecture that supported by CUDA 9 SDK. So I decide to download CUDA SDK from NVIDIA web pages .

For the first CUDA 9.2 is using Nvidia 396 driver, so we need to install this driver and activate before we continue to install Cuda 9.2 


For ubuntu 18.04, you cannot install nvidia 396 using command line, you need to set that using Software and Update GUI



Please use the local runfile. In my case when we are using the local deb, it would be automatically asked your system to install and switch your device driver into nvidia 396.37. But unfortunately, this driver is only available for Tesla GPU not for G-Force. 

Next Follow this instruction

sudo sh cuda_9.2.88_396.26_linux.run

After executing the above command, you'll see the EULA ( you can skip with Ctrl-C )

You are attempting to install on an unsupported configuration. Do you wish to continue?
(y)es/(n)o [ default is no ]: y

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 396.37?
(y)es/(n)o/(q)uit: n

Install the CUDA 9.2 Toolkit?
(y)es/(n)o/(q)uit: y

Enter Toolkit Location
 [ default is /usr/local/cuda-9.2 ]:

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y

Install the CUDA 9.2 Samples?
(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location
 [ default is /home/kinghorn ]: /usr/local/cuda-9.2
Also don't forget to install the update patch


Komentar

Postingan populer dari blog ini

Compile OpenCV 4.5.2 dengan Cuda dan CuDNN pada Ubuntu 20.04

Akses Remote Server Jupyter dengan Anydesk