2.72 Freestyle renders two times longer on Linux #41964
GPU: Nvidia GeForce 9800 GT
CPU: Intel Core 2 3GHz
RAM: 6GB RAM
Broken: Linux versions: 2.72
eb464ee (blender-2.72-RC1-linux-glibc211-x86_64) and previous testbuild (blender-2.72-testbuild1-linux-glibc211-x86_64)
Worked: 2.6; 2.7; 2.71, 2.72 windows 64 version
Short description of error
The problem is too long Freestyle Stroke rendering. Simple file with Ve: 19k, Fa: 22k is rendering about 14 seconds. It is long, but linux version 2.72 testbuild and RC1 doing the same two times longer, need about 27-30 seconds.
Exact steps for others to reproduce the error
Open file nut.blend and render in Linux and Windows versions.
Hello, I tested yesterday released 2.72
95182d1 (blender-2.72-linux-glibc211-x86_64.tar.bz2) and Freestyle Stroke rendering still takes two times longer than 2.71
I thought the report concerns a difference of rendering speeds between Linux and Windows. Do you mean that you have observed different rendering speeds between 2.71 and 2.72 both on Linux?
Rendering about 14sec on versions:
Rendering two times longer on versions:
The same file, with the same rendering parameters.
Not much news from my side. I personally don't have a Linux box that can reproduce the reported speed problem. A friend of mine who uses Blender/Freestyle under Linux told me that he did not observe the issue.
I suppose that you render the .blend file from within the Blender user interface. What happens if you render the file by one of the following ways?
- render the file with the Display option set to Keep UI (instead of New Window, Image Editor, or Full Screen) and without the Image Editor not shown in the UI.
- render the file by means of the command-line interface.
This test will help us check if the slowness comes from Freestyle.
I am under ubuntu 14.04 64bits.
The blend gives me these results :
2.71 : 10s 20
2.72b : 21s
602250d : 12s
here is my specs
intel hd graphics 4600
Could you guys test with all Add-Ons disabled? We had similar issues caused by Add-Ons.
Tested with Ubuntu and took twice as long with add-ons disabled about 1min 20 sec
I cannot test on my workstation but on my laptop without addons.
Thank you all for the additional tests, very much appreciated!
If a few more test runs are acceptable, could you guys please do test renders with the
--debug-freestyle command-line option specified when you start Blender? This will generate a lot of debug information on the console including the breakdown of Freestyle rendering time, which might allow us to identify the cause(s) of slow rendering on Linux. Please, consider saving the console output in a text file (e.g., by redirecting the standard output of Blender to a file as in
./blender --debug-freestyle > output.txt) and attaching the file to a reply. Thanks in advance.
@zeauro Many thanks for the test results. Your logs allowed me to break down Freestyle time components. According to the analysis of timing information, there are no big differences in the Freestyle time components among Blender versions (see the comparisons in the attached PDF file). It looks like the slowness comes from somewhere outside the Freestyle rendering core.
Now I guess I have to look into the Blender rendering pipeline to identify the cause of the slowness...
@kjym3, the issue is barely visible with regular builds and totally visible when using jemalloc (probably because of different memory layout in that case or so).
The issue is introduced by
0464876 which in fact unleashes really evil aspect of freestyle. The thing here is, datablock data free would check if the datablock is used as a target of some driver (if it was used then driver's target ID would be set to NULL). Before the mentioned commit freestyle did not sent proper main to datablock free function, so iteration happened inside the wrong list. Now iteration happens with the proper list.
The cause of slowdown is the freestyle main free. It seems to contain around 13K datablocks, and assuming datablock deletion is O(n^2) that's gonna to take quite some time.
Hereby i'm raising some questions:
- @kjym3, is it really necessary to create so much datablocks? Blender doesn't really handle such situations well.
- @JoshuaLeung, @ideasman42 do we really need to iterate drivers when freeing the datablock data?
- @kjym3, i guess the objects in freestyle main does not have any drivers animation, so in the worst case we can create extended version of datablock free function which we would tell not to iterate drivers?
@Sergey It is necessary to iterate through each driver when freeing it, because we need to free the DriverVariable instances (on the ChannelDriver), then the ChannelDriver (on the FCurve).
The issue of too many data blocks (mostly meshes) was one of problems I have addressed as part of my BF project (Apr-Sept 2014) for Freestyle performance optimization. A quick test on my side showed that when the performance optimization was applied, only one mesh data block was created for rendering the test scene rather than 13K data blocks. The actual number of auto-generated data blocks can still be arbitrarily large depending on input scenes, but is expected to be much smaller than non-optimized versions. Integrating the optimization coding results into Git master is a 2.74 target.
Freestyle does not use drivers at all.
@JoshuaLeung, i'm having hard time to understand why we need to do drivers on datablock free but don't need to do constraint/modifiers/parents etc at the same time actually.
@kjym3, that sounds good.
For those who compile Blender from source, here is a patch for the aforementioned Freestyle rendering optimization (rebased onto Git master, with a lot of conflicts addressed). The patch should apply cleanly to the latest HEAD as of this writing.
Maybe it is too late to include this revision to the 2.73 release.
@kjym3, we can not accept this for 2.73, but master branch is open now so you can commit it for 2.74 when it's ready.
hello, I think I found solution, need to go to Freestyle Line Style, then in Strokes tab, check Chaining checkbox (and select Plain, check Same Object). Now nut.blend file renders for about 2 seconds! I hope it helps
I think I will just commit the proposed patch to git master after I test it a bit more. Then nightly builds will soon allow testers to check if the reported slowness has been addressed.
I will test tomorrow unless you know what hash it has been placed into
This did not work for me rendered on CPU with Ubuntu 14.04
Used blender Linux 64 bit Official blender-2.73-
8a28895 -linux-glibc211-x86_64.tar.bz2 94M Sat Jan 3 03:12:20 2015
Render time 3:15.95
I used blender version: Windows 64 bit Official blender-2.73-
8a28895 -win64.zip 100M Sat Jan 3 03:13:48 2015
Render time: 56.49
Windows 8.0 Hardware specs
Intel(R) HD Graphics 4600 Report Date: 1/2/2015 Report Time[hh:mm:ss]: 12:37:25 Driver Version: 126.96.36.19965 Operating System: Windows 8 (6.2.9200) Default Language: English (United States) Installed DirectX* Version: 11.1 Supported DirectX* Version: 11.1 Shader Version: 5.0 OpenGL* Version: 4.0 Physical Memory: 16136 MB Processor: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz Processor Speed: 2394 MHz Vendor ID: 8086 Device ID: 0416 Device Revision: 06
Ubuntu same specs but 7.5 GB of RAM (Virtual Machine)
Five and a half times slower!!!
@Blendify you cant expect a virtual machine to render as fast as a real machine... it only uses a part of the available hardware...
@JulianEisel even though it is a virtual machine it still is dramatically different from the first time I tested under the same testing environment.
First test from earlier comments
Please never, ever use a virtual machine for bug reports in general, and performance tests in particular. The use of a single instruction somewhere can make the whole code orders of magnitude slower than on 'native' OS - or not. In other words, performances test results from a VM are absolutely meaningless.
Thanks for the feed back I would like to some day set up a split hard drive
Using a VM to do performance test, the result depends on much more factors than on a real installation. Even if you think everything is the same it may not be so. So just as Bastien said, performance tests on a VM are meaningless :/
Hello, would You like to test render time of the same file (now Strokes Chaining is checked) nut-stroke.blend Now render time is about 2-3 seconds on my Debian Nvidia GeForce 9800 GT & Intel Core 2 3GHz
What's the latest status here? Could somebody test again so we can see if the issue has been resolved?
The issue has been resolved.
On my workstation, the original file of bugreport takes 20 seconds with 2.73a but only 1 s with current master
With nut-stroke.blend, results are 1.12 s with 2.73a and 0.85 s with current master
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?