compile options, fast-math on gcc

Hi,

as (according to Mark's benchmarks) more and more people start to use the fast-math switch when compiling using gcc, I want to share my experience that this option, while improving performance, may lead to the mysterious "zero ray direction in localhit" errors. I have experienced those a lot when using this kind of "optimization", which led me to many many restarts of interrupted renderings, and solved the problem using a new compile with more standard-friendly parameters.

Just a hint... CU Lars.

I am ashamed to admit that I just comment out line 516 in raytrace.c to avoid that error.

   //error(CONSISTENCY, "zero ray direction in localhit");

But then, nobody questions the numerical accuracy of my lighting, so I feel somewhat free to experiment.

Mark

···

On Thu, 17 Apr 2008, Lars O. Grobe wrote:

Hi,

as (according to Mark's benchmarks) more and more people start to use the fast-math switch when compiling using gcc, I want to share my experience that this option, while improving performance, may lead to the mysterious "zero ray direction in localhit" errors. I have experienced those a lot when using this kind of "optimization", which led me to many many restarts of interrupted renderings, and solved the problem using a new compile with more standard-friendly parameters.

Just a hint... CU Lars.

This reminds me of one of my favorite hardware fixes. My laptop DAC
makes a hideous buzzing sound when plugged into PA amps at electronic
music venues. Of course, this is due to a ground-loop, but isolators
don't totally eliminate the buzz.

The solution? Cut the ground plug off my AC adapter.

(Sorry for running off-topic... and thanks for the hint, Lars)
DR

···

On Wed, Apr 16, 2008 at 4:17 PM, Mark Stock <[email protected]> wrote:

I am ashamed to admit that I just comment out line 516 in raytrace.c to
avoid that error.

  //error(CONSISTENCY, "zero ray direction in localhit");

But then, nobody questions the numerical accuracy of my lighting, so I feel
somewhat free to experiment.

Mark

On Thu, 17 Apr 2008, Lars O. Grobe wrote:

> Hi,
>
> as (according to Mark's benchmarks) more and more people start to use the
fast-math switch when compiling using gcc, I want to share my experience
that this option, while improving performance, may lead to the mysterious
"zero ray direction in localhit" errors. I have experienced those a lot when
using this kind of "optimization", which led me to many many restarts of
interrupted renderings, and solved the problem using a new compile with more
standard-friendly parameters.
>
> Just a hint... CU Lars.
>
>

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Mark Stock wrote:

I am ashamed to admit that I just comment out line 516 in raytrace.c to avoid that error.

  //error(CONSISTENCY, "zero ray direction in localhit");

Haha! Don't worry Mark, the Bush Administration is doing similar things to the Constitution.

-Rob

The newer versions of GCC actually do a pretty decent job with just
the -O3 optimisation:
http://www.luxal.eu/resources/radiance/benchmark.shtml

While I have to honestly admit that I don't know the 'perfect' compile
switches for my CPU (I borrowed them from Mark's benchmark page, from
what appeared to be a processor similar to mine), the benchmark shows
that setting too many exotic compiler options might actually decrease
the speed a little.

Axel