Hi, I've submitted a patch for CLINE primitive here https://sourceforge.net/p/brlcad/patches/541/ . Please review. I've tested it locally and it is building without error. Also, I saw a bunch of unmerged patches from 2 years back, are they wrong?
Hi @Sean , I've submitted a proposal. Please review and let me know if I can include anything else in it.
Hi @Rishabh Suthar, I had just a look at your proposal. It is a bit short, but this isn't the biggest problem. There is a reason why these primitives aren't yet available with OpenCL. If I understood it right, the main problem is their dynamic size. You should say something about how you plan to overcome this issue.
Thanks for the input @Daniel Rossberg . Given tomorrow's deadline for submitting proposal, I'll try to address the issue in it or else will just acknowledge in it while I'll keep working on it later.
Rishabh Suthar said:
Hi, I've submitted a patch for CLINE primitive here https://sourceforge.net/p/brlcad/patches/541/ . Please review. I've tested it locally and it is building without error. Also, I saw a bunch of unmerged patches from 2 years back, are they wrong?
Old patches are a combination of mixed priority and other issues that prevented merging the patch (like untested or broken compilation or other problems). They also take considerable time to review and integrate, so they often sit. It doesn't typically imply anything.
Like Daniel said, the biggest issue @Rishabh Suthar is a lack of detail. Try to add as much as possible in the time remaining, keep an editable draft handy for discussion.
Also, don't forget to submit a final before the deadline, but detail, detail, detail regardless. Did you test your patch? Can you show it working?
Hi, I didn't get much time to look into this. I've included as much details in the proposal as possible for now and will keep looking into issues later. Hope that is fine.
@Rishabh Suthar Have you had a chance to sort out any more progress on your proposal or code?
Hi @Sean , I'm currently getting myself familiarised with the mged commands and the primitives getting to know how they work and process.
Hi team, thank you for choosing me as one of the interns. It means a lot to me. Eagerly looking forward to making successful and effective contributions to this community. :)
@Rishabh Suthar thank you for all your efforts on the proposal. few applicants actually followed all of the application criteria this year, so it was good to see you step up and follow through with discussion too. open source is all about communication.
on that note, GSoC is different from an internship! internships come and go. this is hopefully the beginning of something new and interesting that you'll want to continue with well beyond GSoC, even beyond employment opportunities. it's the open source way for you to find something that is of interest to you that you want to keep working on.
glad to have you with us!
Hi @Sean , I was wondering if there is any scope to use C++ multi-threading along with OpenCL for these primitives?
@Rishabh Suthar no, that's not within scope, but whatever you work on does need to be thread safe. the opencl codebase you're working already runs in parallel with threading. you don't need to do anything in that regard.
@Rishabh Suthar why do you ask? did you try running in parallel?
@Rishabh Suthar thank you for filling out the wiki and starting a web log -- did you finish all the checklist?
Yes, I've finished the checklist. Sorry for the delay in reply, internet services were hit due to supercyclone Amphan here. Everything is normal now.
Regarding the C++ parallel, I'd read this concept earlier, hence I wanted to explore the possible scope for this.
@Rishabh Suthar If you make progress on opencl in other areas quick enough, there will probably be some things you would work on with C++ parallelism. Where's your project plan at? We can make sure there is some time allocated to explore this at the end if it's something that interests you a lot.
@Sean I'd be happy to explore that. I've kept some buffer time in my proposed project plan. If all goes well, I'll try to wrap up the OpenCL primitives part in 2 months and dedicate the last month to work on C++ parallelism. I'll now start working on arbn primitive in the first week as proposed.
@Rishabh Suthar that sounds good. Where's your development plan at? Would you post the link?
Sure. https://brlcad.org/wiki/User:Rishabhsuthar32/GSoC20/Project is the proposed plan for now.
Hi @Sean , did you have a look and review the CLINE primitive patch which I submitted earlier? I'll make the necessary changes, if required.
Hi @Sean , I've submitted the ARBN patch as well. Here is the link : https://sourceforge.net/p/brlcad/patches/543. Please review.
Hi @Sean , I was testing the opencl kernel with -z flag. But it seems that after compiling nothing happens, the log prints out raytracing aborted and no rendering is happening.
Following is the commands I used:
mged> rt -z 1
and its prints out:
Compiling OpenCL programs...
Raytrace aborted.
Could you please let me know the correct usage of -z flag. I could not find anything much regarding this flag in documentation.
@Rishabh Suthar are you on trunk or the ocl branch?
I'm not sure the -z flag takes an option. Specifying it tells rt to use OpenCL during rendering if it was enabled during compile.
Ah, looks like it does take an arg, an int that is just set to 1 like you did to turn on opencl.
It sounds like something made it stop during the opencl compilation step. Maybe try with a simpler model or even fewer rt flags if others were specified, or run in GDB debugger to see if you see why it's aborting.
Hi @Sean , I am using trunk. I just use -z flag for rendering using opencl and I did build with opencl enabled, I tried this with the simplest model only, on arb8, I was expecting all the primitives which have been previously parallelized should work successfully, but none of them is renders with -z flag. Sure i will try GDB debugger and let you know.
Yeah, a simple arb8 should work. A generic failure like that could mean almost anything. Have you confirmed that you have an opencl driver installed and working?
Yes opencl works fine on my laptop, I have written some general codes which run fine.
Could you please try rendering any simple primitive on your machine? using the same command which I am using, rt -z 1. It might also be that building BRL-CAD did not catch the opencl driver in my machine, which I will check once again.
yeah, I can check this. I have to recompile trunk for that.
yes please check this whenever you get time, thank you!
Hi @Sean , did you test rendering using opencl? My build has opencl enabled, but still it doesn't render.
Hi @Sean, I have submitted the pipe patch, it was a long one so took some time sorry for the delay and I have already started working on next item in the list. Please let me know if you have tried rendering on your machine. Is there any documentation specific to opencl, which can help me with rendering in opencl.
Great! I will give it a check here in a bit
how're things going? :)
@Rishabh Suthar Can you write up a summary of all your progress to date? I'd like to send out an announcement. If you can show a video render of one of the opencl primitives compared with non-opencl, that would be great to include. It can be just 1 page on google docs, a pdf, or a blog post, maybe link to it in your log and here so people can read it.
I'm almost through your patches, so will update you soon on that status. I have some feedback to give.
Hi @Sean I have been updating my logs, you can find it here:
https://brlcad.org/wiki/User:Rishabhsuthar32/GSoC20/Log
starting into dsp, neato :) Are there images to share and/or is this close to where I could drop it on some real hw to see if there's a good speed-up? (I seem to have some interesting nvidia stuff handy... can't ask for a100 time for something like this, but heck, v100, sure...)
@Rishabh Suthar I would really like to see a bit more detail than that. I can't help you at all when you write "Worked on..." though that is good context to start with. Just need like 3 sentences. Not just awareness of what you worked on, but what did you get working, what did you not get working. What you're working on is intrinsically graphical, so it would be good to see a picture or statistic at least once a week.
@Sean got it. Will update the logs accordingly.
@Erik yeahh, dsp seems to be most challenging till now. I've developed arbn and pipe primitive. Can you give it a try? I wanna know how they perform in that hw. :D I'll send the MR links.
@Erik
https://sourceforge.net/p/brlcad/patches/543/
https://sourceforge.net/p/brlcad/patches/545/
https://sourceforge.net/p/brlcad/patches/541/
@Sean I've kept dsp primitive on hold for now. Would want to get hands-on on other primitives to get the ball rolling. I've submitted VOL primitive patch and am working on metaball now.
Let me know when you review it.
@Sean also, I was trying to update the wiki logs but I'm unable to access the website. Is it having some issue?
Yes, @Rishabh Suthar apache crashed for some unknown reason, but it's back up. keeping an eye on it. try again?
@Rishabh Suthar how's it going? It's time for an in-depth review of where you're at on the project. Please let me know when you're available.
First up on the agenda after updating logs, we can discuss the -z option to make sure opencl compilation is working. First and foremost, re-run cmake for me and show me the entire cmake output -- if you're on linux, you can save the output to a log file while seeing it output with something like:
cmake -DBRLCAD_ENABLE_OPENCL=ON path/to/src 2>&1 | tee cmake.log
Hey @Sean , good news! I made the -z flag running as expected, finally! I'd to change FindOpenCL.cmake file to ensure it catches the right path of OpenCL in my system. Huhhh. I'll revisit the patches and update them again. Also, will include a documentation around this so that next time someone else doesn't face the same issue. :D
that's great to hear @Rishabh Suthar and yes please do update all the patches now that you can test them to make sure they compile and run. if you have a change to the cmake file, that'd be a good patch too.
your log updates for week 8 look good too, thank you
@Sean Yeah, will keep the logs in similar format. thanks.
I wanted to know if there is any predefined file or inputs for rendering VOL primitive. It gets 'segmentation fault' most of the time.
Hey @Sean , it seems there was a bug in master code itself. None of the previously done primitives were working in OpenCL. It said "Failed to set OpenCL arguments". I tried with ELL and ARB8. However, I've resolved the code with immense effort. It was due to a mismatch between uchar2 and uchar3 in different function declaration. They are now rendering fine. I'll include a patch for this.
That is good news!
Indeed!
Rishabh, how goes it? Good luck with the metaball primitive?
@Erik Hey, I'm trying to see how can I pass r_min and r_max for metaball primitive or if I can calculate it inside the shot function itself!
Hey, I've added the documentation of the issues I faced in the dev logs. Can you have a look and let me know if anything else should be added for better clarification?
I will take a look later today, thanks!
It seems like I missed out on doing "svn add" of cline_shot.cl file in cline primitve patch submitted during the GSoC application period. My bad! It is missing from the patch file. Will redo it and test again.
sounds good
Hey @Sean , how can I render CLINE primitive? I can't find any sample fastgen4 file. Is there any documentation around this which can help me?
@Rishabh Suthar just run rt to render them. You’ll of course need to create one. I don’t think the “in” command will make one, but you should check. We have some sample fastgen files in the repo (regress or db dir), check them first.
As for docs, see https://brlcad.org/~starseeker/cline.pdf
Latest trunk can create a cline object with "make cline.s cline"
@starseeker yeah, it worked. thanks! :)
I was using "in" for making all primitives.
@starseeker any idea on how to make vol primitive?
Rishabh Suthar said:
starseeker any idea on how to make vol primitive?
there was a conversation between Sean and Thusal about making a vol
in the #general stream
:grinning_face_with_smiling_eyes:
Thanks @Sumagna Das , let me look into it. :)
Hey @Sean , I'm still unable to do printf in _shot functions. I tried both printf and bu_log, nothing worked. Any suggestion on what else should I try?
It becomes difficult to debug for the primitives which are compiling error-free for not rendering. I can't understand where is it facing the logical error.
Hi @Sean , I tried with the Superell patch. I'm attaching the .c and .cl renderings. They do not seem exactly the same, is this expected or do I debug it further? sup_c.png sup_cl.png
Rishabh Suthar said:
Hi Sean , I tried with the Superell patch. I'm attaching the .c and .cl renderings. They do not seem exactly the same, is this expected or do I debug it further? sup_c.png sup_cl.png
Neither of those look valid to my eyes.. maybe zoom out more so you can see what's going on? Try very simple superell parameters.
I tried "in" command with input parameters but it fails to make one. It throws in some error wrt major/minor axis. So I did this with "make" command in MGED and rendered it. Let me try again.
I've also started documenting MGED commands in my wiki logs with simple input parameters for making different primitives. I'll keep on adding as and when I find a command for respective primitive. It might help others who face similar issue in future.
Rishabh Suthar said:
Hey Sean , I'm still unable to do printf in _shot functions. I tried both printf and bu_log, nothing worked. Any suggestion on what else should I try?
did you try a simple opencl demo to see if you can get it to print inside a compute kernel? I would have expected bu_log to give you a compilation error, so that's a very odd if it didn't.
Rishabh Suthar said:
I tried "in" command with input parameters but it fails to make one. It throws in some error wrt major/minor axis. So I did this with "make" command in MGED and rendered it. Let me try again.
This implies that the values you used are probably not valid, not in range. Can search the web to find a set of real parameters that should work.
looks like this lets one play interactively: https://www.maplesoft.com/support/help/Maple/view.aspx?path=MathApps/Superellipsoid
ah, that's only interactive in maple, but there are some actual values there you can try
Sean said:
looks like this lets one play interactively: https://www.maplesoft.com/support/help/Maple/view.aspx?path=MathApps/Superellipsoid
Yeah, this should help! Thanks.
Sean said:
did you try a simple opencl demo to see if you can get it to print inside a compute kernel? I would have expected bu_log to give you a compilation error, so that's a very odd if it didn't.
Yeah, I tried that. With printf, it was not able to create context itself. The bu_log did give errors. I imported all the necessary functions in common.cl but didn't work.
Does this look ok for superell primitive? I did "az35, el25" view.
I did this via "make" command. I'm not yet able to use "in" command. I used ell parameters and added 0/1/2 values for n,e parameter in superell but it still gave "rt_db_external5_to_internal5(superell.s): unable to import non-BRL-CAD object, major=255 minor=35" error log.
I'm checking now why is it getting 255 as majortype instead of 1 or 9
Hey @Sean , I cloned the repository again and started from scratch, superell C rendering worked with parameter values. I don't know why it was not working in my previous repository. Blah.
Anyway, I tried with HYP primitive and was able to successfully render both C and CL versions.
This looks fine, right?
I think with the other primitives, I'm facing issue with memory allocation which is not working well. Probably that's why they are not rendering an image in CL versions.
Also, did the security certificate of brlcag.org expire? It is giving me safety warnings while trying to visit.
@Rishabh Suthar : can you re-render with the light at the same place and pixdiff?
@Sean : ^^ brlcad.org ssl cert expired on the 18th, re-up!
@Erik dag nab it.. again??! There's a cron job that runs their updater daily, but it's been not working reliably (usually something in python updates and it stops running).
@Rishabh Suthar what's the difference between the two hyp rendering's performance? Can you show me the summary from both their logs (the RTFM lines in particular)?
if you're not already, you'll probably want to keep two directories -- one with opencl enabled and one without so you can keep two compiles for comparison.
Sean said:
Rishabh Suthar what's the difference between the two hyp rendering's performance? Can you show me the summary from both their logs (the RTFM lines in particular)?
Sean said:
if you're not already, you'll probably want to keep two directories -- one with opencl enabled and one without so you can keep two compiles for comparison.
@Sean How can I save the logs in a file from MGED terminal?
Erik said:
Rishabh Suthar : can you re-render with the light at the same place and pixdiff?
@Erik How can I use pixdiff ? I saw this https://brlcad.org/~nouhrasofat/man1/en/pixdiff.php but it is not working. I wrote a short python code for pix diff. Both have same size and channels but there are few non zero in b,g,r arrays! Is this fine or are we just trying to verify the intersection points?
It says pixdiff is not a command. It needs npm install and couldn't find any other command similar to this!
hyp2_cl.png hyp2_c.png diff.png
@Erik Does this work? I did it via python opencv2 library.
there's not a save log option, so you can either run copy-paste or run rt outside mged and redirect output to a file using usual means
Sean said:
there's not a save log option, so you can either run copy-paste or run rt outside mged and redirect output to a file using usual means
Got it. Anyway, did you get a chance to look at the logs I shared? The CPU performance has increased. I used -s2048 flag for heavy rendering.
@Sean , this being the last week of GSoC, I wanted to document this well for future reference. Are there any protocols as to how should I document this or any other last week tasks of GSoC?
So if you didn't catch it in that summary there @Rishabh Suthar -- the performance logs you shared show it being 0.3 seconds in non-ocl and 0.02 seconds in ocl mode. That's more than a 10x improvement
Rishabh Suthar said:
It says pixdiff is not a command. It needs npm install and couldn't find any other command similar to this!
pixdiff is installed in BRL-CAD.... it's in the same dir as mged and rt and company
Rishabh Suthar said:
Sean , this being the last week of GSoC, I wanted to document this well for future reference. Are there any protocols as to how should I document this or any other last week tasks of GSoC?
Yes, you should pull together a final report that shows before and after for all the entities that you got converted, ideally with a picture and performance number for each. Make sure all your patches work with the latest trunk sources too, just in case something changed recently, and I'll work with you to get it all integrated asap.
Should I make the final report in BRL-CAD wiki itself or a Google Doc?
Sean said:
So if you didn't catch it in that summary there Rishabh Suthar -- the performance logs you shared show it being 0.3 seconds in non-ocl and 0.02 seconds in ocl mode. That's more than a 10x improvement
Yeah! Also, the pixdiff image I sent, is it expected?
Whatever is most comfortable for you is fine for writing it, but the final one should end up on our site so it remains available -- in case you accidentally move/delete the doc from your Google Drive, for example
you said you used opencv, not pixdiff right? I don't know what they do or what routines you used or what their output means without reading up on it more.
if that's a pixdiff output, then I can answer the question :smile:
I basically calculated the pixel difference between the two images using opencv. Let me try pixdiff you mentioned.
I used this command: pixdiff file1.pix file2.pix > out.pix
It's a 12 mb file! :/
pixdiff bytes: 5887661 matching, 887771 off by 1, 5807480 off by many
This was the terminal output
o.O .. next time run pix-png afterwards :grinning:
Difference in the normal calculation?
Looks like it, maybe. RGB values on the top face (ocl) go from 117/117/117 to 124/124/124 and on the bottom face (rt) from 110/110/110 to 115/115/115.
@Rishabh Suthar so the pixdiff image shows where the color values differ by more than 1 value in one or more of the RGB channels. Most of the pixels are offset in intensity by just a little bit, which implies some calculation is just slightly off.
The most important part is that hits vs miss appears to be correct. It would be informative to compare the same nirt shotline in both to make sure the hits are at least identical. If they are, it would confirm this is a normal issue.
@Rishabh Suthar for what it's worth, your project is a highlight on our facebook feed tody
Sean said:
The most important part is that hits vs miss appears to be correct. It would be informative to compare the same nirt shotline in both to make sure the hits are at least identical. If they are, it would confirm this is a normal issue.
I'll check and revert with the nirt usage and command.
@Sean I've prepared a rough draft for the report here: https://brlcad.org/wiki/User:Rishabhsuthar32/GSoC20/Report . Can you look into it and suggest any further modifications I should make?
I tried out the nirt command. Just to confirm, I used 'nirt' command in the MGED terminal after rendering both C and OpenCL versions. The output was same in both.
I'll be modifying the ToDo part a bit more with technical details for better clarification.
Can you show the output of nirt? There's different output forms that will print more precision than the default. Might be needed to detect if they're actually identical. Post the .g's and I can help take a look at them.
Origin (x y z) = (0.00000000 0.00000000 0.00000000) (h v d) = (0.0000 0.0000 0.0000)
Direction (x y z) = (-1.00000000 0.00000000 0.00000000) (az el) = (0.00000000 0.00000000)
Region Name Entry (x y z) LOS Obliq_in Attrib
hyp.s ( 100.0000 0.0000 0.0000) 200.0000 0.0000
@Sean this is what is needed, right? anything else?
sort of... is that the c or cl output? is the other character-for-character identical output?
Same output comes for both C and CL .
@Rishabh Suthar so you shot directly down the X axis. instead can you shoot through one of the upper sides where we know the hits or normals deviate? If anything, we should be able to see the normal change -- I think you'll have to pick a different nirt output format in order for it to print the normal (see the NIRT guide on brlcad.org/wiki/Documentation for details and/or nirt -? .. it's the -fmt option)
If you run saveview in one, you can then run loadview in the other mged to make sure you're shooting the same ray.
Okay, let me check.
Origin (x y z) = (0.00000000 0.00000000 0.00000000) (h v d) = (0.0000 0.0000 0.0000)
Direction (x y z) = (0.42426407 0.56568542 0.70710678) (az el) = (-126.86989765 -45.00000000)
Region Name Entry (x y z) LOS Obliq_in Attrib
hyp.s (-107.7632 -143.6842 -179.6053) 508.0005 70.7960
@Sean , I tried via a different angle.
I however am not sure the difference b/w c and cl one. Nirt will shoot irrespective of rt is done via c or opencl. How can we ensure it shoots through the cl primitive made?
I mean, doing nirt after make command also gives the output, which means it is shooting through the primitive formed. Will it shoot through the rendered primitive as well?
@Rishabh Suthar oh, that's a good question. hadn't considered that.
does nirt have a -z option? if not, maybe add one to it as well that makes it enable opencl like rt does
it's not a c or cl primitive -- the geometry is one and the same no matter what. we're just evaluating that geometry with either c ray tracing or cl ray tracing.
my asking you for two .g's was probably misleading in hindsight. I just wanted to make sure you weren't using different geometry for each.
there should be no problem using just one .g file. the questions we need to confirm is 1) whether the hit point of some random non-axis-aligned ray is identical with -z and without -z and 2) whether the calculated normal is identical with and without -z
Sean said:
does nirt have a -z option? if not, maybe add one to it as well that makes it enable opencl like rt does
It doesn't have a -z flag. Yeah, we could add one. Will include this task in final report as well.
Sean said:
there should be no problem using just one .g file. the questions we need to confirm is 1) whether the hit point of some random non-axis-aligned ray is identical with -z and without -z and 2) whether the calculated normal is identical with and without -z
without nirt, for now maybe we can compare the view in different angles in c and cl cases. I'll look online if there is any other tool to check this.
@Rishabh Suthar rt might be able to give us what we need since it already has the -z option. i'm not sure any other tool is going to help as we need it to go through the opencl pipeline which is only accessible through rt currently.
rt has ways to shoot just one ray at a time, and we can turn on debugging
okay, I figured it out ... I don't use this very often but it should be exactly what we need
run this: rt -b "256 256" -F/dev/debug -X10
that should give a non-cl output, then of course run again with with -z1 to get cl output: rt -b "256 256" -F/dev/debug -X10 -z1
we'll want to compare the two outputs
actually, lets add the -x4 debug flag too: rt -b "256 256" -F/dev/debug -X10 -x4
and rt -b "256 256" -F/dev/debug -X10 -x4 -z1
and just copy paste the whole output of each between two ``` blocks, so it looks like:
mged> rt -b "256 256" -F/dev/debug -X10 -x4
BRL-CAD Release 7.31.0 The BRL-CAD Raytracer RT
Sun, 30 Aug 2020 14:34:09 -0400, Compilation 10
morrison@agua.local
BRL-CAD Release 7.31.0 The BRL-CAD Ray-Tracing Library
Sun, 30 Aug 2020 14:34:09 -0400, Compilation 10
morrison@agua.local
BRL-CAD Release 7.31.0 The BRL-CAD Numerical Computation Library
Sun, 30 Aug 2020 14:34:09 -0400, Compilation 10
morrison@agua.local
BRL-CAD Release 7.31.0 The BRL-CAD Utility Library
Sun, 30 Aug 2020 14:34:09 -0400, Compilation 10
morrison@agua.local
Compile-time debug symbols are available
Running on agua.local
libbu bu_debug=x1 <COREDUMP>
librt rt_debug=x4 <SHOOT>
rt optical_debug=x10 <SHADE>
/Users/morrison/brlcad.trunk/.build/bin/rt -M -b 256 256 -F/dev/debug -X10 -x4 -u model
opendb /Users/morrison/brlcad.trunk/.build/test.g;
tree ;
db title: Untitled BRL-CAD Database
DIRBUILD: cpu = 0.000275 sec, elapsed = 0.000456 sec
parent: 0.0user 0.0sys 0:00real 0% i+d maxrss +pf csw
children: 0.0user 0.0sys 0:00real 0% i+d maxrss +pf csw
Additional #malloc=244, #free=214, #realloc=14 (30 retained)
0x109c68030 TOL 5.000000e-04 (sq=2.500000e-07) perp=1.000000e-06, para=9.999990e-01
BRL-CAD Release 7.31.0 The BRL-CAD Optical Shader Library
Sun, 30 Aug 2020 14:34:09 -0400, Compilation 10
morrison@agua.local
Additional #malloc=2053, #free=5, #realloc=1 (2048 retained)
GETTREE: cpu = 0.000326 sec, elapsed = 0.000437 sec
parent: 0.0user 0.0sys 0:00real 0% i+d maxrss +pf csw
children: 0.0user 0.0sys 0:00real 0% i+d maxrss +pf csw
fb_open(0x7f98edc110d0, "/dev/debug", 512, 512)
fb_view(0x7f98edc110d0, 256, 256, 1, 1)
...................Frame 0...................
PREP: cpu = 0.000128 sec, elapsed = 0.000142 sec
parent: 0.0user 0.0sys 0:00real 0% i+d maxrss +pf csw
children: 0.0user 0.0sys 0:00real 0% i+d maxrss +pf csw
Additional #malloc=1409, #free=1373, #realloc=10 (36 retained)
NUBSP: 0 cut, 1 box (1 empty)
Tree: 1 solids in 1 regions
Model: X(-500, 500), Y(-500, 500), Z(-500, 500)
View: 35 azimuth, 25 elevation off of front view
Orientation: 0.248097, 0.476591, 0.748097, 0.389435
Eye_pos: 2571.76, 1800.77, 1463.99
Size: 2000mm
Grid: (3.90625, 3.90625) mm, (512, 512) pixels
Beam: radius=1.95312 mm, divergence=0 mm/1mm
only pixel 256 256
Mode: scanline-per-CPU buffering
Lighting: Ambient = 40%
Implicit light 0: (3887.74, 1501.45, 1886.61), aimed at (0, 0, -1)
Implicit light 0: invisible, no shadows, 1 lumens (83%), halfang=180
**********shootray cpu=0 256, 256 lvl=0 a_onehit=-1 (main ray)
Pnt (2571.7624676893201467, 1800.767466360870003, 1463.9926030826702572)
Dir (-0.74240387650610395465, -0.51983679072568422797, -0.42261826174070005191)
BOX #1 interval is 2790.61..4137.59
0x109c681d8 BOX Contains 1 primitives (2 alloc), 0 primitives with pieces:
min (-500.000000, -500.000000, -500.000000)
max (500.000000, 500.000000, 500.000000)
sph
shooting sph
Waiting segs:
0x7f98ee016c00: SEG sph (2964.1, 3964.1) st_bit=0 xray#=0
------a_hit()
0x7f98edd17750: PT sph (SPH#0) sph (SPH#0) (2964.1, 3964.1)
InHIT dist=2964.1 (surf 0)
OutHIT dist=3964.1 (surf 0)
Primitives: sph,
Untrimmed Segments spanning this interval:
0x7f98ee016c00: SEG sph (2964.1, 3964.1) st_bit=0 xray#=0
Region: /s.r
------
colorview calling viewshade
viewshade(/s.r)
Using "plastic" shader, mfp_inputs=x1 <NORMAL>
Surface normal for shader:
hit pt: 371.202 259.918 211.309 end pt: 384.061 268.922 218.629
Shadeworkbefore mf_render: 0x7ffeeb507538
sw_inputs=x9 <HIT,NORMAL> sw_hit.dist:2964.1 @ sw_hit.point(371.202 259.918 211.309)
sw_hit.normal(0.742404 0.519837 0.422618)
sw_transmit 0.000000
sw_reflect 0.000000
sw_refract_index 1.000000
sw_extinction 0.000000
sw_color (1.000000, 0.000000, 0.000000)
sw_basecolor (1.000000, 0.000000, 0.000000)
sw_uv 0.000000 0.000000
sw_dudv 0.000000 0.000000
sw_xmitonly 0
phong_render
shine=10
specular=0.699999999999999955591079
diffuse=0.2999999999999999888977698
transmit=0
reflect=0
ri=1
extinction_per_meter=0
emission=0,0,0
Shadeworkafter mf_render: 0x7ffeeb507538
sw_inputs=x9 <HIT,NORMAL> sw_hit.dist:2964.1 @ sw_hit.point(371.202 259.918 211.309)
sw_hit.normal(0.742404 0.519837 0.422618)
sw_transmit 0.000000
sw_reflect 0.000000
sw_refract_index 1.000000
sw_extinction 0.000000
sw_color (1.086587, 0.444181, 0.444181)
sw_basecolor (1.000000, 0.000000, 0.000000)
sw_uv 0.000000 0.000000
sw_dudv 0.000000 0.000000
sw_xmitonly 0
----------shootray cpu=0 256, 256 lvl=0 (main ray) HIT ret=1
SHOT: cpu = 0.000236 sec, elapsed = 0.000306 sec
parent: 0.0user 0.0sys 0:00real 0% i+d maxrss +pf csw
children: 0.0user 0.0sys 0:00real 0% i+d maxrss +pf csw
Additional #malloc=310, #free=300, #realloc=31 (10 retained)
1 solid/ray intersections: 1 hits + 0 miss
pruned 100.0%: 0 model RPP, 0 dups skipped, 0 solid RPP
Frame 0: 262144 pixels in 0.00 sec = 1110779661.02 pixels/sec
Frame 0: 1 rays in 0.00 sec = 4237.29 rays/sec (RTFM)
Frame 0: 1 rays in 0.00 sec = 4237.29 rays/CPU_sec
Frame 0: 1 rays in 0.00 sec = 3267.97 rays/sec (wallclock)
if_flush(0x7f98edc110d0)
fb_close(0x7f98edc110d0)
the most important lines we'll be paying attention to are the Pnt,Dir lines, the InHit,OutHit lines, the hit,end pt shading lines, and the sw_* lines.
@Sean , I don't see such logs while rendering the OpenCL version
can you show me what you're seeing?
well... then I guess we probably have our answer for why the images are different
it's apparently not going through liboptical for the lighting, must be doing its own thing
I tried with previously merged primitives as well, like ell. Same response.
yeah, looks like that's what's going on
ideally, the cl version should go through liboptical? what exactly does it do?
the code ends up calling clt_frame() which is up in src/librt/primitives/primitive_util.c .. and in there it's doing shading in opencl too
ah, there it is
src/librt/primitives/rt.cl has a shade_segs() function that is doing something similar, but obviously not identical to what liboptical is doing
ohh
so what would be the next steps?
Well it just means we have a different set of problems :)
next step would probably be to teach nirt -z
since that way we can get the in/out hit point and normal without involving optics
@Rishabh Suthar what are your thoughts on turning your GSoC report into a formal write-up report? If that's something you'd be interested in, I'd be happy to sponsor and help you with getting it submitted to some technical journal interested in OpenCL/GPGPU conversion.
Regardless, where do we stand on the other patches -- which ones compile cleanly with OpenCL enabled?
Sean said:
Rishabh Suthar what are your thoughts on turning your GSoC report into a formal write-up report? If that's something you'd be interested in, I'd be happy to sponsor and help you with getting it submitted to some technical journal interested in OpenCL/GPGPU conversion.
That'd be indeed be interesting. I've never done this before. Please give me some time while I get back to you on this after clearing out all my upcoming commitments.
Sean said:
Regardless, where do we stand on the other patches -- which ones compile cleanly with OpenCL enabled?
There is one with the bug resolution (551), one with updated FindOpenCL.cmake (549) and the HYP primitive (553) which can be merged in master.
Last updated: Nov 15 2024 at 00:49 UTC