Auto Tile Size Addon

Now before you start to think this is turning into some crazy coder blog, here’s an addon you might actually use!

2013-09-29_11-29-27

[Download] [Docs]

Tile sizes can be confusing and for some reason they actually make a difference in render speed! But why bother to figure it out when you can have a simple addon do it all for you?!
This addon takes care of that. Just enable it and you should never need to worry about tile sizes again!

It automatically calculates the best size when you change the resolution, or when you change from CPU to GPU and back, or accidentally change the tile size yourself! (although if you do want to set it manually, simply toggle the Auto Tile Size button)

We’ve all seen Andrew’s old post about how tile sizes affect render time, but its not quite as simple as this:

blender_tile_sizes_chart2(Update: I’ve done my own extensive tests since posting this)

In fact, it’s not always a good idea to stick to powers of 2 for dimensions (32, 64, 256…). I know! Blasphemy! But in this case there’s some logic behind it. Or at least some proof.

If you always stick to powers of 2 for your tile sizes, you’ll often have tiles that are not all the same size (on the edges of the image) since most resolutions simply don’t divide cleanly into powers of 2 (1920×1080 is a good example)

1080ptiles

This is a 1080p image divided into 256×256 blocks. As you can see, the tiles on the right and bottom are not the same size as the others. You might think this is illogical, but these tiles don’t take a proportionate amount of time to render relative to their size. For example, the tiles on the right are about half the size of the rest of the tiles, but they take more than half the time to render.

Thus, it’s important to always keep all your tiles the same size and as square as possible. Being a few pixels skew from powers of 2 is not as big a deal as having inconsistent tiles.

That’s where this main purpose of this addon comes in.

It figures out what’s the best tile size closest to a power of 2 of your choice. For example, the best size for 1080p that’s closest to 256×256 is 240×270, making 8×4 consistently sized tiles

1080ptiles_right

The addon stores the chosen target size separately for CPU and GPU in case you want to switch often, and defaults to 32 square tiles for CPU and 256 for GPU. Those are the best sizes in my experience, though sometimes GPU does better with 128 and CPU better with 64 – it all depends on the scene and the resolution.

[Download]

Update v2.0:

Removed ‘Set’ button – tile size is now automatically updated when changing target, render size or tile size (to manually change tile size, disable Auto Tile Size)
Improved accuracy for small tile sizes (result from 16 wasn’t so different from 32)

Update v2.2:

Now works for BI, hidden target option behind a “Show Advanced” type button

20 thoughts on “Auto Tile Size Addon

  1. Yes! Thanks, Greg! Tiling has always been a puzzle for me. ;)

    -Reyn

  2. awesome Greg, keep it going…
    I want to ask you, do you think it’d be possible to make an “auto crop” addon, i’ve noticed that if you have for instance a 1080p render but your character only takes half of the screen, then you render it takes super long but if you crop the render to have not much blank space, it diminish the render times quite heavily…

    anyways!!, all the best!!!

    • You can partially render any part of your render- “Border render”
      Ctrl+B while you in camera mode and then click and draw a border to render.
      when you sattisfied with the result ,you can uncheck ‘Border’ option in render settings, or draw a border beyond camera view

  3. Thanks, Greg!

  4. Great, thanks a lot, and keep up the good work.

  5. Great addon, any plans to add it the contrib-addons or github?

  6. Hi Greg, many thanks for your good work on addons or Blender. I wished to try your auto tiling addon but the links appear to be invalid. Cheers.
    Harvester

  7. Thank you!

  8. Just came across this, very useful if not only for knowing to be more conscious of the edges of the tiles. I do notice that this “addon” for cycles only appears in the performance panel when cycles is the render engine, but if you switch into BI it does not appear, yet it will still override the tile size setting if it was left on when cycles was active. I’d say let BI have the panel as well, it’s just as useful with that engine

  9. Hey Greg, thanks for much for doing this add on, I find it extremely useful. I was discussing the addon as a must have feature for blender on this thread:

    http://blenderartists.org/forum/showthread.php?381314-Proposal-Auto-tile-size-should-be-standard-part-of-blender

    And I was barking up the wrong tree so to speak: it is part of Blender already, BUT it needs to be turned on by default. I think it would be time for that. This could help so many users that now grapple with the tile size and have really bad speed results in benchmarks, when they switch from CPU rendering to GPU rendering, but fail to adjust the tile size.

    • Hey Nigra – the add-ons that are enabled by default are limited to a few vital import/exporters and Cycles itself. If we were to have automatic tile sizes calculated by default, it should be a part of Blender’s core, not an add-on. I recall one or two devs suggesting this, but nobody has done anything about it yet. Maybe sometime I’ll give it a shot, but it won’t be soon.
      Thanks for the interest anyway :) glad to know you like it.

  10. Hi Greg, thanks for the addon.
    When I change to GPU in Blender, the addon choose by default a size of 240×180. I guess this is good for GTX 5xx, 6xx and 7xx series. But you know, Maxwell cards have a greater optimal size, about 480×270 (Po2=512). Is there any way so that the user can choose and save the optimal size of the card? Thus whenever change GPU in a new scene then the addon set these 480×270 size that user had saved, instead of 240×180.
    I hope my question is understood, I know that you can then choose the desired size, but I mean the size that the addon choose by default.
    Thank you.

    PS: I do not understand the “LOG IN WITH” section of this site. If I choose to log in with google, then it anyway required to register to DISQUS (since it is asking for password). So if I do not want to have a DISQUS account, I can not send the message. Obviously for sending this message, I had to do it with DISQUS. So apparently I could not avoid DISQUS.

    • The default 256×256(ish) for GPU is hard-coded at the moment, the only way to change it is to change the code itself. Just switch to a text-editor in blender (Shift-F11), then right click on one of the add-on’s buttons in the performance panel (e.g. the main ‘Auto Tile Size’ button) and choose ‘Edit Source’. Look for the ‘AutoTileSizeSettings’ class near the top and see that the first setting is ‘gpu_choice’ with its default set to ‘256’. Just change that to ‘512’ instead, save the file and restart blender.

      In future I might just set 512 as the default, but I do still often have scenes that render quicker with 256 on my 980ti.

  11. Hey Greg. Now that we can render with both CPU and GPU simultaneously, is it possible to give each a seperate tile size setting?

    • I believe in 2.79a (coming very soon), tile size performance differences are negligible (and supposedly 32×32 is fastest for GPU too), making this add-on obsolete.