Difference between revisions of "User:Michaljagielski/proposal"

From BRL-CAD
Line 49: Line 49:
 
*Fixing at least 1-2 bugs to get familiar with devlopment system.
 
*Fixing at least 1-2 bugs to get familiar with devlopment system.
 
*Deeper understanding of BRL-CAD usage (for example completing user tutorial)
 
*Deeper understanding of BRL-CAD usage (for example completing user tutorial)
*First attemps of ell primitive OpenCL raytracing. I will get it done before main work start.
+
*Preparing set of function used to kernel lauching. I suppose, that should be new file with:
+
**CL device selecting
 +
**Kernel reading and loading to memory
 +
**context managment
 +
 
 
===May 19 - August 4  (Development)===
 
===May 19 - August 4  (Development)===
====May 19 - June 2 [~2 Week] ====
+
# week - rt_ell_shot OpenCL kernel. Of course I will have library to handle OpenCL calls so it should be useful in same week.
*Write raytracers to every primitive from ellipsoids group.
+
# week - rhc and rpc ray shooting kernerls.
*Test and benchmark these raytracers. Measure diffrence between CPU and GPU implementation.  
+
# week - start of rt_tgc_shoot kernel (and 4 other primitives, that are special cases of tgc: rcc, rec,tec,trc)
====June 2 - June 23 [~3 Week]====
+
# week - finishing rt_tgc_shoot. This primitive could be hard to implement, so I think I should reserve more time to it.
*Implementation cylinders and cones raytracing. I plan three weeks because it's 9 primitives.
+
# week - ehy and epa primitives (It should be relatively easy to write). Start raytracing of simple torus (tor).
*Writing simple program/script to generating more challenging projects.
+
# week - finishing tor and kernel for eto primitive. I should also start first really hard raytracing - pipe primitive.
====June 23 - July 7 [~2 Week]====
+
//Under construction - sorry :)
*Raytracers for torus, ring and pipe should be done
+
 
====July 7 - July 21 [~2 Week]====
+
Attempt to rest of primitives if I won't complete raytracer for any primitive I will end it after August 18 (but of course I will do my best to finish all raytracers befor August 4)
*Polyhedra raytracing in OpenCL. It contains a lot of primitives, but they are wery similar to each other.
 
====July 21 - August 4 [~2 Week]====
 
*Attempt to rest of primitives if I won't complete raytracer for any primitive I will end it after August 18 (but of course I will do my best to finish all raytracers befor August 4)
 
  
 
=== August 4 - August 18 (Finalising) ===
 
=== August 4 - August 18 (Finalising) ===

Revision as of 16:24, 12 April 2014

Personal Information

Name Michał Jagielski
Email Address d3rvan@gmail.com
IRC(nick) drv
Time Zone UTC +0100

Brief Background

I'm second year student in Computer Science from University of Wroclaw. What's about my knowledge... I know Linux and other UNIX-like systems quite good. Mainly I write in C/C++ but I also like functional languages (Haskell, OCaml). Lately I'm interested primarily in GPGPU and I have some experience with it ( for example, I'm writing Rubik Cube optimal solver on CUDA). I preferred CUDA but I had also some practice with OpenCL.

Project Information

Project Title

OpenCL GPGPU Raytracing

Brief summary of Project

BRL-CAD objects are made from about two dozens of primitives. During work they are displayed only as some kind of net but there is moment, when we want get more precise and more realistic view of our project. Raytracing for most of primitives is implemented only on CPU. GPU is definetely better for this task, so in my project I will rewrite C code of raytracer to OpenCL. When GPU is not accessible on computer OpenCL also will be fast, because it can be launched on multi-core CPU.

Project Description (Detailed)

Primitives

I divided large primitives set in five categories. Some of them in one group can be very similar (for example ellipsoids), but there is also a lot of individual shapes (dsp, ars). I will divide whole task on subtasks in respect of shapes similarity.

Actual state of raytracing

In BRL-CAD each primitive have their own raytracing function. There exist only one example of OpenCL raytracer - in ellipsoids sph primitive raytracing is written in OpenCL. It will be my starting point (and it's great lesson of BRL-CAD coding style). So on first place I will write raytracer to ell (and next ellg, ell1, part), because it's more similar to sph than other primitive. Next category will be cylinders-like and cones-like primitives. Next will be torus-like (with one hole), polyhedra and last, most challenging in my opinion some of unique shapes.

I will work on branch available in http://svn.code.sf.net/p/brlcad/code/brlcad/branches/opencl/ there also is sph raytrace example: http://svn.code.sf.net/p/brlcad/code/brlcad/branches/opencl/src/librt/primitives/sph/ . After I complete a project every primitive should have file structure as sph.

Algorithm

I think that there is no too much to talk about algorithm, I will try generally rewrite C algorithms in more efficient OpenCL algorithm. Algorithm for every primitive is described with desired amout of details in name_of_primitive.c almost on beginning. I think it's unnecessary to paste it here.

Computing device

When all primitives have OpenCL raytracing during program execution I can check if GPU device is accessible and if not, lauch raytracer kernel on CPU.

Documentation

As I realized in BRL-CAD is used doxygen system, so of course I will also document my work in this program.

Deliverables

Great speedup of scenes raytracing in BRL-CAD. For this moment it's very slow (I have quite fast computer but even for relatively simple scenes raytracing takes about second.)


Working Schedule

upto May 19 (Getting started)

  • Exploring the code.
  • Completing BRL-CAD tutorial for contributors.
  • Fixing at least 1-2 bugs to get familiar with devlopment system.
  • Deeper understanding of BRL-CAD usage (for example completing user tutorial)
  • Preparing set of function used to kernel lauching. I suppose, that should be new file with:
    • CL device selecting
    • Kernel reading and loading to memory
    • context managment

May 19 - August 4 (Development)

  1. week - rt_ell_shot OpenCL kernel. Of course I will have library to handle OpenCL calls so it should be useful in same week.
  2. week - rhc and rpc ray shooting kernerls.
  3. week - start of rt_tgc_shoot kernel (and 4 other primitives, that are special cases of tgc: rcc, rec,tec,trc)
  4. week - finishing rt_tgc_shoot. This primitive could be hard to implement, so I think I should reserve more time to it.
  5. week - ehy and epa primitives (It should be relatively easy to write). Start raytracing of simple torus (tor).
  6. week - finishing tor and kernel for eto primitive. I should also start first really hard raytracing - pipe primitive.

//Under construction - sorry :)

Attempt to rest of primitives if I won't complete raytracer for any primitive I will end it after August 18 (but of course I will do my best to finish all raytracers befor August 4)

August 4 - August 18 (Finalising)

  • During these two weeks I will test once more raytracers and benchmark it on some real examples.
  • Final code submission with Google.

Time Availability

  • During summer holidays (after about 21st June) I will be completly free
  • I can devote up to 60 hrs/week. I can working in every time of day (or night)
  • In 16th June - 21st June I have final exams. It's possible that I have a little less time in this term, but I will make up for this time.
  • Befor 16th June I have university courses, but I specially take only three in this semester to participate in GSoC

Why BRL-CAD?

As I wrote before I like GPGPU and you need somebody to speedup some part of your program. What is more, I know how expensive can be CAD software and I think that this initiative (BRL-CAD) is really important.

Why you?

I'm good in C/C++ coding and GPU programming. In addition to that I'm really hard working and stubborn when I want to reach some target. I think This project is quite mached to my skills and interest so BRL-CAD can be noticeable beter thanks to mine work. Furthermore I always want to participate in any open source community so I will stay with you after GSoC ends.