• March 02, 2021, 06:33:34 PM

Login with username, password and session length

Author Topic:  Kalles Fraktaler 2.15  (Read 4708 times)

0 Members and 1 Guest are viewing this topic.

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
Kalles Fraktaler 2.15
« on: October 14, 2020, 04:17:06 PM »
I started work some months ago on a new kf-2.15 branch for more experimental features, now that 2.14 is stable (it will still have bugfixes for a while longer, so please continue to report bugs in the kf-2.14 thread).

It's not quite ready for release yet (needs more testing and there are some annoying behaviours in places; if you want to help beta-test a preview then get in touch), but hopefully this month.

Latest downloads for this branch will be found at: https://mathr.co.uk/kf/kf.html#kf-2.15
Browse the code in this branch at: https://code.mathr.co.uk/kalles-fraktaler-2/shortlog/refs/heads/kf-2.15

Change log highlights so far:
    - hybrid formula editor (design your own fractal formula)
    - OpenCL support for all formulas including hybrids (requires fp64 double precision on device, may or may not be faster, expect further speed improvements in later versions)
    - exponential map coordinate transformation (for export to zoomasm for efficient zoom video assembly)
    - rotation and skew transformations are rewritten to be more flexible (you can now rotate independently of skew)
      (old skewed/rotated KFR locations will not load correctly, I may try to fix this at some point, use kf-2.14 for these until then)
    - kf-tile.exe tool has new  --auto, --adjacent, --stratify  flags to specify tiling mode
    - kf-tile.exe tool supports the new rotation and skew transformations in both stratified and adjacent modes
    - the bitrotten skew animation feature is removed (it may come back as an external tool similar to kf-tile.exe)
    - flip imaginary part of Buffalo power 2 (to match other powers; derivative was flipped already)
    - slope implementation rewritten (appearance is different but it is now independent of zoom level and iteration count)
    - smooth (log) iteration count is offset so dwell bands match up with the phase channel

Roadmap:
    - trying again to get OpenCL working, getting there slowly (have images now, but they differ slightly from the original code - at least OpenCL GPU and OpenCL CPU are the same...) DONE
    - OpenCL should be a bigger win with hybrid formulas (not yet implemented) because at the moment they are much slower than the built in ones (roughly 5x slower for a Buffalo)DONE
    - (maybe later) custom OpenGL GLSL colouring support, with compatibility with zoomasm shader snippets


Preliminary benchmarks at 256x256 image size for regular CPU (without SIMD) vs OpenCL CPU for Mandelbrot power 2 on an ancient Intel Core2Duo laptop with CPU frequency scaling governor set to powersave to avoid overheating/throttling:
Code: [Select]
#       regular cpu     opencl cpu
# loc   refs    time    refs    time
1e14    7       10.73   7       5.57
1e50    13      68.68   7       70.50
5e113   7       9.79    4       10.06
5e227   18      420.09  18      464.43
4e533   4       27.22   3       25.14
1e1086  7       260.50  6       3995.23*
# * so much slower because there is no long double in OpenCL and it has to use floatexp
A bit disappointing, moreover the OpenCL uses almost 2x the memory because (so far) it copies to/from device instead of mapping.  Need to add aligned memory allocation for host buffers, then use mapping, and it might get a bit faster.


Another benchmark:

CPU: AMD Ryzen 7 2700X
GPU: AMD Radeon RX 580
Buffalo power 2, unzoomed, 1920x1080 image size, 10k iterations (1 reference needed).
Code: [Select]
# formula derivatives device  seconds w/ guessing  seconds w/o guessing  seconds w/o guessing (100k iterations)
builtin noderivatives cpu     0.63    1.32    9.92
builtin noderivatives cpu/cl          1.77    17.8
builtin noderivatives gpu/cl          0.41    3.24
builtin derivatives   cpu     0.94    2.68    23.1
builtin derivatives   cpu/cl          3.54    35.7
builtin derivatives   gpu/cl          0.71    6.51
hybrid  noderivatives cpu     1.43    4.37    40.1
hybrid  noderivatives cpu/cl          3.71    35.3
hybrid  noderivatives gpu/cl          0.62    5.22
hybrid  derivatives   cpu     3.61    12.9    125
hybrid  derivatives   cpu/cl          5.52    54.4
hybrid  derivatives   gpu/cl          1.22    14.9

Conclusions:
- CPU: guessing does well when there is high iteration count and lots of interior, cutting the time taken to as little as 1/4 (OpenCL does not yet support guessing)
- CPU/OpenCL is only better than regular CPU for hybrids
- GPU/OpenCL (via ROCm) does very well
- overhead of hybrid (vs builtin) is 3x-4x for original CPU, falling to 1.5x-2.3x for OpenCL (hopefully the OpenCL hybrid vs builtin overhead can be reduced further in future)
- overhead of derivatives (vs no derivatives) is 3x for CPU, falling to 2x (builtin) or 1.5x-2.7x (hybrid) for OpenCL
- the first time the formula is compiled for an OpenCL device gives a ~5second additional overhead, but subsequent images are unaffected due to caching of kernels

EDIT
the above benchmarks were originally too favourable to the CPU version, because that supports Guessing (the OpenCL version does not yet support guessing) and there is a fair amount of interior.  The added column shows times without guessing enabled on the CPU


Linkback: https://fractalforums.org/kalles-fraktaler/15/kalles-fraktaler-2-15/3813/
« Last Edit: October 21, 2020, 09:23:59 PM by claude, Reason: updated benchmarks »

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
Kalles Fraktaler 2.15.1 released
« Reply #1 on: October 28, 2020, 06:42:49 PM »
kf-2.15.1 released
with OpenCL acceleration, hybrid formula designer, exponential map, and more
get it from https://mathr.co.uk/kf/kf.html#kf-2.15.1

  -  OpenCL support for perturbation iterations (requires double precision support on device: CPUs should work, some GPUs might not)
  -  hybrid formula editor (design your own fractal formula)
  -  exponential map coordinate transformation (useful for export to *zoomasm* for efficient video assembly)
  -  rotation and skew transformations are rewritten to be more flexible (but old skewed/rotated KFR locations will not load correctly)
  -  kf-tile.exe tool supports the new rotation and skew transformations
  -  the bitrotten skew animation feature is removed
  -  a few speed changes in built in formulas (one example, RedShiftRider 4 with derivatives is almost 2x faster due to using complex analytic derivatives instead of 2x2 Jacobian matrix derivatives)
  -  flip imaginary part of Buffalo power 2 (to match other powers; derivative was flipped already)
  -  slope implementation rewritten (appearance is different but it is now independent of zoom level and iteration count)
  -  smooth (log) iteration count is offset so dwell bands match up with the phase channel

donations to support my work are welcome via https://mathr.co.uk/kf/kf.html#donate

Offline gerrit

  • 3f
  • ******
  • Posts: 2333
Re: Kalles Fraktaler 2.15.1 released
« Reply #2 on: October 28, 2020, 09:27:41 PM »
  -  exponential map coordinate transformation (useful for export to *zoomasm* for efficient video assembly)
Could you provide a link to zoomasm on the webpage?

Bug: start program, C-W set 400X400 C-SHift-W set 400X400 --> crash.

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
Re: Kalles Fraktaler 2.15
« Reply #3 on: October 28, 2020, 09:45:49 PM »
There is a known bug with OpenCL and certain NVIDIA GPUs (program exits with error log printed to nowhere, unless you started from MSYS shell).  Hopefully the fix is not hard and I'll release a new version later tonight.

zoomasm lives at https://mathr.co.uk/zoomasm it's also linked from the manual https://mathr.co.uk/kf/manual.html#third-party-software  I will update the website to add a link in the release notes, thanks for the idea.

Cannot reproduce the 400x400 bug (it works fine here on three machines running various versions of Debian, XFCE, Wine).  Can you try starting KF from MSYS terminal shell and seeing if anything is printed?  Do you have any unusual system configuration (maybe DPI or scaling or something is confusing KF)?

EDIT I can produce a crash by Ctrl-W 400x400 Ctrl-Shift-W 4000x4000 Ctrl-Shift-W 40x40, so I think there is a real bug here lurking, and I think I know which changes are to blame (I tried to implement a std::aligned_alloc() version by hand because MinGW in Debian doesn't yet support it, probably I got something wrong there...)
« Last Edit: October 28, 2020, 10:17:37 PM by claude, Reason: bug »

Offline FractalAlex

  • Fractal Frogurt
  • ******
  • Posts: 487
  • Experienced root-finding method expert
Re: Kalles Fraktaler 2.15
« Reply #4 on: October 28, 2020, 09:54:05 PM »
To Claude:

In the documentation, Arbitrary size refers to being able to change the window size without having to deal with a fixed window ratio. Enabling that will also allow you to enlarge the window to the entire screen.
"I am lightning, the rain transformed."
- Raiden, Metal Gear Solid 4: Guns of the Patriots

Offline gerrit

  • 3f
  • ******
  • Posts: 2333
Re: Kalles Fraktaler 2.15
« Reply #5 on: October 28, 2020, 10:05:20 PM »
Can you try starting KF from MSYS terminal shell and seeing if anything is printed?  Do you have any unusual system configuration (maybe DPI or scaling or something is confusing KF)?
Nothing printed to terminal, nothing weird here.

Can simplify the bug: just try to C-Ch-W to 320X180, crashes.

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
Re: Kalles Fraktaler 2.15
« Reply #6 on: October 28, 2020, 10:18:06 PM »
I can produce a crash by Ctrl-W 400x400 Ctrl-Shift-W 4000x4000 Ctrl-Shift-W 40x40, so I think there is a real bug here lurking, and I think I know which changes are to blame (I tried to implement a std::aligned_alloc() version by hand because MinGW in Debian doesn't yet support it, probably I got something wrong there...).  Thanks for the report!

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
Kalles Fraktaler 2.15.1.1 released
« Reply #7 on: October 28, 2020, 11:30:46 PM »
kf-2.15.1.1 released
with bugfixes
get it from https://mathr.co.uk/kf/kf.html#kf-2.15.1.1

- fix OpenCL support for NVIDIA GPUs (thanks bezo97)
- fix crash in aligned memory (de)allocation (thanks gerrit)
- documentation improvements (thanks FractalAlex)

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
making fractal zoom videos with kf 2.15 and zoomasm 1.0
« Reply #8 on: October 29, 2020, 01:12:28 AM »
making fractal zoom videos with kf-2.15 and zoomasm-1.0
Code: [Select]
https://youtu.be/72IIn7C3UeIhttps://archive.org/details/making-fractal-zoom-videos-with-kf-2.15-and-zoomasm-1.0
Quote
Demo of some of the new features of KF-2.15 (hybrid formulas, exponential map transform, and OpenCL acceleration) and assembling zoom videos with zoomasm-1.0.

KF (Kalles Fraktaler) is fast deep zooming Free Software for escape time fractal graphics (Mandelbrot, Burning Ship, etc).  Hybrid fractals combine features of multiple formulas, with a huge potential variety.  The exponential map transform is optimal for rendering zoom animations (much more efficient than frames at 2x zoom levels even if the center portion is reused).  OpenCL allows graphics cards to be used for calculations, which can be faster than the main processor.

zoomasm is a zoom video assembler.  It takes the output of KF's exponential map zoom sequences (a series of EXR images containing raw iteration data), and reprojects them into a sequence of flat frames.  It uses OpenGL shaders for customizable colouring algorithms, and has a timeline for variable speed zoom animation (key moments in the soundtrack can be synchronized to key moments in the zoom sequence).

Offline gerrit

  • 3f
  • ******
  • Posts: 2333
Re: Kalles Fraktaler 2.15
« Reply #9 on: October 29, 2020, 04:56:03 AM »
Super, may be a good idea to add a link to that on the kf2.15 page, this post will slowly (or quickly) fade away.

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
Re: Kalles Fraktaler 2.15
« Reply #10 on: October 29, 2020, 01:42:28 PM »

Offline gerrit

  • 3f
  • ******
  • Posts: 2333
Re: Kalles Fraktaler 2.15
« Reply #11 on: October 30, 2020, 07:11:19 PM »
Downloaded window zoomasm but only got .exe, no presets?

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
Re: Kalles Fraktaler 2.15
« Reply #12 on: October 30, 2020, 07:19:52 PM »
Oh, good point. You can download the source 7z, or use the --source command line flag to extract it from the exe. Then unpack it and hopefully there will be a presets subdirectory of zoomasm-1.0. I'll try to improve the experience in the next version.

Offline gerrit

  • 3f
  • ******
  • Posts: 2333
Re: Kalles Fraktaler 2.15
« Reply #13 on: October 31, 2020, 12:19:33 AM »
I see no "record" button in the output window?

Can we preview in another window, on the GUI makes the GUI hard to see.

I don't understand how the timeline is supposed to work. All I can do is move the sliders labeled 0.000s and 1.0000s. I can't really see what you do on the video. It seems to have something to do with audio? How do you create waypoints?

Haven't gotten anything to work yet but I anticipate wanting png or tiff output of the frames rather than an mp4.

GUess I'll try again when I have more time and patience...

« Last Edit: October 31, 2020, 12:54:58 AM by gerrit »

Offline claude

  • 3f
  • ******
  • Posts: 1787
    • mathr.co.uk
Re: Kalles Fraktaler 2.15
« Reply #14 on: October 31, 2020, 12:55:49 PM »
https://mathr.co.uk/zoomasm/#user-guide should explain. Audio is the source of timing.  Add waypoints with the little + button on the cursor when the audio time is between two waypoints.  Record button appears when everything is ready, perhaps you miss something, ffmpeg.exe path maybe, screenshot should help diagnose.

Good point about visibility. Not sure if multiple OS windows are possible with the toolkit I'm using. Will have a think. Maybe I can add a key press to toggle the transparency.  F10 already toggles GUI. EDIT F9 now toggles GUI transparency, will make a 1.1 release with this and other minor improvements soon.

In the todo list for zoomasm-2.0 is an ffmpeg settings advanced mode which would let you export to image sequences too.
« Last Edit: October 31, 2020, 02:43:27 PM by claude, Reason: F9 »


xx
Kalles Fraktaler 2 + GMP

Started by claude on Kalles Fraktaler

232 Replies
13429 Views
Last post September 12, 2019, 10:27:53 PM
by claude
xx
Kalles Fraktaler 2.13

Started by claude on Kalles Fraktaler

90 Replies
5179 Views
Last post March 20, 2019, 05:32:26 AM
by claude
xx
Kalles Fraktaler 2.14

Started by claude on Kalles Fraktaler

295 Replies
13672 Views
Last post December 08, 2020, 05:12:56 PM
by Dinkydau
xx
Another version of Kalles Fraktaler?

Started by greentexas on Kalles Fraktaler

9 Replies
1306 Views
Last post September 22, 2017, 02:59:16 PM
by greentexas
xx
Kalles Fraktaler Movie Maker64

Started by Bill Snowzell on Fractal movie gallery

0 Replies
387 Views
Last post February 01, 2018, 09:29:04 PM
by Bill Snowzell