Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Pages: 1 [2] 3

Author Topic: Multi-Threaded Rendering  (Read 76242 times)

selden

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • Modelling for Celestia
Re: Multi-Threaded Rendering
« Reply #15 on: July 14, 2018, 07:50:57 am »

Steve,

Can you provide a way to limit the number of threads to fewer than the number of virtual cores available?

It'd be nice to be able to do some interactive work (perhaps improving a model or text editing) on the computer while a render is in progress with minimal interference from the rendering.
Logged
Selden

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Multi-Threaded Rendering
« Reply #16 on: July 14, 2018, 04:02:30 pm »

selden: Yes, there will be a max threads setting in the next drop.
Logged

selden

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • Modelling for Celestia
Re: Multi-Threaded Rendering
« Reply #17 on: July 14, 2018, 04:46:02 pm »

Great!
Logged
Selden

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Multi-Threaded Rendering
« Reply #18 on: July 14, 2018, 05:25:21 pm »

While rendering an image, after a while there might be one or two threads left running for a long time, that are rendering spots that have a lot going on. I think it'd be nice if the renderer would automatically split remaining chunks into smaller chunks and assign them to different threads, continuously until the render is completed, up to a minimum chunk size. Possible?
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Multi-Threaded Rendering
« Reply #19 on: July 14, 2018, 05:48:48 pm »

Raxx: Rendering with smaller chunks can also help. I'm still experimenting with ways to handle trailing chunks.

As to why your example is slower with 1329, it's caused by the light mask heuristic. Because ambient occlusion sends "shadow" rays in all directions, different samples for the same pixel on much of the models can see or not see the sky. This causes FastAA to revert to a full evaluation of all 256 samples/pixel. In the attached image these are the yellow pixels. The fast pixels are dark gray.

The other image is from 1325 where the orange pixels are the fast ones. As you can see almost the entire image is "fast".

I'm trying to come up with better heuristics for ambient occlusion.
« Last Edit: July 14, 2018, 05:50:20 pm by Steve »
Logged

Kyle

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Multi-Threaded Rendering
« Reply #20 on: July 14, 2018, 09:58:52 pm »

Nice. This was a long time coming. And now I finally have a beast of a desktop to take advantage of this too. Though its interesting to see what parts the renderer is struggling with. Often times what I assumed would be the simplest turned out to take the longest.
Logged

Trevor

  • Full Member
  • ***
  • Posts: 220
  • Goldfinger64 Dev OS:10 CPU:5960x Gfx:RX480
    • View Profile
    • LS Tech Services
Re: Multi-Threaded Rendering
« Reply #21 on: July 15, 2018, 07:41:19 am »

HOLY CRAP!!! Multi-Threaded rendering has arrived, testing NOW :)

Trev

rendered a test (Diffuse Inter-Reflection test as shown on another topic)

83 secs down to 14 !!!! WOW

Also, anyone using DIR should disable fastAA as its actually slower since it always has to do "full evaluation".

My only suggestion now would be to "build" an image interlaced, i.e., blocks of solid -> blocky(coarse) -> final image(fine)

Also, my tests show that ChunkSize 32 is the best for speed, anything bigger gets held up on one or more chunks (like the mirror ball).
32 on the other hand is small enough that each chunk can finish in a timely manner and if its still needing to render then another thread can "take over" since its not tied to a thread.

Can you up the thread count to 16 too? Im only using 70% CPU (anyone have anything more?)
« Last Edit: July 15, 2018, 01:21:44 pm by Trevor »
Logged

thecolclough

  • Sr. Member
  • ****
  • Posts: 890
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
Re: Multi-Threaded Rendering
« Reply #22 on: July 15, 2018, 05:23:19 pm »

well, this is all rather exciting!  unfortunately i'm in the middle of a really hectic fortnight (and away from home for most of it) so i can't test this update straight away, but i'll give it a spin as soon as i'm able
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Multi-Threaded Rendering
« Reply #23 on: July 15, 2018, 07:34:05 pm »

Trevor: it doesn't really help to use more threads that there are in your CPU. If your CPU isn't 100% busy it's probably waiting on memory (i.e. there is more data being accessed than will fit in the CPU's cache). It might even speed up the render to use fewer threads, depending on the data set.

On my CPU (2 hyper threaded cores, 4 threads total) most renders use 100% of the CPU.
« Last Edit: July 15, 2018, 07:48:07 pm by Steve »
Logged

Trevor

  • Full Member
  • ***
  • Posts: 220
  • Goldfinger64 Dev OS:10 CPU:5960x Gfx:RX480
    • View Profile
    • LS Tech Services
Re: Multi-Threaded Rendering
« Reply #24 on: July 15, 2018, 08:15:23 pm »

so, on your dual core, how many threads do you run? 2 or 4? (Since hyperthreading makes windows think you have 4 logical cores)
I have 8 cores, 16 logical cores and not all cores light up, only 8 do at a time. (obviously some cores also run other processes like windows, but they are not full)

Trev
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Multi-Threaded Rendering
« Reply #25 on: July 16, 2018, 12:25:19 am »

I have 2 physical cores and 4 logical cores = 4 threads. I suspect that you have 4 physical cores and 8 logical cores - that's what Intel calls a "8 core cpu".
Logged

AlecJames

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: Multi-Threaded Rendering
« Reply #26 on: July 16, 2018, 10:42:17 am »

Steve: these are not problems for me but I noticed recently and while you are in ART-

#096-014 - ART Renders Don't Show Panaroma Backgrounds

I think there is also an issue with image background.

A second camera does not show the panorama in the work space or rendered view.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Multi-Threaded Rendering
« Reply #27 on: July 16, 2018, 12:05:03 pm »

AlecJames: Thanks, I'll look into it.
Logged

Trevor

  • Full Member
  • ***
  • Posts: 220
  • Goldfinger64 Dev OS:10 CPU:5960x Gfx:RX480
    • View Profile
    • LS Tech Services
Re: Multi-Threaded Rendering
« Reply #28 on: July 16, 2018, 01:39:25 pm »

I have 2 physical cores and 4 logical cores = 4 threads. I suspect that you have 4 physical cores and 8 logical cores - that's what Intel calls a "8 core cpu".

Erm... no... I have 8 cores, 16 threads, Im not mistaken :P

Hmm, looking at the cores, it would seem that they are all doing something since right before pressing render they were all more-or-less idle, however only 8 red lines ever show up on the preview.

maybe Im missing something?

Ok, so doing some tests with affinity and priority it seems you made a comment earlier that less cores could be faster, it seems your right, limiting to the first thread of each core actually works out faster than allowing all threads to run.


Trev
« Last Edit: July 16, 2018, 02:01:39 pm by Trevor »
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Multi-Threaded Rendering
« Reply #29 on: July 16, 2018, 02:04:47 pm »

Trevor: You are correct. Your CPU has 8 multi threaded cores for 16 threads. Anim8or currently limits the max thread count to 8 but I'll increase that to 16 in the next build.

(P.S. Can I exchange CPUs with you :) ?)
Logged
Pages: 1 [2] 3