Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-04-25 07:11:22



Reply to topic  [ 10 posts ] 
Version 1.28.0.2 build fails when using --lto 
Author Message

Joined: 2016-06-19 21:33:37
Posts: 342
Location: Columbus area, OH, USA
Reply with quote
I often compile my own version of the viewer from source, when it is released. Lately I have been experimenting with the --lto flag, such as: ./buildlinux.sh --tune --usesystemlibs --lto. With today's release of 1.28.0.2 the build fails with:
Code:
/home/zanezimer/Projects/linden/indra/llcommon/lldictionary.h: In member function ‘parseXml’:
/home/zanezimer/Projects/linden/indra/llcommon/lldictionary.h:92: error: inlining failed in call to ‘always_inline’ ‘notFound’: function not considered for inlining
   92 |  LL_INLINE virtual Index notFound() const { return Index(-1); }
      |
/home/zanezimer/Projects/linden/indra/llcommon/lldictionary.h:88:18: note: called from here
   88 |   return notFound();
      |                  ^
lto-wrapper: fatal error: /usr/bin/g++ returned 1 exit status
Upon inspecting ../llcommon/lldictionary.h it seems that it might be missing an LL_INLINE on line 77?
I added the macro to that line and rebuilt with success, but I admit I do not know exactly what that macro does or if it is appropriate on that method. The viewer seems to operate normally, though I haven't exhaustively tested.


2020-07-11 18:31:52
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
I do not recommend using link time optimizations for the viewer, because they will cause de-inlining of important (read: speed critical) methods, especially the ones dealing with SSE2-optimized maths (such as LLQuad, LLVector4a, LLMatrix4a) and the result will be a slower viewer.

The error you get is typically such a de-inlining (even though this one won't be speed-critical), and probably a compiler bug; to work around it, simply remove LL_INLINE, but again, I do not recommend at all LTO...


2020-07-11 18:48:33
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 342
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
I do not recommend using link time optimizations for the viewer, because they will cause de-inlining of important (read: speed critical) methods, especially the ones dealing with SSE2-optimized maths (such as LLQuad, LLVector4a, LLMatrix4a) and the result will be a slower viewer.

The error you get is typically such a de-inlining (even though this one won't be speed-critical), and probably a compiler bug; to work around it, simply remove LL_INLINE, but again, I do not recommend at all LTO...
Thanks Henri. I was only experimenting to determine if there was any noticeable difference for my builds. So far, no apparent difference in frame rate, etc. The viewer is just as 'speedy' for me, with or without link time opt. But I will take note and just build without from now on.


2020-07-11 18:59:49
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
ZaneZimer wrote:
Thanks Henri. I was only experimenting to determine if there was any noticeable difference for my builds. So far, no apparent difference in frame rate, etc. The viewer is just as 'speedy' for me, with or without link time opt. But I will take note and just build without from now on.
Believe me, I did make serious benchmarking, and the loss, even if marginal (1-2%) is measurable... The compilers do a very good job at optimizing bad code almost to the best, but good code is usually not as fast when such invasive (and clueless) optimization options are switched on.

I also confirm your gcc version is buggy, for I just compiled successfully v1.28.0.2 with gcc v9.3 and LTO enabled...


2020-07-11 19:06:41
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 342
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
I also confirm your gcc version is buggy, for I just compiled successfully v1.28.0.2 with gcc v9.3 and LTO enabled...
Ah, OK. So something busted in gcc version 10.1.1 20200507 (Red Hat 10.1.1-1) (GCC) then.


2020-07-11 19:10:16
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
ZaneZimer wrote:
Ah, OK. So something busted in gcc version 10.1.1 20200507 (Red Hat 10.1.1-1) (GCC) then.
Not unusual (every gcc version got bugs), but more common in versions with a small minor (vN.0, vN.1)...

And... clang v9.0.1 just compiled the viewer successfully as well with LTO enabled.


2020-07-11 19:16:46
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 342
Location: Columbus area, OH, USA
Reply with quote
Good to know on clang, though Fedora 32 has moved to 10.0.0, so I'll just avoid LTO. :-)

I guess I just keep searching for the elusive 'magic' that will make my rig perform better. I keep thinking with these specs:
Code:
CPU: AMD Athlon(tm) X4 880K Quad Core Processor (3999.61 MHz)
Memory: 32137MB
OS version: Linux-x86_64 v5.7.7-200.fc32.x86_64 #1 SMP Wed Jul 1 19:53:01 UTC 2020
Memory manager: jemalloc v5.2.1-20200630
Graphics card vendor: NVIDIA Corporation
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2
OpenGL version: 4.6.0 NVIDIA 450.57
Detected VRAM: 11264MB
that I should just have better experience than I do.


2020-07-11 19:23:53
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
ZaneZimer wrote:
I guess I just keep searching for the elusive 'magic' that will make my rig perform better.
There is no magic, I'm afraid... Use the tune option for the build: it will compile with AVX (if your CPU supports it) or the best supported SSE (2, 3, 4) on your system. It will also enable the -march=native option, and with some luck, your gcc version will do a better job at tuning the code generation for your CPU. But do not expect more than 1 or 2% of gain in frame rates...

Quote:
I keep thinking with these specs:
Code:
CPU: AMD Athlon(tm) X4 880K Quad Core Processor (3999.61 MHz)
Memory: 32137MB
OS version: Linux-x86_64 v5.7.7-200.fc32.x86_64 #1 SMP Wed Jul 1 19:53:01 UTC 2020
Memory manager: jemalloc v5.2.1-20200630
Graphics card vendor: NVIDIA Corporation
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2
OpenGL version: 4.6.0 NVIDIA 450.57
Detected VRAM: 11264MB
that I should just have better experience than I do.
For SL, the weak part of your system is the CPU. Your graphics card is an overkill (SL shaders are very light), but the render pipeline being purely mono-thread in SL viewers, the bottleneck is at your CPU mono-core performance level. Currently (things might change with Zen3... time will tell), Intel CPUs shine in this category (mono-core perfs).


2020-07-11 19:36:41
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 342
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
There is no magic, I'm afraid... Use the tune option for the build: it will compile with AVX (if your CPU supports it) or the best supported SSE (2, 3, 4) on your system. It will also enable the -march=native option, and with some luck, your gcc version will do a better job at tuning the code generation for your CPU. But do not expect more than 1 or 2% of gain in frame rates...
I have been using --tune for a long while now and why I compile for myself. When I started using that, I did notice a small gain and I enjoy the 'hobbyist' aspect of self-building.
Henri Beauchamp wrote:
For SL, the weak part of your system is the CPU. Your graphics card is an overkill (SL shaders are very light), but the render pipeline being purely mono-thread in SL viewers, the bottleneck is at your CPU mono-core performance level. Currently (things might change with Zen3... time will tell), Intel CPUs shine in this category (mono-core perfs).
Might be time to give in and return to Intel. I have liked AMD for many years, but they do have their weaknesses. Thanks again, Henri. Appreciate all your hard work.


2020-07-11 19:46:11
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
ZaneZimer wrote:
Might be time to give in and return to Intel.
Or just wait for Zen 3... Should be around by the end of this year.


2020-07-11 19:52:07
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 84 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.