On Mon, Mar 19, 2018 at 10:46 PM, Sreyansh Jain <sreyanshjai...@gmail.com>
wrote:

> Hi,
>
> I checked, the error was due to some proxy issues. I can now get it done.
>

Did you manage to compile it with the libOpenCL library this time? i.e.
$ cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
-DBRLCAD_ENABLE_OPENCL=ON

recompile,

and run rt with OpenCL enabled i.e. 'rt -z1' inside MGED?

Make sure to send us the mged console log output of the rendering with both
OpenCL enabled and disabled (screenshots will do as well).

>
> Also, I've shared the rough draft of the proposal for your reviews. Do let
> me know the changes to be incorporated in it. I'd need a bit more detailed
> tasks on BREP support and BOT plate mode for me to understand and write it
> in the proposal accordingly. ‌
>

Well... you'll have to check it out for yourself, but basically the idea
with regards to the BOT (Bag Of Triangles) plate mode support is that you
need to be able to support intersections with triangle meshes with actual
thickness (hence the "plate mode" moniker).
The code for that in the ANSI C code path should be located in:
https://svn.code.sf.net/p/brlcad/code/brlcad/trunk/src/librt/primitives/bot/g_bot_include.c

Check 'rt_bot_shot_' and the functions it calls. The ANSI C code basically
determines the hit points, sorts them, and then it has specific segment
generation code in 'rt_bot_makesegs_'. The OpenCL side (bot_shot.cl) right
now determines the hit points, sorts them, and has a simplified segment
generation code which assumes that: a) triangles don't have thickness and
b) that the mesh represents a solid object. You basically need to address
those issues in the OpenCL shot code and implement the missing features
from 'rt_bot_makesegs_'.


With regards to BREP support, that should be more complex, since, for one,
that is coded in C++ and also uses an auxiliary library also in C++.
In order to run that on OpenCL 1.2 you would likely need to port C++ parts
of the library to OpenCL/C, including the generic ray-BREP intersection
code, and the primitive-BREP conversion functions for any primitives you
need to support.

It should also be possible, as a first step, to basically just make a
function that serializes the NURBS surfaces, etc, of the BREP form of the
primitive, pass that serialized form to the GPU, and then port just the
generic ray-BREP intersection code, rather than doing the whole BREP
conversion on the OpenCL side as well. i.e. serialize just the 'ON_Brep *'
of the primitives, then pass that to the OpenCL side which then performs
the actual intersections.

For example, this is the Ellipsoid->BREP conversion function:
https://svn.code.sf.net/p/brlcad/code/brlcad/trunk/src/librt/primitives/ell/ell_brep.cpp

It outputs the 'ON_Brep *' for that primitive.

This contains the generic ray-BREP intersection function 'rt_brep_shot':
https://svn.code.sf.net/p/brlcad/code/brlcad/trunk/src/librt/primitives/brep/brep.cpp

In case you decide to tackle this, it is probably best to first make a
simplified ANSI C version of 'rt_brep_shot' since that should be easier to
port to OpenCL/C.

Regards,


> On Mon, Mar 19, 2018 at 4:35 AM, Sreyansh Jain <sreyanshjai...@gmail.com>
> wrote:
>
>> I've added the clinfo output in the attachment.
>>
>> I think I've tracked it down to being unable to link rt with OpenCL
>> library. While running "svn co svn://svn.code.sf.net/p/brlcad
>> /code/brlcad/trunk/ brlcad" as mentioned here
>> <https://brlcad.org/wiki/Compiling>, it gave the following error:
>>           svn: E170013: Unable to connect to a repository at URL 'svn://
>> svn.code.sf.net/p/brlcad/code/brlcad/trunk'
>>           svn: E000111: Error running context: Connection refused
>> ‌
>>
>> Warm Regards,
>>
>> *Sreyansh Kumhar Jain*
>> 4th Year Undergraduate Student
>> Department of Mechanical Engineering
>> Indian Institute of Technology, Kharagpur
>> *+91-9933958066 <+91%2099339%2058066>*
>>
>> sreyanshjai...@gmail.com
>> Facebook <https://www.facebook.com/sreyansh.sonu> | LinkedIn
>> <https://www.linkedin.com/in/sreyansh-kumhar-jain-a61428104/>
>>
>> On Sun, Mar 18, 2018 at 5:47 AM, Vasco Alexandre da Silva Costa <
>> vasco.co...@gmail.com> wrote:
>>
>>> PS: Please attach the output of clinfo to your message, that might help
>>> find out the problem.
>>>
>>> If OpenCL is correctly configured and installed and rt still doesn't use
>>> it, either you didn't enable OpenCL in rt at runtime (i.e. 'rt -z1'), or
>>> you compiled 'rt' without OpenCL support. If you 'ldd' the 'rt' binary it
>>> should be linked to the libOpenCL library. If it isn't linked with the
>>> library you need to re-run cmake, enable the appropriate options (i.e.
>>> cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
>>> -DBRLCAD_ENABLE_OPENCL=ON), and recompile the code.
>>>
>>> On Sun, Mar 18, 2018 at 12:01 AM, Vasco Alexandre da Silva Costa <
>>> vasco.co...@gmail.com> wrote:
>>>
>>>> Make sure to start 'rt' with the '-z1' flag. This should enable OpenCL
>>>> mode.
>>>> You should be able to see OpenCL debug messages on the console in that
>>>> case.
>>>>
>>>>
>>>>
>>>> On Sat, Mar 17, 2018 at 9:35 PM, Sreyansh Jain <
>>>> sreyanshjai...@gmail.com> wrote:
>>>>
>>>>> I checked with clinfo and I've OpenCL installed properly. How do I
>>>>> check if it is working during MGED commands?
>>>>>
>>>>> ‌
>>>>>
>>>>> Warm Regards,
>>>>>
>>>>> *Sreyansh Kumhar Jain*
>>>>> 4th Year Undergraduate Student
>>>>> Department of Mechanical Engineering
>>>>> Indian Institute of Technology, Kharagpur
>>>>> *+91-9933958066 <+91%2099339%2058066>*
>>>>>
>>>>> sreyanshjai...@gmail.com
>>>>> Facebook <https://www.facebook.com/sreyansh.sonu> | LinkedIn
>>>>> <https://www.linkedin.com/in/sreyansh-kumhar-jain-a61428104/>
>>>>>
>>>>> On Sat, Mar 17, 2018 at 10:42 PM, Vasco Alexandre da Silva Costa <
>>>>> vasco.co...@gmail.com> wrote:
>>>>>
>>>>>> Probably. Did you try the clinfo command I mentioned before?
>>>>>> https://github.com/simleb/clinfo
>>>>>>
>>>>>> If clinfo doesn't show OpenCL installed there may be a configuration
>>>>>> or installation issue.
>>>>>>
>>>>>> BTW this is the OpenCL version I use:
>>>>>> https://developer.amd.com/amd-accelerated-parallel-processin
>>>>>> g-app-sdk/
>>>>>>
>>>>>> It's made by AMD but it runs on any x86 processor, Intel or AMD.
>>>>>> Try these. If you still have issues then we can talk.
>>>>>>
>>>>>> On Sat, Mar 17, 2018 at 10:20 AM, Sreyansh Jain <
>>>>>> sreyanshjai...@gmail.com> wrote:
>>>>>>
>>>>>>> I think I'm missing something trivial and thus having problems in
>>>>>>> initializing ocl itself. I tried doing the same things with other
>>>>>>> primitives(ell, hyp etc.) to get the same kinda results. Can we have a
>>>>>>> quick Skype call to discuss the same ?
>>>>>>>
>>>>>>> ------------------------------------------------------------
>>>>>>> ------------------
>>>>>>> Check out the vibrant tech community on one of the world's most
>>>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>>>> _______________________________________________
>>>>>>> BRL-CAD Developer mailing list
>>>>>>> brlcad-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Vasco Alexandre da Silva Costa
>>>>>> PhD in Computer Engineering (Computer Graphics)
>>>>>> Instituto Superior Técnico/University of Lisbon, Portugal
>>>>>>
>>>>>> ------------------------------------------------------------
>>>>>> ------------------
>>>>>> Check out the vibrant tech community on one of the world's most
>>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>>> _______________________________________________
>>>>>> BRL-CAD Developer mailing list
>>>>>> brlcad-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>>>>>
>>>>>>
>>>>>
>>>>> ------------------------------------------------------------
>>>>> ------------------
>>>>> Check out the vibrant tech community on one of the world's most
>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>> _______________________________________________
>>>>> BRL-CAD Developer mailing list
>>>>> brlcad-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Vasco Alexandre da Silva Costa
>>>> PhD in Computer Engineering (Computer Graphics)
>>>> Instituto Superior Técnico/University of Lisbon, Portugal
>>>>
>>>
>>>
>>>
>>> --
>>> Vasco Alexandre da Silva Costa
>>> PhD in Computer Engineering (Computer Graphics)
>>> Instituto Superior Técnico/University of Lisbon, Portugal
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> BRL-CAD Developer mailing list
>>> brlcad-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>>
>>>
>>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>


-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to