MULTITASKING DENGAN MENGGUNAKAN NVIDIA CUDA oleh Agustinus Ardiyan Abi Ravinda NIM : 622009010
Skripsi Untuk melengkapi salah satu syarat memperoleh Gelar Sarjana Teknik Program Studi Sistem Komputer Fakultas Teknik Elektronika dan Komputer Universitas Kristen Satya Wacana Salatiga 2015
INTISARI
CUDA computing adalah komputasi yang memanfaatkan sumber daya dari GPU yang di paralel dengan dengan CPU untuk meningkatakn kinerja dari pemrosesan data. Skripsi ini merupakan implementasi dari skripsi sebelumnya yang berupa modul dengan menggunakan sejumlah input data dan akan dibandingkan dengan metode single computing menggunakan CPU dan metode cluster computing yang menggunakan Message Passing Interface (MPI). Metode yang digunakan dalam pengujian, menerapkan beberapa diantaranya perhitungan dengan menggunakan input data integer dan float dengan jumlah data yang bervariasi. Hasil dari pengujian adalah waktu yang didapatkan dari masing – masing metode computing dan dari hasil tersebut bisa dapat di ambil kesimpulan dari CUDA yang dibandingkan dengan metode computing lainnya. Hasil dari perkalian matriks dan eliminasi linier menggunakan metode single computing dan cluster computing dengan input data 5000 x 5000 membutuhkan waktu lebih dari 2.000 detik. Hasil sorting data dan binary search dengan input data berjumlah 9.000.000 data membutuhkan waktu 2.000 ms. Pada saat menggunakan CUDA, waktu yang dibutuhkan untuk memproses jumlah data yang sama dengan perkalian matriks dan eliminasi linier membutuhkan waktu 0,02 milidetik dan untuk hail sorting dan binary search dengan input data berjumlah 9.000.000 membutuhkan waktu 0,02 milidetik.
1
ABSTRACT
CUDA computing is computing that utilizes the resources of the GPU in parallel with the CPU for improving the performance of data processing. This thesis is an implementation of the previous thesis in the form of a module by using a number of data input and will be compared with the sequential method using CPU computing and parallel computing methods that use the Message Passing Interface (MPI). The method used in testing, implementing some of which calculations using data input integer and float with the amount of data varies. The results of the testing are obtained from the respective time - each computing method and the conclusion can be taken from the CUDA results that compared with other methods of computing. The results of the matrix multiplication and linear elimination method computing and cluster computing single data input 5000 x 5000 took more than 2.000 seconds. The results of the data sorting and binary search with the data input of data has a numbered 9.000.000 took more than 2.000 ms. When using CUDA, the time required to process the same amount of data with matrix multiplication and linear elimination takes 0.02 milliseconds and for sorting and binary search results with the 9,000,000 data input takes 0.02 milliseconds.
2
KATA PENGANTAR
Puji Syukur ke hadirat Tuhan Yang Maha Esa, atas segala berkat dan karunia-Nya sehingga penulis dapat menyelesaikan studi dan skripsi di Fakultas Teknik Elektronika dan Komputer Universitas Kristern Satya Wacana. Penulis ingin mengucapkan terima kasih sebesar-besarnya kepada : 1. Bapak, ibu, keluarga, semua kakak – kakak dan adik – adik yang telah memberikan dukungan materiil dan moril selama penulis menjalani kuliah di FTEK UKSW. 2. Bapak Hartanto K. W selaku pembimbing I. 3. Bapak Darmawan Utomo selaku pembimbing II. 4. Teman-teman FTEK angkatan 2009. 5. Teman-teman Indonesia Driving Simulator yang sudah support. Walaupun masih banyak kekurangan dalam pembuatan skripsi ini, penulis berharap skripsi ini dapat berguna dan dapat disempurnakan. Salatiga, 27 Maret 2015 Penulis,
Agustinus Ardiyan Abi Ravinda
3
DAFTAR ISI
INTISARI .............................................................................................................................................. 1 ABSTRACT ........................................................................................................................................... 2 KATA PENGANTAR.............................................................................................................................. 3 DAFTAR ISI .......................................................................................................................................... 4 DAFTAR GAMBAR ............................................................................................................................... 6 DAFTAR TABEL.................................................................................................................................... 8 DAFTAR SINGKATAN........................................................................................................................... 9 BAB I PENDAHULUAN........................................................................... Error! Bookmark not defined. 1.1.
Tujuan................................................................................... Error! Bookmark not defined.
1.2.
Latar Belakang ...................................................................... Error! Bookmark not defined.
1.3.
Gambaran Sistem ................................................................. Error! Bookmark not defined.
1.4.
Spesifikasi Sistem ................................................................. Error! Bookmark not defined.
1.5.
Sistematika Penulisan .......................................................... Error! Bookmark not defined.
BAB II DASAR TEORI ............................................................................. Error! Bookmark not defined. 2.1.
GPU Computing .................................................................... Error! Bookmark not defined.
2.1.1.
CUDA ............................................................................ Error! Bookmark not defined.
2.1.2.
GPU yang Memiliki Teknologi CUDA ........................... Error! Bookmark not defined.
2.2.
Cluster Computing ............................................................... Error! Bookmark not defined.
2.2.1. 2.3.
MPI ............................................................................... Error! Bookmark not defined.
CPU Computing .................................................................... Error! Bookmark not defined.
BAB III PERANCANGAN ......................................................................... Error! Bookmark not defined. 3.1.
Gambaran Sistem ................................................................. Error! Bookmark not defined.
3.2.
Cara Kerja Sistem ................................................................. Error! Bookmark not defined.
3.2.1.
Setting OpenMPI Pada Visual Studio ........................... Error! Bookmark not defined.
3.2.2.
Setting Nvidia Nsight .................................................... Error! Bookmark not defined.
3.2.3.
Setting Koneksi Cluster ................................................. Error! Bookmark not defined.
BAB IV PENGUJIAN DAN ANALISIS ....................................................... Error! Bookmark not defined. 4.1.
Pengujian pada CPU Computing .......................................... Error! Bookmark not defined.
4.1.1.
Pengujian dengan Integer ............................................ Error! Bookmark not defined.
4.1.2.
Pengujian Dengan Floating Point ................................. Error! Bookmark not defined.
4.2.
Pengujian dengan GPU Computing ...................................... Error! Bookmark not defined.
4
4.2.1.
Pengujian dengan Integer ............................................ Error! Bookmark not defined.
4.2.2.
Pengujian dengan Floating Point ................................. Error! Bookmark not defined.
4.3.
Pengujian dengan MPI ......................................................... Error! Bookmark not defined.
4.3.1.
Pengujian dengan Integer ............................................ Error! Bookmark not defined.
4.3.2.
Pengujian dengan Floating Point ................................. Error! Bookmark not defined.
4.4. Perbandingan Hasil Pengujian dengan Teori Kompleksitas Waktu ... Error! Bookmark not defined. 4.5. Tabel Perbandingan Hasil Pengujian CPU Computing, GPU Computing, dan Cluster Computing ........................................................................................ Error! Bookmark not defined. 4.5.1.
Sorting .......................................................................... Error! Bookmark not defined.
4.5.2.
Binary Search................................................................ Error! Bookmark not defined.
4.5.3.
Perkalian Matriks ......................................................... Error! Bookmark not defined.
4.5.4.
Eliminasi Linier Gauss Jordan ....................................... Error! Bookmark not defined.
BAB V KESIMPULAN DAN SARAN PENGEMBANGAN ........................... Error! Bookmark not defined. 5.1.
Kesimpulan ....................................................................... Error! Bookmark not defined.
5.2.
Saran Pengembangan ...................................................... Error! Bookmark not defined.
DAFTAR PUSTAKA................................................................................. Error! Bookmark not defined. LAMPIRAN A ......................................................................................... Error! Bookmark not defined. LAMPIRAN B ......................................................................................... Error! Bookmark not defined.
5
DAFTAR GAMBAR Gambar 1.1 Flowchart Single Computing........................................................................... 2 Gambar 1.2 Flowchart Cluster Computing......................................................................... 3 Gambar 1.3 Flowchart CUDA Computing.......................................................................... 4 Gambar 3.1 Skema CPU Computing.................................................................................. 15 Gambar 3.2 Skema Cluster Computing.............................................................................. 15 Gambar 3.3 Skema GPU Computing.................................................................................. 16 Gambar 3.4 Additional Include Directories...................................................................... 16 Gambar 3.5 Additional Library Directories....................................................................... 17 Gambar 3.6 Additional Dependencies................................................................................ 17 Gambar 3.7 Summary NVIDIA Installer setelah installing Toolkit................................... 18 Gambar 3.8 Pencarian Code Samples untuk uji coba GPU................................................ 19 Gambar 3.9 Smoke screen code samples............................................................................ 19 Gambar 3.10 Template dari CUDA yang terintegrasi dengan Visual Studio................... 20 Gambar 3.11 Path CUDA pada environment variables..................................................... 20 Gambar 3.12 Pencarian Firewall dengan Searchbox.......................................................... 22 Gambar 3.13 Advanced Security Firewall.......................................................................... 22 Gambar 3.14 Firewall Properties....................................................................................... 23 Gambar 3.15 Search Network and Sharing Center............................................................ 23 Gambar 3.16 Network and Sharing Center........................................................................ 24 Gambar 3.17 Local Area Connection Properties............................................................... 24 Gambar 3.18 IPV4 Properties............................................................................................ 25 Gambar 3.19 User Account host dan client........................................................................ 26 Gambar 3.20 Component Service....................................................................................... 26 Gambar 3.21 Limit COM Security pada My Computer Properties.................................... 27 6
Gambar 3.22 Search Select User....................................................................................... 27 Gambar 3.23 Advanced Select User.................................................................................. 28 Gambar 3.24 Edit Permission untuk user yang dipilih..................................................... 28 Gambar 4.1 Hasil Sorting dengan Sampel 100 data.......................................................... 30 Gambar 4.2 Hasil Perkalian Matriks dengan sampel Matriks 10 x 10.............................. 31 Gambar 4.3 Hasil dari Eliminasi Gauss Jordan dengan Sampel Matriks 10 x 10...........
31
Gambar 4.4 Hasil Binary Search dengan 30 sampel data.................................................. 32
7
DAFTAR TABEL Tabel 3.1. Spesifikasi Komputer yang digunakan untuk pengujian.................................... 16 Tabel 4.1. Pengujian Multitasking CPU dengan input data Integer.................................... 30 Tabel 4.2. Pengujian Multitasking CPU dengan input data Floating Point....................... 33 Tabel 4.3. Pengujian Multitasking GPU dengan input data Integer.................................... 35 Tabel 4.4. Pengujian Multitasking GPU dengan input data Floating Point....................... 36 Tabel 4.5. Pengujian Multitasking cluster CPU dengan input data Integer........................ 35 Tabel 4.6. Pengujian Multitasking cluster CPU dengan input data Floating Point........... 36
8
DAFTAR SINGKATAN
Singkatan
Kepanjangan
CUDA
Compute Unified Device Architecture
CPU
Central processing Unit
GPU
Graphics Processing Unit
MPI
Message Passing Interface
GPGPU
General Purpose Computing on Graphics Processing Units
DDR3
Double Data Rate 3
RAM
Random Access Memory
IEEE
Institute of Electrical and Electronics Engineers
ECC
Error Corecting Code
HPC
High Performance Computing
PCI
Peripheral Component Interconnect
DMA
Direct Memory Access
MIPS
Millions Instructions per Second
ALU
Arithmetic Logic Unit
PC
Personal Computer
9