(Solved) OpenCL double precision in release 2.2.13

  • 11 Replies
  • 294 Views

0 Members and 1 Guest are viewing this topic.

Offline piotrv

  • *
  • Fractal Freshman
  • *
  • Posts: 5
« on: March 31, 2018, 11:09:47 PM »
Rendering in OpenCL modi limited | full returns an error:
Code: [Select]
Error: Error during compilation of OpenCL program
OpenCL Build log:
<kernel>:80:9: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
                        for (double r = 1.0; r < quality; r += rRandom)

This issue is with OpenCL 1.1 which needs to have cl_khr_fp64 enabled to support double

Code: [Select]
qmake --version
QMake version 3.1
Using Qt version 5.9.4 in /opt/qt59/lib

clinfo | grep   " OpenCL"
  Platform Version                                OpenCL 1.2 CUDA 9.0.368
  Device Version                                  OpenCL 1.1 CUDA
  Device OpenCL C Version                         OpenCL C 1.1
    Run OpenCL kernels                            Yes
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Profile                              OpenCL 1.2
NOTE: your OpenCL library declares to support OpenCL 1.2,
but it seems to support up to OpenCL 2.1 too.

In Program Preferences | OpenCL Precision: single

So why this error still ?

I also tried to run with precision overridden, i.e.
 
Code: [Select]
mandelbulber2 --override opencl_precision=singlebut it doesn't make any difference.

It's an older Dell i7 laptop and obviously I didn't had this issue with release <= 2.2.12.1
« Last Edit: April 03, 2018, 10:56:15 AM by piotrv »

Offline buddhi

  • *
  • Fractal Phenom
  • ****
  • Posts: 53
    • Mandelbulber GitHub repository
« Reply #1 on: April 01, 2018, 07:23:21 AM »
Thanks for reporting this problem.
It's a small mistake is the code
Should be
for (double r = 1.0f; ......

1.0 is declared as a double precision. This fails with old gfx drivers.

I will release corrected package in next few days.

Offline buddhi

  • *
  • Fractal Phenom
  • ****
  • Posts: 53
    • Mandelbulber GitHub repository
« Reply #2 on: April 02, 2018, 10:34:19 AM »
I have prepared package with patch for testing:

https://drive.google.com/file/d/1c0pHuriZ7TqWQBbe3ZQQW7CigCMz6LbD/view?usp=sharing

Can you download it and test on your system?

Offline piotrv

  • *
  • Fractal Freshman
  • *
  • Posts: 5
« Reply #3 on: April 02, 2018, 07:49:26 PM »
I have prepared package with patch for testing:
Can you test on your system?

Thanks for your effort, Buddhi.
Unfortunately 1.0f seems to make no difference :

Code: [Select]
Error: Error during compilation of OpenCL program
OpenCL Build log:
<kernel>:80:9: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
                        for (double r = 1.0f; r < quality; r += rRandom)

Offline buddhi

  • *
  • Fractal Phenom
  • ****
  • Posts: 53
    • Mandelbulber GitHub repository
« Reply #4 on: April 02, 2018, 08:26:45 PM »
I was probably blind when I checked the code  :embarrass:

It was obvious that
for (double r = 1.0f; r < quality; r += rRandom)
cannot work

I was focused only on double precision constants.

Here is new package for testing:
https://drive.google.com/file/d/19H3dalu946bKfvxPOV0Xr7QQnQE_i1bZ/view?usp=sharing

Offline piotrv

  • *
  • Fractal Freshman
  • *
  • Posts: 5
« Reply #5 on: April 03, 2018, 10:59:57 AM »
I was probably blind when I checked the code  :embarrass:
I didn't have the guts to tell you  ;D

Problem solved. Super !

Offline Micha1982

  • *
  • Fractal Phenom
  • ****
  • Posts: 48
« Reply #6 on: April 10, 2018, 02:40:20 PM »
Regarding double precision in general, wouldnt it be possible to activate that cl_khr_fp64-extension and use double-precision for OpenCL at all in Mandelbulber (having my pixels in mind for example or whatever else it is being used for)? For sure it may not so fast as single-precision, but maybe still faster than a cpu...or is that no possible?

Offline hobold

  • *
  • Fractal Fanatic
  • ***
  • Posts: 39
« Reply #7 on: April 10, 2018, 04:52:56 PM »
Regarding double precision in general, wouldnt it be possible to activate that cl_khr_fp64-extension and use double-precision for OpenCL at all in Mandelbulber (having my pixels in mind for example or whatever else it is being used for)? For sure it may not so fast as single-precision, but maybe still faster than a cpu...or is that no possible?
Not all GPUs support double precision; some simply do not have the capability. And those GPUs which are capable of double precision are either not very good at it (at say, 1/32 the performance of single precision) or extremely expensive models tailored to compute tasks.

There are a few exceptions. For example, the good old Radeon HD 5870 performs double precision computations at 1/4 the performance of its single precision capability. In contrast, the much newer Radeon Vega 56 only offers 1/16 throughput for double precision, so the old HD 5870 can, in principle, keep up.

Nvidia differentiates their product lines even more strongly; their consumer GPUs generally offer double precision at 1/32 throughput, if at all.

To put this into perspective, let's compare CPUs and GPUs with respect to their double precision throughput. For example, AMD's new entry level processor "Ryzen 3 2200G" combines four Ryzen cores with eight Radeon Vega compute units. The integrated GPU has roughly the same double precision throughput as the four processor cores together. If you compare to an eight core "Ryzen 7" model without GPU, you end up with roughly the same double precision throughput using roughly the same amount of silicon.

A Radeon Vega 64 GPU is eight times more capable than the integrated GPU on the little processor. So it roughly delivers the double precision throughput of 8*4 = 32 Ryzen cores (that would be a high end EPYC processor for servers).

Long story short: if you do have a nice GPU, it is definitely worth using for double precision computations. But it will "only" be maybe two to three times faster than your CPU, not 10s or 100s of times as you might have hoped for.

Offline Micha1982

  • *
  • Fractal Phenom
  • ****
  • Posts: 48
« Reply #8 on: April 10, 2018, 06:02:55 PM »
But it will "only" be maybe two to three times faster than your CPU, not 10s or 100s of times as you might have hoped for.
1-2 days rendering or only a half day makes a big difference...

Not all GPUs support double precision; some simply do not have the capability.
I dont know which one exactly does not support it, i suspect older ones or Amd maybe...on the quick I found just things like "Every GPU with SM 1.3 (Tesla/GTX2xx) or better has hardware double-precision support.", "NVIDIA processors in particular have had double-precision support for years"...dont know how hard it would be to integrate but could single/doubleprecision not being made switchable as an options?

Anyway, it would be great if the missing things would be ported to OpenCL first at all...singleprecision-OpenCL is still much better in my opinion than render on a/my cpus
 

 

Offline buddhi

  • *
  • Fractal Phenom
  • ****
  • Posts: 53
    • Mandelbulber GitHub repository
« Reply #9 on: April 13, 2018, 08:58:35 PM »
Micha1982, you are right that most of modern GFX cards support double precision but even GTX 1080 is 32 times slower for double precision than for single.
This very expensive GFX card is only two times faster for double precision than i7 (in theory) and two times more expensive.
But I'm not sure if this number of GFLOPS is achievable for such a big rendering kernels like are used in Mandelbulber.
Reference information: https://en.wikipedia.org/wiki/GeForce_10_series


Offline Micha1982

  • *
  • Fractal Phenom
  • ****
  • Posts: 48
« Reply #10 on: April 16, 2018, 10:23:20 AM »
That may be correct...but faster is faster, not matter how much. As said, 1 day or half a day 'sometimes' make a big difference. For sure it is not as fast as as SP...but nevertheless faster in most cases than on most cpus. And if not, for the other cases where its still possible to switch to cpu. And if not, I dont know if or how it could be made be possible, but maybe a switch in the option could be made for the cases where Doubleprecision really makes no sense/to use only Singleprecision on GPU...just an idea...

Offline mclarekin

  • *
  • Fractal Furball
  • ***
  • Posts: 206
« Reply #11 on: April 16, 2018, 02:58:42 PM »
Double precision is likely to be implemented in the future. We have quite a few months of necessary work ahead of us and our programming time is limited, (also in my case, the programming time and ability is limited).


xx
Birdie Style

Started by gannjondal on Fractal Image Gallery

1 Replies
107 Views
Last post May 08, 2018, 02:39:37 PM
by who8mypnuts
xx
(Solved) Click image to open link not working

Started by Anon on Testing-Area

9 Replies
563 Views
Last post February 14, 2018, 06:15:02 AM
by Anon
xx
compile errors with release 2-2.13.

Started by piotrv on Mandelbulber

3 Replies
111 Views
Last post April 01, 2018, 07:42:03 AM
by buddhi
clip
Effect of floating point precision on Mandelbrot calculations

Started by timhume on Fractal Mathematics And New Theories

5 Replies
178 Views
Last post February 27, 2018, 01:35:08 AM
by claude
xx
"Pollination; Crowded Release"

Started by cricke49 on Fractal Image Gallery

0 Replies
36 Views
Last post February 27, 2018, 02:14:18 AM
by cricke49