RenderKit / embree

Embree ray tracing kernels repository.
Apache License 2.0
2.37k stars 389 forks source link

static scene not deterministic when built with multiple threads #20

Closed evilkalla closed 9 years ago

evilkalla commented 9 years ago

First of all, I want to let your team know that this ray tracer is excellent.

I've been using embree 2.3.3 on Linux to accelerate the ray tracing operations in an electromagnetics solver, which uses static scenes with triangles (using RTC_SCENE_STATIC) for world geometry. Execution of the solver returns slightly different results between runs.

I've tracked this down to the intersection tests for a handful of pixels (using rtcIntersect()) returning different primIDs between runs. Using a small test program I experimented with ray tracing the same scene multiple times. If the same scene object was used, it did not yield different results. Destroying the object and rebuilding the scene between ray traces causes the primIDs to occasionally differ. Digging a little further I forced the scene build to use a single CPU thread with rtcCommitThread(), and the primIDs are again consistent between runs. Is that the intended behavior?

Host system CPU is Intel Core i7-3770 (with avx).

svenwoop commented 9 years ago

This is a bug. Could you please try out the branch v2.3.3.1, there we implemented a fix which solves this issue in most cases.

svenwoop commented 9 years ago

This issue is fixed in Embree v2.5.0 (except for the high_quality mode).