14

I have a technical question, which maybe someone with a render engine coding background can answer:

Assume we give two PCs with fairly different hardware specs (e.g. one has a dedicated graphics card and the other not) the same blend file. The blend file is then rendered without denoising on both machines. Of course, they will take different times to finish the rendering. But after rendering, we look at the pixel data of both render results: Will it be 100% identical?

To be more precise: If we calculate a hash value (e.g. SHA256), will the result be identical for both images?

reg.cs
  • 488
  • 3
  • 11
  • It's probably worth mentioning that in case of utilized path and ray tracing randomly distributed vectors are used. That's why the noise is usually different for rendering the same scene twice, unless you specify a fixed seed with some Python trickery. – Num Lock May 09 '22 at 08:19
  • Yeah, thanks for mentioning this. I was also thinking about the noise. But as I understood it, it works the other way around: It’s usually static but with randomizing the seed, you can change it. – reg.cs May 09 '22 at 08:22

2 Answers2

15

In a perfect world, with bug-free software and bug-free hardware, the hashes would be identical. In the real world, both hardware and software have bugs, and you're also coping with floating point differences between hardware implementations.

From the point of view of this retired hardware and software developer, they answer is "I wish, but not necessarily."

That said, the differences are usually very small.

Marty Fouts
  • 33,070
  • 10
  • 35
  • 79
  • I see, thanks for sharing your experience. Would you agree to @lwswl‘s answer below that the difference might be non-existent for CPUs due to strict specifications by IEEE? – reg.cs May 09 '22 at 08:25
  • 3
    @reg.cs the IEEE specification has some room for interpretation and floating point hardware implementations are relatively difficult. If you switch CPU models you'll probably get different floating point implementations, so I would still say in theory they should but in practice they might not. – Marty Fouts May 09 '22 at 13:30
  • 1
    The problem here isn't bugs, it's that different orders of mathematically equivalent operations will produce different floating point results. This means that changing tile size will fundamentally produce (slightly) different renders. – Oscar Smith May 09 '22 at 19:16
  • 1
    @OscarSmith It's both, as well as ambiguity in IEEE 754. Even Intel still manages to introduce a new FP bug from time to time. – Marty Fouts May 09 '22 at 19:35
  • 1
    @MartyFouts, OscarSmith Thanks a lot for your insights! So, Think my question is answered and the result is that under most circumstances there will be minimal differences and I cannot expect hash of two renders to be the same due to floating point accuracy. – reg.cs May 10 '22 at 05:45
  • 1
    Also, when a job can be executed by multiple threads (the number of which depend on the CPU), the tiling and the stitching of tiles can affect the results at the tile boundaries. – Diomidis Spinellis May 10 '22 at 11:55
4

If you are rendering with the GPU, then definitely not, because floating point implementations will likely vary, especially with eevee. On the cpu, the differences should be much smaller, if not entirely nonexistent, as the only spec of floating point used (should) be IEEE.

lwswl
  • 330
  • 1
  • 9
  • Thanks a lot, that is an interesting point. Would be good to know if someone could confirm that the answer might depend on whether we talk about rendering on GPUs or on CPUs. – reg.cs May 09 '22 at 08:26
  • 2
    x86 trying to be IEEE compliant is slow, most people use "fast" math for compute intensive applications. – Simon Richter May 09 '22 at 13:13
  • 1
    @reg.cs Even within a single company's CPU line there will be variance in bugs. I don't think anyone can confirm that either CPUs or GPUs tend to be more bug free in floating point and I can't think of an argument that would justify claiming one or the other. Also, every standard has parts that different implementers will interpret differently. – Marty Fouts May 09 '22 at 13:34
  • 2
    Additionally, even GPU manufacturers tend not to directly reuse the floating point design from one generation of hardware to the next. That's because when you reduce feature size in silicon, the design rules change, and different rules lead to different optimization strategies. Of course, what they actually do is strictly kept secret as its seen as a competitive advantage, so it's difficult to tell the trends. – Marty Fouts May 09 '22 at 13:39
  • 1
    It may not just be GPU versus CPU. Even on CPU systems, some parallelization techniques can produce results that depend on CPU hardware timing. Parallelization that does exactly the same computations in exactly the same order should be consistent, but paralyzation that is adaptive, with multiple CPUs contributing different parts of objects to the same pixel will be timing dependent. I do not know if or how Blender parallelizes. – Krazy Glew May 09 '22 at 23:34
  • 1
    Furthermore, not even necessarily parallel versus non-parallel: instead of “fixed amount of work in whatever time it takes“, even some uniprocessor programs can do “as much quality as I can get in a fixed amount of time“ and similar time dependent computation. Again, I do not know if Glenn does this, but it is rather common in such programs to say “give me the best Rendar I can get overnight, but don’t take a week about it”. – Krazy Glew May 09 '22 at 23:38
  • 1
    I can confirm that I've had variable results when I've sent animations to the sheep-it renderfarm and my frames are rendered on a variety of computers. It doesn't happen often, and I think I've mostly seen it on glossy shaders. – Anson Savage May 10 '22 at 03:31
  • Thanks a lot to all the interesting answers! I did not expect so much input. Besides the floating point implementation mentioned in Marty‘s answer it seems that even a fixed render algorithm with the same settings could give (slightly) different results on the same machine. @Anson: Thanks also for confirming that rendering on different machines can even make a visual difference! – reg.cs May 10 '22 at 05:49