Welcome to Fractal Forums

Fractal Software => Releases => Topic started by: Buddhi on November 16, 2013, 01:40:50 PM




Title: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: Buddhi on November 16, 2013, 01:40:50 PM
Mandelbulber 1.19

Open source program (GNU GPL) for rendering photo-realistic 3D fractals
Free download (executables and source): http://sourceforge.net/projects/mandelbulber/
Website:       http://www.mandelbulber.com/
User manual: http://wiki.mandelbulber.com/index.php?title=User_Manual

New features in version 1.19:

- OpenCL - added management for user defined formulas
- added showing of light animation paths in image window
- improved algorithm for fake lights based on orbit traps
- OpenCL - implemented fake lights in "full" kernel
- OpenCL - added error handling and messages for most of errors. Program is not terminated when error occurs
- OpenCL - added setting for max GPU memory intended to use with OpenCL. Can be helpful when program cannot detect available memory.
- added quit confirmation dialog
- OpenCL - added selection for OpenCL platform, device and switching between use of GPU or CPU
- added loading at program startup and saving at program exit of several application settings
- added error handling for lack of memory errors
- fixed bug: when in NetRender the client was enabled there was not possible to close the program
- fixed bug: applied patches for memory leaks

SVN repository: http://mandelbulber.googlecode.com/svn/trunk/
This repository is available from Google Code: http://code.google.com/p/mandelbulber/


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: lukesleftleg on November 17, 2013, 10:26:59 AM
Oh wow! New version!
Gimme gimme gimme!  :D

Thanks Buddhi. You are good to us. :)


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: Buddhi on November 23, 2013, 03:17:39 PM
no feedback.... so it works fine... or no interest?


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: lukesleftleg on November 23, 2013, 06:55:27 PM
Sorry Buddhi, I was waiting for someone with more experience than myself to say something about the user formulas before I pitched in.

I've had a brief play with the user formulas, but I haven't gotten all that far with them, so I'd like to wait to see what others have to say about them, but the system does seem pretty powerful.

Just out of curiosity though, did you have to write a whole compiler extension (tokeniser, lexer, parser, code gen, etc.) from scratch, or was it part of a library or something? It's something I might like to do myself at some point, but I've no idea what to search for on Google on the subject.

As for the crashes, it does seem noticeably more stable, and the error reports help.

I've managed to identify one particular crash on my system. When trying to render any kind of Mandelbox, it crashes if I enable AO (as opposed to SSAO), but only when the camera is outside of the box. It seems to be quite happy doing proper grown-up AO from inside.

That crash gives me this error:
ERROR: ComamndQueue::finish() - Kernel (-36)

There's another crash, but so far, I haven't been able to identify exactly what it doesn't like. Just certain frames of an animation I'm doing.

ERROR: ComamndQueue::enqueueReadBuffer() (-36)
For that one.

Oh, here we go. This frame is the culprit. I don't know if it's any help, but here's the settings:
Code:
Mandelbulber 1.1899999999999999;
image_width 2560;
image_height 1440;
view_point_x -4.4299999999999997;
view_point_y -4.6600000000000001;
view_point_z -5;
angle_alfa -13.467000000000001;
angle_beta 0;
zoom 3.703703703703704e-009;
perspective 0.75;
formula 8;
quality 2;
ambient_occlusion 1.5;
background_color_1_G 0;
background_color_1_B 0;
background_color_2_R 0;
background_color_2_G 0;
background_color_2_B 0;
background_color_1_G 0;
background_color_1_B 0;
coloring_speed 300;
coloring_palette_offset 57.799999999999997;
main_light_intensity 1.5;
main_light_alfa 0.52359877559829882;
main_light_beta 0.52359877559829882;
start_frame 434;
end_frame 1800;
fish_eye 1;
mandelbox_color_X 0;
mandelbox_color_Y 0;
mandelbox_color_Z 0;
view_distance_max 52.398030754403003;

Other than that, great work Buddhi, and thank you very much for putting the power in the hands of the people (formula wise).
I'm intrigued to see what other people come up with, and looking forward hopefully to learning a thing or two about fractal formulas. :)

Edit: I've just noticed that the above crash seems to happen as the raymarcher crosses the centre line of the image, which is actually looking straight down a long line of fractal repetitions that are getting particularly detailed in that 'spinning off to infinity' way that fractals do. The frames either side of it seem perfectly happy. Don't know if that's any help.


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: quaz0r on November 24, 2013, 12:05:18 AM
its a real nice release.  just out of curiosity, somewhere along the way i think you decided to change the opencl rendering from double precision to single precision to increase compatibility?  maybe there could be another option added to the opencl tab to choose single or double precision?  or functionality to autodetect whether your card can do double precision?


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: mclarekin on November 24, 2013, 07:54:20 AM
@ Buddhi. Plenty of interest but I'm still way back on the learning curve and lack OpenCL  graphic card. But a big thanks for the increases in rendering time from 1.12 to 1.18, and the old, but new to me, reflective water and ray traced reflections which I am just now learning to use.


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: Buddhi on November 24, 2013, 09:41:57 AM
its a real nice release.  just out of curiosity, somewhere along the way i think you decided to change the opencl rendering from double precision to single precision to increase compatibility?  maybe there could be another option added to the opencl tab to choose single or double precision?  or functionality to autodetect whether your card can do double precision?

I tried with double precission on ATI Radeon HD 7850 and even on this one it worked much slower than on CPU. Other problem is compiler fails on more complex OpenCL kernels with doubles (lack of GPU registers). For now I have no hardware capabilities to develop and test this functionality.


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: quaz0r on November 24, 2013, 10:00:50 AM
ah ok i see.


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: lukesleftleg on November 24, 2013, 08:43:29 PM
Hi Buddhi,

I'm not sure this is the best place to ask, but I didn't want to start a whole new thread for something relatively trivial.

Maybe I haven't looked hard enough, but is there any way to enable OpenCL mode from the command line?

There doesn't appear to be the option in the README, and I was thinking maybe something with the "-o key=value" switch, but I can't find anything in the defaults file or mandelbulber_cl_data.h that looks like it would do it.

I've got an idea for an animation that would require rendering a number of different timelines, and the best way to do it would be to set up a batch file or script of some kind to run Mandelbulber from the command line. I want to use proper AO for this one though, and so it's going to take forever if I can't use OpenCL (about eight minutes per frame even with OpenCL on my system :o ).

If it's not currently possible, could I request an 'Enable OpenCL' command-line switch for a future version please?


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: Buddhi on November 24, 2013, 09:43:05 PM
Hi Buddhi,

I'm not sure this is the best place to ask, but I didn't want to start a whole new thread for something relatively trivial.

Maybe I haven't looked hard enough, but is there any way to enable OpenCL mode from the command line?

There doesn't appear to be the option in the README, and I was thinking maybe something with the "-o key=value" switch, but I can't find anything in the defaults file or mandelbulber_cl_data.h that looks like it would do it.

I've got an idea for an animation that would require rendering a number of different timelines, and the best way to do it would be to set up a batch file or script of some kind to run Mandelbulber from the command line. I want to use proper AO for this one though, and so it's going to take forever if I can't use OpenCL (about eight minutes per frame even with OpenCL on my system :o ).

If it's not currently possible, could I request an 'Enable OpenCL' command-line switch for a future version please?

Now OpenCL support doesn't work from command line. It will be in future, but I can't tell you when.


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: lukesleftleg on November 24, 2013, 10:09:01 PM
Now OpenCL support doesn't work from command line. It will be in future, but I can't tell you when.
Oh no worries then. I'll just think up some other ideas in the meantime.
Thanks Buddhi. :)


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: lukesleftleg on November 25, 2013, 03:42:18 PM
Sorry for the double post, but it's a slightly different subject.

I've got to the bottom of one of the crashes I described above, and it's completely my own stupid fault.

I had 'Max GPU mem to use' set to 512mb. Despite the fact that nVidia's site says I have 1024mb on this card, the random crash seems to have gone away now that I've put it back to the default of 256mb.

I'm afraid the 'proper AO from outside the box' thing still crashes, but the random one seems to be sorted.

Anyway, please excuse my ignorance.  :embarrass:


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: knighty on November 25, 2013, 04:31:31 PM
Nice to see new versions of mandelbulber. Keep up the good work Buddhi.


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: R-TEAM on December 14, 2013, 10:29:07 PM
Hi,

Very nice programm :)
But - cant get the OpenCL part running .... LOG :
Code:
Log file: log.txt
Detected 12 CPUs
Memory allocated
g_thread already initialised or not supported
Default data directory: C:\Users\xxxxx/mandelbulber
Undo status: count=98, last=147, level=147
Default settings loaded successfully (C:\Program Files\Mandelbulber\examples/def
ault.fract)
CL_SUCCESS
Custom formulas path: C:\Users\xxxxx/mandelbulber/custom_ocl_formulas
OpenCL Platform number is: 1
OpenCL Platform is by: Advanced Micro Devices, Inc.
AMD OpenCL library is detected
OpenCL contexts created
OpenCL Number of compute units: 10
OpenCL Max work item dimmensions: 3
OpenCL Max work group size: 256
OpenCL Max clock frequency  750 MHz
OpenCL Memory size  512 MB
OpenCL Max size of memory object allocation 512 MB
OpenCL Max constant buffer size  64 kB
OpenCL Constant buffer used  2 kB
OpenCL Number of loaded sources 7
OpenCL build params:-w -I"C:\Program Files\Mandelbulber\cl"
OpenCL Build log:       Invalid option: Files\Mandelbulber\cl"  (expected - at t
he beginning)

ERROR: Program::build() (-43)
Have Win 7 Pro 64 SP1 All Updates,German
Lenovo S20 Xeon w3690 CPU - 16GB RAM
AMD FirePro V8700 1GB RAM - Latest driver.

OpenCL runs fine in other apps (Maya as example..)

Regards
R-TEAM


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: hobold on December 15, 2013, 12:41:43 AM
From the diagnostic output it seems the invocation of the OpenCL compiler gets confused by a whitespace in the path of the kernel program source file. And that despite the double quotes. Hm. :-/


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: Buddhi on December 15, 2013, 10:54:13 AM
I have tried all possible methods to avoid this problem (double quotes, put files into program folder...). This is known bug in OpenCL compiler. Till yesterday I knew that it was only for nVidia driver. But now I see that it also happens for AMD. The worst is that I can't reproduce this problem on my machine (it uses double quotes properly - AMD under Vista). I also took into consideration to load mandelbulber_cl_data.h file in the same way like other files. Unfortunately this method will make difficult debugging the code (numbers of code lines will be wrong when compile error occurs). I also can't hardcode path in #include command, because under different systems this path can be different.
Only idea what I can change is location of includes. What will be the best folder under Windows instead of "Program files" which has no spaces in path?


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: R-TEAM on December 15, 2013, 10:54:25 PM
Hi,

have the exactly same problem on my second workstation (IBM QuadCore) with Win7Pro64SP1 too...
(GFX Card here an AMD HD4850 - so an different driver)
Maybe Win7 related ? (or the German version ? )

Regards
R-TEAM


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: R-TEAM on December 15, 2013, 10:57:06 PM
Hi,

......What will be the best folder under Windows instead of "Program files" which has no spaces in path?


Simply - create an folder (like OpenCL directly on C:\ -> C:\OpenCL ) - if the known problem is gone with the compiler, the folder can be deleted/moved back to the programm folder ...

Regards
R-TEAM


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: JohnVV on December 16, 2013, 07:56:25 AM
Not just "no blank spaces" but under win7 people have been having all kinds of major problems with MS's " Program Files" and windows royally messed up UAC ( read as FUBAR'ed UAC )

non "Administrator" accounts sometimes can not write to the program folder if it is in "Program Files"

a good option might be
C:\\Mandelbulber
or
C:\\MandelbulberOpenCL
or ( if you do not want to type a long name into "cmd.exe"  or did not turn on "Open CMD here" in win7 )
C:\\MCL


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: Buddhi on December 17, 2013, 09:11:37 PM
I have developed some nice workaround for this problem. I read in many forums that there is not possible to pass any parameter with spaces for OpenCL compiler (e.g. -I include path, -D define....). I started to look for alternative way to put something directly but dynamically into code. I use following method:

- in OpenCL kernel instead of #include "mandelbulber_cl_data.h" I use macro #include INCLUDE_PATH_CL_DATA
- in C++ code I stitch following header before first file with the code: #define INCLUDE_PATH_CL_DATA "/usr/share/mandelbulber/cl/mandelbulber_cl_data.h" (or some other, depends on OS and program folder path)
- additionally first line of the kernel code is modified to stat with double slash (//*********************). Then "#define..." will be in the first line of kernel code and don't make any additional line. So when there will be any compiler error I will still have proper line numbers.

This method passed first trials, so it looks promising



Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: mclarekin on December 18, 2013, 04:36:17 AM
Buddhi. Cant wait to try it out as I too have been stopped by error -43 on AMD A10-5800GHz Radeon HD 7660D, plus my crappy laptop AMD. I had wondered why in GPU Caps Viewer the Open CL demos worked but Mandelbulber wouldn't compile.


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: R-TEAM on December 18, 2013, 03:08:39 PM
Hi,

yea - an nice running OpenCL part would be nice - for next year an GFX Card upgrade to S10000 is planed ... and the beast need numbers to crunch :P

Regards
R-TEAM


Title: Re: Mandelbulber 1.19 - OpenCL - user defined formulas management
Post by: Buddhi on December 28, 2013, 09:48:46 AM
This method to fix the problem with include path works well (tested under Linux with AMD and nVidia and under Win Vista with AMD). I think it is good information for all nVidia users (some AMD also). Today I released version 1.20 which should work properly with OpenCL under Windows.
Visit and comment in new thread: http://www.fractalforums.com/releases-b233/re-mandelbulber-1-20/msg69690/#new