POV-Ray : Newsgroups : povray.beta-test : Dynamic, CPU optimization, build bug and a patch. Server Time
27 Jul 2024 08:00:46 EDT (-0400)
  Dynamic, CPU optimization, build bug and a patch. (Message 1 to 1 of 1)  
From: William F Pokorny
Subject: Dynamic, CPU optimization, build bug and a patch.
Date: 11 May 2024 01:18:21
Message: <663eff9d$1@news.povray.org>
Issue discussed first in the newsgroup thread:

https://news.povray.org/povray.general/thread/%3C663cdc51%241%40news.povray.org%3E/

At some point a few years ago, the default gnu unix/linux builds for 
v3.8+ versions of POV-Ray stopped correctly detecting x86 CPU features 
necessary to use the hand coded optimizations which work on my old i3 
CPU. The build problem is likely more general, but to an extent unknown.

The g++ compiler is in-lining an __asm__ coded function despite source 
code attributes indicating it should not. The in-lining comes with 
side-effects.

If compiling on an x86 AMD or Intel CPU (or equivalent VM) and you are 
getting a generic optimization over a hand coded one, you can try a 
build using +O0 while configuring which prevents all in-lining of code. 
The resulting build will be slow, but if you then get a dynamic 
optimization, you too are seeing the issue.

Because the issue results in hand optimizations not being used, it's 
harmless with respect to end result. Some scenes will render a little 
more slowly than they might otherwise.

See the upcoming yuqk release (R15) for one possible patch. Specifically 
changes to the file <code install dir>/platform/x86/cpuid.cpp.

--

Note! Clang++ (emulating gnu gcc/g++) builds were OK, with or without 
the suggested patch on my i3. See yuqk's INSTALL.txt for a suggested 
configuration for a clang++ based build.

--

Related: There is a github pull request with a hand coded avx512 
implementation for the v3.8 POV-Ray branch:

    https://github.com/POV-Ray/povray/pull/452

I've not myself tried the pull request with my yuqk fork. I don't have 
the AMD and Intel hardware on which to test it.

Bill P.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.