nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xinerama (http://www.nvnews.net/vbulletin/showthread.php?t=167611)

lexa2 10-21-11 01:53 AM

Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xinerama
 
1 Attachment(s)
I've got huge FPS drop in linux 32bit build of "Unigine Heaven" benchmark when I setup my system to use dual-screen with Xinerama. FPS drops down to ~15-20. Switching back to TwinView dual-screen setup or using single-monitor setup fixes the issue - FPS goes back to ~60-80.

Computer specs:
AMD Phenom II X4 955 CPU, 6GB DDR2 RAM, nVIDIA GeForce GTX 550 Ti with 1024MB VRAM, two monitors with analog interfaces, nVIDIA 32bit Linux driver 280.13 (also tested with 285.05.09, affected too; I had to downgrade driver down to 280.13 version in order to workaround another regression in 285.05.09 I had reported earlier).

Unigine Heaven settings:
Windowed 1024x768 mode, AA disabled, trilinear filtering + 8xANISO, tessellation disabled, low quality shaders, high quality textures, ambient occlusions disabled, refraction and volumetric shadows enabled, vsync disabled.

Additional Details:
This bug also affects Wine, reported here: http://bugs.winehq.org/show_bug.cgi?id=27959
Wine developers believe that FPS drop happens due to nVIDIA drivers bug in GL_ARB_map_buffer_range extension that behaves really slow in case Xinerama is used.

lexa2 10-21-11 02:59 PM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
Small followup with details on the Xorg server version and exact configuration.
What I've got here is Xorg server v.1.8.2. To configure it I use files placed to the /etc/X11/xorg.conf.d.

My config for TwinView setup looks like this:
Code:

Section "Device"
    Identifier "Videocard0"
    Driver "nvidia"
    Option "TwinView" "True"
    Option "TwinViewXineramaInfoOrder" "CRT-0"
    Option "NoLogo" "True"
    Option "Coolbits" "1"
    Option "MetaModes" "CRT-0: 1280x960_85 +0+0, CRT-1: 1680x1050 +1280+0; CRT-0: NULL, CRT-1: 1680x1050 +0+0; CRT-0: NULL, CRT-1: 1440x900 +0+0; CRT-0: 1280x960_85 +0+0, CRT-1: 1280x960 +1280+0; CRT-0: 1280x960_85 +0+0, CRT-1: 1280x960 +0+0; CRT-0: 1152x864_85 +0+0, CRT-1: 1152x864 +0+0; CRT-0: 1024x768_85 +0+0, CRT-1: 1024x768 +0+0; CRT-0: 800x600_85 +0+0, CRT-1: 800x600 +0+0; CRT-0: 640x480_85 +0+0, CRT-1: 640x480 +0+0"
    Option "IncludeImplicitMetaModes" "False"
    Option "RenderAccel" "True"
    Option "DamageEvents" "True"
    Option "AddARGBGLXVisuals" "True"
    Option "UseEvents" "True"
    Option "TripleBuffer" "False"
EndSection

Config for Xinerama setup:
Code:

Section "ServerLayout"
    Identifier "Default Layout"
    Screen "Screen0" 0 0
    Screen "Screen1" RightOf "Screen0"
    ##InputDevice "Mouse0" "CorePointer"
    ##InputDevice "Keyboard0" "CoreKeyboard"
    Option "Xinerama" "on"
EndSection

Section "Extensions"
    Option "Composite" "Disable"
#  Option        "Render" "Enable"
#  Option        "Randr" "Enable"
EndSection

Section "Device"
    Identifier "Videocard0"
    Driver "nvidia"
    BusID  "PCI:2:0:0"
    Option "TwinView" "False"
    Option "NoLogo" "True"
    Option "Coolbits" "1"
    Option "RenderAccel" "True"
    Option "DamageEvents" "True"
    Option "AddARGBGLXVisuals" "True"
    Option "UseEvents" "True"
    Option "TripleBuffer" "False"
EndSection

Section "Device"
    Identifier "Videocard1"
    Driver "nvidia"
    BusID "PCI:2:0:0"
    Screen 1
    Option "TwinView" "False"
    Option "NoLogo" "True"
    Option "Coolbits" "1"
    Option "RenderAccel" "True"
    Option "DamageEvents" "True"
    Option "AddARGBGLXVisuals" "True"
    Option "UseEvents" "True"
    Option "TripleBuffer" "False"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Videocard0"
    DefaultDepth 24
    Option "UseDisplayDevice" "CRT-0"
    SubSection "Display"
        Depth 24
        Modes "1280x960" "1152x864" "1024x768" "800x600" "640x480"
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device "Videocard1"
    DefaultDepth 24
    Option "UseDisplayDevice" "CRT-1"
    SubSection "Display"
        Depth 24
        Modes "1680x1050" "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480"
    EndSubSection
EndSection

It had been reported that Xorg Server versions 1.9, 1.10 and 1.11 are affected too (taking into account that nVIDIA driver uses the same codebase for all of them it's not of a big surprise).

lexa2 03-14-12 06:32 PM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
Bumping up this report after re-testing with latest drivers ([s]295.17 <- it was typo[/s] 295.20). It seems that using GL_ARB_map_buffer_range in Xinerama setups still causes noticeable performance regression. Had this bug report been ever considered/took into account by nVIDIA devs?

P.S. And as a side note: looks like that current implementation of GL_ARB_map_buffer_range as it is available in linux nVIDIA drivers is pretty slow by itself, quick tests show that accessing framebuffer through FBOs (GL_ARB_pixel_buffer_object) or even using simple glReadPixels/dlDrawPixels seems to be much faster than using dynamic buffers access through GL_ARB_map_buffer_range. It's a show-stopper thing for any modern linux game (OilRush, for example) as it reduces the possible max FPS drastically.

sandipt 03-15-12 07:56 AM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
lexa2, Does this issue reproduce with default settings of Unigine Heaven Benchmark? and also with fresh xorg.conf file generated with nvidia-xconfig by removing old one.

lexa2 03-15-12 08:28 AM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
sandpit, thanks for quick answer.

Original reported issue clearly does not happen with the default xorg.conf generated by nvidia-config as this tool does not generate config file which utilizes xorg Xinerama extension. But if you take a look into the documentation that is shipped with the nVIDIA driver - there are claims that driver supports Xinerama-enabled setups in case user has to/wants to use it. Thus, Xinerama-enabled setups are not something that is an "illegitimate hack", and for some tasks - like having two monitors connected and using different rotation settings for them - is the only way to go (well, switching into using nouveau is another possibility, but that's out of topic for this forum).

As for Unigine Heaven benchmark settings - FPS drop happens no matter what are the settings used, bug trigger is that GL_ARB_map_buffer_range implementation in nVIDIA linux drivers - which isn't performing fast per se even in non-Xinerama setups really - suffers a huge slowdown when used in Xinerama-enabled setups. The only setting that's required is to stay in dual-head Xinerama mode, and easiest way to achive it is to run Heaven benchmark in a window.

I suspect - and this is just an educated guess - that this slowdown is a result of a driver doing memcpy() internally for the requested part of the buffer and then doing backwards memcpy() as soon as app releases mapped buffer instead of mapping the requested region directly. OTOH, I don't know exactly what are the internals of the nVIDIA driver so this guess might be a bogus one :-).

sandipt 03-19-12 07:26 AM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
lexa2, Please attach your results of Unigine Heaven benchmark for separate X screen with xinerama , without xinerama and Twin view? Also Did you observed frame drop when run benchmark with separate X screen without xinerama?

lexa2 03-19-12 05:58 PM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
sandpit, thanks for request. I wouldn't be able to handle the requested testing for next few days due to other tasks I need to do. I expect to be able to fulfill your request towards the end of this week, most likely on Friday or Saturday.

sandipt 04-12-12 11:56 AM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
lexa2, Any updates about requested information?

lexa2 04-14-12 04:37 AM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
1 Attachment(s)
sandpit, sorry for not responding here for a long time, I have been off on vacation being too busy drinking vodka and playing balalaika to do the requested tests :-). Today I finally had managed to find some time for this task, so here are the results.

I can state that the huge FPS drop still happens with drivers 295.40 when Xserver is configured to use dual-head Xinarama setup. I've been told by a person on another forum that "IndirectMemoryAccess" setting might have an influence on this drop, so the test I did include two variants for each case, one having this option set to "False" and another with it set to "True".

In attachment to this post you could find all the requested results. It is a zip archive containing 6 HTML benchmark result reports generated by Unigine Heaven benchmark.

Benchmarking was conducted as following:
1. Remove installed copy of Unigine Heaven if exists, proceed with a fresh install (rm -rf <install-dir> && ./Unigine_Heaven-2.5.run --target <install-dir>).
2. Reconfigure and restart X server, check Xorg.0.log to be sure that the requested configuration is being used.
3. Start up Unigine Heaven benchmark using it's default configuration by executing bundled startup script named "x86_1024x768_windowed_tess_disabled.sh".
4. As soon as Unigine Heaven finishes it's loading tasks - press "Benchmark" button and wait for benchmark to finish.
5. Save the benchmark report into HTML file using appropriate button.
6. Repeat steps 1-5 for each Xserver configuration to be tested.

Here are Xorg configs that had been used as a templates during testing process:
Single head single screen setup:
Code:

Section "ServerLayout"
    Identifier "Default Layout"
    Screen "Screen0" 0 0
    Option "Xinerama" "off"
EndSection

Section "Extensions"
    Option "Composite" "Disable"
EndSection

Section "Device"
    Identifier "Videocard0"
    Driver "nvidia"
    Option "TwinView" "False"
    Option "NoLogo" "True"
    Option "Coolbits" "1"
    Option "RenderAccel" "True"
    Option "DamageEvents" "True"
    Option "AddARGBGLXVisuals" "True"
    Option "UseEvents" "True"
    Option "TripleBuffer" "False"
    Option "IndirectMemoryAccess" "False"
#    Option "IndirectMemoryAccess" "True"
    Option "InitializeWindowBackingPixmaps" "True"
    Option "ConnectToAcpid" "False"
    Option "GLShaderDiskCache" "True"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Videocard0"
    DefaultDepth 24
    Option "UseDisplayDevice" "CRT-0"
    SubSection "Display"
        Depth 24
        Modes "1680x1050" "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480"
    EndSubSection
EndSection

TwinView dual-head config:
Code:

Section "Device"
    Identifier "Videocard0"
    Driver "nvidia"
    Option "TwinView" "True"
    Option "TwinViewXineramaInfoOrder" "CRT-0"
    Option "NoLogo" "True"
    Option "Coolbits" "1"
    Option "MetaModes" "CRT-0: 1680x1050 +0+0, CRT-1: 1280x1024 +1680+0; CRT-0: 1680x1050 +0+0, CRT-1: NULL; CRT-0: 1440x900 +0+0, CRT-1: NULL; CRT-0: 1280x1024 +0+0, CRT-1: 1280x1024 +1280+0; CRT-0: 1280x10
    Option "IncludeImplicitMetaModes" "False"
    Option "RenderAccel" "True"
    Option "DamageEvents" "True"
    Option "AddARGBGLXVisuals" "True"
    Option "UseEvents" "True"
    Option "TripleBuffer" "False"
#    Option "IndirectMemoryAccess" "False"
    Option "IndirectMemoryAccess" "True"
    Option "PanAllDisplays" "False"
    Option "InitializeWindowBackingPixmaps" "True"
    Option "ConnectToAcpid" "False"
    Option "GLShaderDiskCache" "True"
EndSection

Xinerama dual-head config:
Code:

Section "ServerLayout"
    Identifier "Default Layout"
    Screen "Screen0" 0 0
    Screen "Screen1" RightOf "Screen0"
    Option "Xinerama" "on"
EndSection

Section "Extensions"
    Option "Composite" "Disable"
EndSection

Section "Device"
    Identifier "Videocard0"
    Driver "nvidia"
    Option "TwinView" "False"
    Option "NoLogo" "True"
    Option "Coolbits" "1"
    Option "RenderAccel" "True"
    Option "DamageEvents" "True"
    Option "AddARGBGLXVisuals" "True"
    Option "UseEvents" "True"
    Option "TripleBuffer" "False"
#    Option "IndirectMemoryAccess" "False"
    Option "IndirectMemoryAccess" "True"
    Option "InitializeWindowBackingPixmaps" "True"
    Option "ConnectToAcpid" "False"
    Option "GLShaderDiskCache" "True"
EndSection

Section "Device"
    Identifier "Videocard1"
    Driver "nvidia"
    Screen 1
    Option "TwinView" "False"
    Option "NoLogo" "True"
    Option "Coolbits" "1"
    Option "RenderAccel" "True"
    Option "DamageEvents" "True"
    Option "AddARGBGLXVisuals" "True"
    Option "UseEvents" "True"
    Option "TripleBuffer" "False"
#    Option "IndirectMemoryAccess" "False"
    Option "IndirectMemoryAccess" "True"
    Option "InitializeWindowBackingPixmaps" "True"
    Option "ConnectToAcpid" "False"
    Option "GLShaderDiskCache" "True"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Videocard0"
    DefaultDepth 24
    Option "UseDisplayDevice" "CRT-0"
    SubSection "Display"
        Depth 24
        Modes "1680x1050" "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480"
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device "Videocard1"
    DefaultDepth 24
    Option "UseDisplayDevice" "CRT-1"
    SubSection "Display"
        Depth 24
        Modes "1280x1024" "1152x864" "1024x768" "800x600" "640x480"
    EndSubSection
EndSection

Benchmark results were about 71 FPS for TwinView and single head single screen setup, while using dual-head Xinerama setup resulted in FPS drop down to ~30. Using different values for "IndirectMemoryAccess" option proved not to show any significant difference.

Plagman 04-14-12 09:57 AM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
To be clear, Xinerama is expected to cause a significant perf hit on OpenGL applications; if that's the only thing you're observing, then it probably isn't a bug.

lexa2 04-14-12 10:02 PM

Re: Major FPS drop in Unigine Heaven (native linux binary) under dual-monitor Xineram
 
Plagman, from the very beginning this report was about the "huge FPS drop and nothing else", so yes, FPS drop is the only thing that's being observed here.

Thanks for clarifying the thing about "Xinerama = huge perf. hit", but IMO it would be great if this info would also be provided in docs bundled with nVIDIA drivers so end-users would be warned against using Xinerama. On a side note, as a programmer I can easily understand what causes perf. hit in case rendering context spans over two different screens (i.e. if a render target window is split between two screens composing Xinerama), but it's pretty strange for me that perf. is also affected severely when the render context is entirely bound to one of the Xinerama screens. Even more, I suspect that Unigine Heaven most likely uses offscreen FBO's to do it's renderings and blits results into X drawable afterwards, and I can't clearly see a reason for Xinerama to cause huge performance drop for a such case. On the other hand, I'm a not a GPU driver programming expert so my assumptions might be totally wrong.


All times are GMT -5. The time now is 09:21 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.