AMD Threadripper not working well with Blender
Closed, ResolvedPublic

Description

AMD threadripper 1950x
X399 AORUS Gaming 7 motherboard
64 gb Ram

Running latest chipset drivers + up to date bios

Windows 10 64 bit running on gtx 970 GPU

**Blender Version 2.79
Broken: 5bd8ac9

rendering large scene takes hours before render proces starts

To reproduce this problem, you need to load a large scene like the production demo scene from the blender benchmark. If you use the default performance settings it will take more time then rendering the scene with a low amount of threads.
the difference is huge. Default settings ( 32 threads) can slow down the rendering proces with 2 hours. Using 4 threads only takes minutes.

The more RAM a scene has, the more problematic this issue is. The difference in the production benchmark is 2 vs 7 minutes. The benchmark scene is +/- 10 GB Ram. If i render a scene with 30 GB ram it is 4 minutes vs 2 hours

rob (blenderpedia) renamed this task from Threadripper not working well with Blender to AMD Threadripper not working well with Blender .
rob (blenderpedia) added a project: Rendering.

Hello Rob.
Can you go to this page and follow the instructions for installing the Microsoft Process Explorer
to better show the threads running during that process?

https://superuser.com/questions/462969/how-can-i-view-the-active-threads-of-a-running-program

I created a video including microsoft Process Explorer.

if you need more details, let me know. : https://www.youtube.com/watch?v=DWyLEBmS8t8&feature=youtu.be

Brecht Van Lommel (brecht) triaged this task as Incomplete priority.Oct 15 2017, 1:31 PM

Which parts of the render are slow? The video shows just the synchronizing objects stage, is BVH build slow too, and path tracing?

In the video I think it's the OpenMP threads doing a lot of the work. To determine if that's the problem specifically, you can run Blender from the command line with OpenMP threads disabled or reduced, and see if that helps:

cd c:\<blender installation directory>
set OMP_NUM_THREADS=1
blender
rob (blenderpedia) added a comment.EditedOct 15 2017, 1:47 PM

Which parts of the render are slow? The video shows just the synchronizing objects stage, is BVH build slow too, and path tracing?

At this point in the video the synchronizing objects stage slows down and takes around 2 hours before it starts with the BVH and path tracing.
The BVH and path tracing runs fine, even with the 32 threads.

In the video I think it's the OpenMP threads doing a lot of the work. To determine if >that's the problem specifically, you can run Blender from the command line with >OpenMP threads disabled or reduced, and see if that helps:

Did not work, still freezing. I included a new video to show the difference if i reduce the threads to 4: https://youtu.be/vUe1IXLb7Uk

It doesn't look like it's the CPU.
You may want to see if it is a GPU bottleneck.
GPUview is the tool for that, a description of it is here;
https://graphics.stanford.edu/~mdfisher/GPUView.html

For SDK that has GPUview for Win10 is here:
https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

You want to make sure the Windows Performance Toolkit is checked on install.

@Joel Godin (FloridaJo), the GPU is not involved in the synchronizing objects stage, so I doubt it's causing issues here.

The Cycles side of synchronizing objects is single threaded, so not so likely to cause the issue by itself. It would be useful to test if the same issue happens when rendering with Blender Render. There's various modifiers using multithreading, using either the task scheduler or OpenMP. I still suspect subsurf using OpenMP the most, but OMP_NUM_THREADS should have affected that.

Intresting result when doing a blender internal benchmark test. I used an 11 GB ram scene on my 4770K and threadripper workstations.

When pre processing the scene, the threadripper is equal with the 4770K. As aspected, the threadripper renders faster as well. Seems like there is no issue with the internal render engine.

When using cycles benchmark scenes, the threadripper is always slower when pre processing the scene. Not only slower, it freezes the whole system for a long time. This only counts for large scenes. Under 10 gb ram it is almost not causing issues

I can make a full lengt comparison video to show the difference in systems if you want.

@Brecht Van Lommel (brecht) I'm not sure he did the OpenMP test as you described.
The video showed him changing threads in the UI as opposed to a command line command. Is that the same?
Rob, can you verify that you ran this in command line?

cd c:\<blender installation directory>
set OMP_NUM_THREADS=1
blender

@Brecht Van Lommel (brecht) I'm not sure he did the OpenMP test as you described.
The video showed him changing threads in the UI as opposed to a command line command. Is that the same?
Rob, can you verify that you ran this in command line?

cd c:\<blender installation directory>
set OMP_NUM_THREADS=1
blender

The latest video was a comparison between 4 and 32 threads. I tried the console boot, but no difference.

Here a video: https://youtu.be/0Cp6WwREWwA

Does it work if you unpack the textures first?

The first time i tried to render the scene was unpacked. After hanging for hours i started using all the benchmark files on the blender website and comparing this with my intel system. On this point i saw a significant difference between the threadripper and my intel sytem. Not on the small ones like the BMW, classroom, but the production benchmark and my own scenes. In my opinion most of the threadripper tests where done on these scenes, and not large scale RAM scenes.

Brecht Van Lommel (brecht) raised the priority of this task from Incomplete to Normal.Oct 17 2017, 12:15 PM

@Sergey Sharybin (sergey), is there a machine with a CPU like this in the Blender Institute?

@Brecht Van Lommel (brecht), we don't have threadripper at the studio, only Ryzen 7 1800X.

Some other questions / ideas to troubleshoot the issue:

  • Make sure all Windows updates are installed.
  • Disable any possible power saving setting in BIOS.
  • Disable any possible power saving settings in Windows itself.
  • Disable HyperThreading.
  • Check whether Blender detects proper number of CPU threads.
  • Get Ubuntu LiveCD and see if there will be a performance issue on Linux.
rob (blenderpedia) added a comment.EditedOct 17 2017, 12:55 PM

@Brecht Van Lommel (brecht), we don't have threadripper at the studio, only Ryzen 7 1800X.

Some other questions / ideas to troubleshoot the issue:

  • Make sure all Windows updates are installed.
  • Disable any possible power saving setting in BIOS.
  • Disable any possible power saving settings in Windows itself.
  • Disable HyperThreading.
  • Check whether Blender detects proper number of CPU threads.
  • Get Ubuntu LiveCD and see if there will be a performance issue on Linux.

I checked all of them, only the Ubuntu option left. However, i can provide the studio with a threadripper system for trial & error, just let me know.

I included a benchmark test, http://www.userbenchmark.com/UserRun/5496362 still trying to figure out what is wrong

AMD was meant to send us (Blender Institute) a threadripper in July already. I reminded them again what happens with it.

Loaning us your system I wouldn't recommend. Not only because we can't immediately work on it (might take weeks or a month), but also because we probably want to install fresh OS'es on it.

Brecht and Sergey are both on the conference this week. Maybe it's fun to bring the system to the new "hackerspace" room there, and check of if someone has time to investigate it.

Right, I'd be happy to debug it at bconf. Remote desktop access would work as well at some other time.

We've just received a beefy system with Threadripper! Testing started :)

So nice!, now burn the CPU with some crazy scenes to find out if there is something wrong with scene buffering.

All our standard benchmark files survive. Performance is good. We don't have time now to restore or test production files.
It would go much faster if you would share a case, or tell us how to produce a case that's slow? Use one of the benchmark files, duplicate stuff or so?

Managed to redo system becoming frozen at some point during synchronization after BIOS update.

Currently suspecting SpinLock to cause this. Experimented with alternative SpinLock implementation and it seems to solve the issue to me.

@Robert Frunzke (rob), please do the following:

  1. Download ftp://ftp.blender.org/sergey/threadreaper/blender-master-spin_lock-experiment.zip
  2. Unpack it
  3. Try rendering using blender-orig.exe (this is unmodified version of current master, just to confirm that the issue happens for you using my builds -- this build is done by a newer MSVC than the official releases, so that might matter)
  4. After that try using blender-fix.exe and see if that solves any performance issues.

Note that there is no CUDA support in this builds.

EDIT @Robert Frunzke (rob), did you check whether you've got same freezes when rendering from Linux LiveCD?

Sergey Sharybin (sergey) lowered the priority of this task from Normal to Incomplete.Nov 13 2017, 5:46 PM

Setting priority to incomplete since we are awaiting more feedback now.

I can confirm this fix works!
Thanks a lot for solving this problem.

I can confirm this fix works!
Thanks a lot for solving this problem.

@Sergey Sharybin (sergey) gave two fixes can you say which one fixed the issue?

Blender-fix solved the issue

@Sergey Sharybin (sergey)

Great job identifying the problem and handling it. I can also confirm this works.

Unfortunately there is a handle leak somewhere in there.

I've taken to restarting my threadrippers every 12 hours or so to clear out the handles, but if you could fix this too that would be awesome.

Thank you so much for what you've already done.

Please report a new bug report

Strike that. CPUID and AMD Ryzen Master were running at the same time. Without them it maintains about 47,500 handles for hours. My bad.