Day 4 — Tutorial and Driver Update
Hi, all, welcome back to ICOC.
On the agenda today was scouring the web for tutorials to get familiarized with the OpenCL standard, and so far, I’ve found two tutorials that I want to try. One tutorial was written by a members of the Khronos Group, Rob Farber (which we’ll talk about later, but here’s a link now.), while the other was written by Erik Smistad.
The first tutorial I decided to implement was the one written by Erik Smistad, titled “Getting started with OpenGL and GPU computing.” This was an example that Dr. Marmorstein highlighted as we were forming the research project. The tutorial aims to add vectors contents together. While this can be done easily with a simple for loop, Smistad chooses to implement it using the OpenCL standard to allow for GPU computing. This will decrease the time it takes to compute the vector addition from linear, or O(n) with n being the size of the vectors, to relying on the number of cores in the processor instead, which can speed up the computation time.
Following Smistad’s guide, I was able to replicate this vectorAddition program, having created a main program and a kernel program to which the computation would occur in the GPU. The only issues that needed to be addressed were the facts that the OpenCL function “clCreateCommandQueue” is deprecated, and needed to be replaced with “clCreateCommandQueueWithProperties”, and the fact that the lab system I was using did not have an updated driver. Dr. Marmorstein is updating the drivers in all of the lab systems, which should fix that problem. Thankfully, one of the lab systems had the driver partially installed, so a remote login allowed me to compile the program.
Running the program, another problem appeared — when the program runs, the program will print out the given item at i in both vectors A and B, add them together, and print the result C in one line. However, all of the additions are wrong. They are either zero, or a ridiculously high number. At the moment, this does not appear to be user error, as Dr. Marmorstein was able to confirm the error, as well. Here’s hoping that the driver update will help this error somewhat…
That being said, that is all of the progress today. Tomorrow will be a day to work on more research and make sure that this tutorial is completed successfully.
Thank you, and see you next time!
Kyle Jenkins.
Time spent today: 1 hour 15 minutes
Total Time: 4 hours