FractalCL - new application for fractals discovery

  • 9 Replies
  • 185 Views

0 Members and 1 Guest are viewing this topic.

Offline jdanecki

  • *
  • Fractal Freshman
  • *
  • Posts: 6
« on: June 10, 2018, 08:19:31 PM »
Hi,
After some time of experiments I've released initial version of my program to draw and animate fractals. You can find it on github: https://github.com/jdanecki/FractalCL.
At this moment it draws Julia, Mandelbrot, Dragon fractals using SDL. Calculation are made with OpenCL to improve performance.
You can use mouse to zoom in/out, and keyboard to change fractals parameters.
It was tested under Linux and Mac mini, but since Apple deprecated OpenCL support I've removed support for Mac from code and released only version for Linux.
Support for SDL2 is on my todo list.

Offline jdanecki

  • *
  • Fractal Freshman
  • *
  • Posts: 6
« Reply #1 on: July 05, 2018, 03:04:04 PM »
Version 0.0.1 was released on github: https://github.com/jdanecki/FractalCL/releases/tag/v0.0.1
Binary package for Ubuntu 16.04 is available on github and in ppa: https://launchpad.net/~jmdanecki/+archive/ubuntu/fractalcl

Offline Adam Majewski

  • *
  • Strange Attractor
  • ******
  • Posts: 93
« Reply #2 on: July 05, 2018, 05:57:11 PM »
Ubuntu 18.04 LTS

Code: [Select]
@zelman:~/FractalCL/build$ ./FractalCL
found 1 platforms
--- platform: NVIDIA CUDA
OpenCL device: GeForce GTX 770
OpenCL device vendor: NVIDIA Corporation
OpenCL device version: OpenCL 1.2 CUDA
OpenCL driver version: 390.48
OpenCL C version: OpenCL C 1.2
OpenCL device extensions: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer
cl_khr_fp64 supported by device, and enabled in project configuration
OpenCL device type: 4
MAX_COMPUTE_UNITS=8
MAX_WORKGROUP_SIZE=1024
prepare kernels for GeForce GTX 770
preparing kernel0]: julia
preparing kernel1]: mandelbrot
preparing kernel2]: julia_full
preparing kernel3]: dragon
preparing kernel4]: julia3
preparing kernel5]: burning_ship
preparing kernel6]: generalized_celtic
compiling kernels with -w -D HEIGHT_FL=768.000000 -D HEIGHT=768 -D WIDTH_FL=1024.000000 -D WIDTH=1024 -D BPP=4 -D PITCH=4096 -DFP_64_SUPPORT=1 -I/usr/share/FractalCL/kernels
GeForce GTX 770: clBuildProgram returned 0
GeForce GTX 770: ------ compilation log  -----------


julia: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
julia: PRIVATE_MEM=40
mandelbrot: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
mandelbrot: PRIVATE_MEM=40
julia_full: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
julia_full: PRIVATE_MEM=40
dragon: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
dragon: PRIVATE_MEM=32
julia3: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
julia3: PRIVATE_MEM=40
burning_ship: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
burning_ship: PRIVATE_MEM=40
generalized_celtic: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
generalized_celtic: PRIVATE_MEM=40
test_kernel: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
test_kernel: PRIVATE_MEM=0
------------------------------------------
OCL buffer created with size=3145728
GeForce GTX 770: thread exits
a@zelman:~/FractalCL/build$ ./FractalCL


also :
sudo apt-get install libsdl2-gfx-dev


Thx

Adam

see also :
https://pl.wikibooks.org/wiki/Programowanie_w_systemie_UNIX/OpenCL
« Last Edit: July 05, 2018, 06:43:43 PM by Adam Majewski »

Offline Adam Majewski

  • *
  • Strange Attractor
  • ******
  • Posts: 93
« Reply #3 on: July 05, 2018, 06:46:23 PM »
Code: [Select]

a@zelman:~/FractalCL/tests$ ./test_complex
( 1 + i2 ) + ( 3 + i4 ) =  4 + i6
( 1 + i2 ) * ( 3 + i4 ) = -5 + i10
(-5 + i10) / ( 3 + i4 ) =  1 + i2
test passed
a@zelman:~/FractalCL/tests$ ./test_fractal
a@zelman:~/FractalCL/tests$ ./test_kernel.cl
bash: ./test_kernel.cl: Brak dostępu
a@zelman:~/FractalCL/tests$ ./test_ocl
found 1 platforms
--- platform: NVIDIA CUDA
OpenCL device: GeForce GTX 770
OpenCL device vendor: NVIDIA Corporation
OpenCL device version: OpenCL 1.2 CUDA
OpenCL driver version: 390.48
OpenCL C version: OpenCL C 1.2
OpenCL device extensions: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer
cl_khr_fp64 supported by device, and enabled in project configuration
OpenCL device type: 4
MAX_COMPUTE_UNITS=8
MAX_WORKGROUP_SIZE=1024
prepare kernels for GeForce GTX 770
preparing kernel0]: julia
preparing kernel1]: mandelbrot
preparing kernel2]: julia_full
preparing kernel3]: dragon
preparing kernel4]: julia3
preparing kernel5]: burning_ship
preparing kernel6]: generalized_celtic
compiling kernels with -w -D HEIGHT_FL=768.000000 -D HEIGHT=768 -D WIDTH_FL=1024.000000 -D WIDTH=1024 -D BPP=4 -D PITCH=4096 -DFP_64_SUPPORT=1 -I/home/a/FractalCL/tests/kernels
GeForce GTX 770: clBuildProgram returned 0
GeForce GTX 770: ------ compilation log  -----------


julia: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
julia: PRIVATE_MEM=40
mandelbrot: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
mandelbrot: PRIVATE_MEM=40
julia_full: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
julia_full: PRIVATE_MEM=40
dragon: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
dragon: PRIVATE_MEM=32
julia3: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
julia3: PRIVATE_MEM=40
burning_ship: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
burning_ship: PRIVATE_MEM=40
generalized_celtic: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
generalized_celtic: PRIVATE_MEM=40
test_kernel: PREFERRED_WORK_GROUP_SIZE_MULTIPLE=32
test_kernel: PRIVATE_MEM=0
------------------------------------------
ocl kernel for GeForce GTX 770 tid=7f03e0ff9700
execute fractal [test_kernel] on GeForce GTX 770
!!! test_kernel !!!
cl_khr_fp64 defined
finishing test
thread exits for GeForce GTX 770
test result = 0
a@zelman:~/FractalCL/tests$ ./test_sdl
avg time=1297 fps=771
a@zelman:~/FractalCL/tests$ ./test_sdl_render
avg time=4987 fps=200



Offline jdanecki

  • *
  • Fractal Freshman
  • *
  • Posts: 6
« Reply #4 on: July 06, 2018, 03:06:41 AM »
As I can see you've used the latest code from  github not a v.0.0.1 release. Thanks for checking it on Ubuntu 18.04.
Can I ask you for running short performance test on your setup by executing below command (with FP_64_SUPPORT=OFF in configure script)?
Code: [Select]

FractalCL -t -q

I wondering what "avg exec time" you will get.
In .travis.yml file you can find how I build this project, and his dependencies.
My plan is to add deb package for Ubuntu 18.04 in v0.0.2 (at the end of this week).


Offline Adam Majewski

  • *
  • Strange Attractor
  • ******
  • Posts: 93
« Reply #5 on: July 06, 2018, 04:57:25 PM »
Code: [Select]
a@zelman:~/FractalCL/build$ ./FractalCL -t -q
starting performance test with 32000 iterations for device: 0
***********************************************************
name:           GeForce GTX 770
vendor:         NVIDIA Corporation
device version: OpenCL 1.2 CUDA
driver version: 390.48
ocl C version:  OpenCL C 1.2
type:           GPU
extensions:     cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer
--- performance results ---
avg exec time: 270 [us]
***********************************************************



Offline Adam Majewski

  • *
  • Strange Attractor
  • ******
  • Posts: 93
« Reply #6 on: July 06, 2018, 05:00:26 PM »
Quote
As I can see you've used the latest code from  github not a v.0.0.1 release.


Is
   https://github.com/jdanecki/FractalCL/releases/tag/v0.0.1
newer then
  https://github.com/jdanecki/FractalCL
?

Offline jdanecki

  • *
  • Fractal Freshman
  • *
  • Posts: 6
« Reply #7 on: July 06, 2018, 08:16:20 PM »
v0.0.1 is older than master's HEAD
Changes since v0.0.1on master branch:
Code: [Select]
# git log --oneline v0.0.1..HEAD
ec64d6f (HEAD -> master, origin/master) add result for Geforce GTX 770
c20ad43 test_fractal update
cbb0a8e ci: switch testing to Ubuntu 16.04
315077f add new tests
a41aaf1 fix typo
d1fe74b add new color palette
ddf3fd4 new interface
61ca6b3 Add support for OpenCL devices without cl_khr_fp64
d6aa23a unify kernels parameters
ff7d43c Add information about performance results
10e7a71 add results for Nvidia Geforce GTX 1050Ti
9a59c1c fix middle mouse button action
9a6c1db Enable SDL_ACCELERATION by default

I've created this release to prepare binary package. Once package was ready I've started working on new release.
Thanks for performance result, I've added it to my small database on github.
I've also added link to new Intel OpenCL GPU runtime project on your wiki page. I hope you don't mind if I add some additional information's on your wiki.

Offline Adam Majewski

  • *
  • Strange Attractor
  • ******
  • Posts: 93
« Reply #8 on: July 06, 2018, 10:03:09 PM »
you are welcome to modify wikibooks. If you want you can create more pages, wiki of your program, as you wish (:-))

Offline jdanecki

  • *
  • Fractal Freshman
  • *
  • Posts: 6
« Reply #9 on: July 08, 2018, 02:48:03 AM »
Version 0.0.2 was released on github: https://github.com/jdanecki/FractalCL/releases/tag/v0.0.2

Major changes:

  • Fixed middle button action
  • Implemented new interface (simpler keyboard usage)
  • Fixed support for devices without cl_khr_fp64, when FP_64_SUPPORT=ON
  • Added new color palette
  • New tests added
  • Tricorn fractal added
  • Added CI for Ubuntu 16.04/18.04, Arch, Fedora 27/28

Binary packages for Ubuntu 16.04 and Ubuntu 18.04 are available on Launchpad https://launchpad.net/~jmdanecki/+archive/ubuntu/fractalcl


clip
Julofi's fractals

Started by julofi on Image Threads

52 Replies
1446 Views
Last post August 28, 2018, 01:08:54 PM
by julofi
clip
Lyapunov fractals

Started by ThunderboltPagoda on Image Threads

27 Replies
579 Views
Last post Yesterday at 10:37:07 PM
by ThunderboltPagoda
clip
Classic fractals

Started by utak3r on Synthclipse

4 Replies
196 Views
Last post March 06, 2018, 11:15:34 PM
by utak3r
xx
Another way to see the inner beauty of fractals

Started by kohlenstoff on Fractal movie gallery

0 Replies
41 Views
Last post August 28, 2018, 11:12:37 PM
by kohlenstoff
xx
Fractals in radar

Started by v on Physics

2 Replies
391 Views
Last post September 29, 2017, 02:44:06 AM
by v