Loudspeaker Simulation in the Cloud

Here's how you can do loudspeaker simulations in the Cloud.

aws-5.jpg


aws-4.jpg


aws-3.jpg


aws-2.jpg


aws-1.jpg


Above are the five steps I used to create my instance in AWS. You could do this in Azure or GCP also. I've heard GCP is generally cheaper but I know AWS the best so that's what I used. (Patrick Bateman AWS Certified Solutions Architect)

I'm using this instance for my ATH ABEC sims, because the latest version that can do enclosures really needs some firepower. I'm using an AMD Epyc

Here are the specs and pricing:

  • Instance name On-Demand hourly rate vCPU Memory Storage Network performance
  • m6a.4xlarge $1.4272 16 64 GiB EBS Only Up to 12500 Megabit
 
Last edited by a moderator:
Based on current pricing at Amazon, it looks like a dedicated PC or server with 16 cores and 64gb of ram will set you back about $3000-$4000.

My thought process, in regards to running ABEC on AWS, is that I only run sims for about 8 hours a week, and I sometimes go weeks or months without running a sim. If I use an AWS instance to run ABEC sims for three days a week at 8 hours a day, that's $36 a week.

Plus, y'know, I can access the instance from anywhere in the world.
 
  • Like
Reactions: Pano
When you're installing software to your AWS instance, I think the easiest way to get it there is to simply cut and paste it from your laptop to your AWS instance.

I started out by installing these, in this order.

  • Google Chrome
  • VACS
  • ABEC
  • ATH
  • gnuplot
  • gmsh
 
So I've been evaluating what's the best way to run ABEC, and though I hate to say this, it really seems like the old LGA 2011 workstations are really hard to beat.

I first bought one of these workstations five years ago, and at that point they were five years old. These systems had become somewhat legendary because even though they were five years old in 2017, they were almost as fast as Intel's newest. This was because Intel's manufacturing has been stalled for nearly a decade.

For instance, the Intel Xeon E5-2650 was manufactured on a 32nm lithography, and they're ten years old. They retailed for $1107 in 2012. They had eight cores with a maximum clock of 2ghz.

The Intel I7 10700F was manufactured on a 14nm lithography, and they're two years old. They retailed for $298 in 2020. They had eight cores with a maximum clock of 4.8ghz.

At this point in the story, the Intel I7 probably seems like a no-brainer. Clock speed is more than double and $298 isn't a lot for a CPU. Here's the kicker though:

  • You can get those ten year old Xeons for $15 each
  • The ram costs 40% as much as modern ram

I have a workstation here at the house that has dual E5 Xeons, eight cores each, a total of sixteen cores.

I have a desktop here at the house that has a single I7 10700F, eight cores, a total of eight.

Although the clock speed of the I7 is more than twice as high, the very old workstation, with ten year old Xeons, is nearly as fast.

One of the reasons that I started to do this math, is because I'm using the new version of ATH, and because it can simulate enclosures, you need A LOT more firepower to simulate those loudspeakers. When simulating those speakers on my I7 desktop, I can see that Windows is swapping as much as 30-40GB. So, obviously, simulating enclosures in ABEC is memory hungry.

Even crazier is that I could likely use FOUR TIMES as much memory. I am currently doing the ABEC sims in such a way that the speaker is mirrored twice. IE, I am only simulating 25% of the enclosure and I'm assuming that the X and the Y axis is mirrored.

So my sims are currently using up about 30-50GB of RAM, and much of it is being swapped to the SSD. I can't make the sims any larger because they will never finish unless I get more RAM.

In a nutshell, for loudspeaker simulation, clock speed is probably secondary to how much RAM you have. My ABEC sims will finish by swapping to my SSD, but ideally we'd have the sim run in ram completely. My SSD is fast, but RAM is still 10X faster than any SSD.

Here's a quick comparison of current retail prices:

A Very Old Intel Workstation
  • workstation price - about $300 used on eBay
  • Cost for 128GB of RAM - $200 used on eBay
  • Two E5 Xeons - $40 for both, used on eBay
Total = $540


A New Intel Workstation
  • motherboard, case and power supply - about $300 new
  • Cost for 128GB of RAM - $270 new on Amazon
  • Intel I7 10700F - $255 new
Total = $825

You can see from the prices, that it's definitely close. The new Intel workstation will be smaller, use less power, and do more work per CPU, because the maximum clock speed is faster. The big "x-factor" I think, is how cheap you can get the RAM. On eBay I've noticed that the price of ECC RAM is all over the map. I think this is because error correcting RAM is typically pulled out of a server, and desktops can't use it (generally.) There are listings for 128GB of ECC RAM on eBay for as little as $80.
 
It's kinda shocking, but even the fairly expensive AWS EC2 instances aren't dramatically faster than a desktop.

I've never tried running ABEC in the cloud until this weekend. I was hoping I might reduce computation time by 2-4x as much.

This really doesn't seem to be the case.

For instance, I just finished running a job on an EC2 instance with sixteen vCPUs and 128GB of ram, and it still took two hours (see attached.)

As someone who is semi-decent with I.T. infrastructure, I think these are the issues:

  • AWS is obviously throttling the CPUs. I am paying for sixteen vCPUs and I left task manager running the whole time, and it never used more than 75% of the CPUs possible. On my desktop, ABEC uses 100% of my CPU cores almost all the time.
  • There must be some things in ABEC that are single threaded.
  • In a previous post I'd speculated that ABEC may be a memory hog, but I think I overestimated that. With 128GB for my EC2 VM, it never used more than 20GB. YMMV of course, particularly if your waveguide and enclosure are large, or you're trying to do sims above 10khz. Dropping the upper frequency limit from 16khz to 10khz can reduce your computation time by as much as 50% if you tweak the granularity of your mesh.
  • Microsoft's licensing is REALLY punitive against AWS. It absolutely boggles my mind how much MSFT is making off of AWS. If you have an instance with 16 vCPUs running up in AWS for a month, you can easily wind up spending $1200(!) and 40% of that(!!!) can be the cost of the Windows license. Absolutely absurd.
  • Hosting a Windows VM in Microsoft Azure is cheaper than AWS but not a lot cheaper. MSFT is clearly using cloud hosting as a cash cow for Windows licenses. Ironic, since Windows 11 is basically free now. (I couldn't find any way of running Windows 10 or 11 in the cloud, short of renting a bare metal server and installing Windows 11 manually. There's some "virtual desktop" options on Azure and AWS but their horsepower doesn't even match a $800 laptop.

So despite my earlier post where I was suggesting that a ten year old workstation with sixteen cores might be ideal, I'm starting to lean on the idea of using something new with a very high clock speed and a moderate amount of ram.

At $350 retail, the Intel Core I7 12700 looks compelling: https://www.anandtech.com/show/1726...k-review-high-performance-for-the-mid-range/9
 

Attachments

  • 2022-04-10 16_44_09-54.187.138.124 - Remote Desktop Connection.png
    2022-04-10 16_44_09-54.187.138.124 - Remote Desktop Connection.png
    17.6 KB · Views: 62
I just increased my PC memory to 32GB and run larger simulations overnight. In the UK electricity is currently 20.8p per kWh and is expected to increase substantialy in 6 months, worth considering before buyng an older server system that is less power efficient.
 
In my Octa-core I7 desktop rig, I took one of my ABEC sims and cranked it up from a maximum frequency of 8khz to 16khz and reduced the throat resolution from 6mm to 4mm. I also increased the number of frequencies by 50%.

Before doing so I doubled my ram from 16GB to 32GB, just to be safe. (With 16GB it was swapping to my NVME SSD about 20% of the time.)

After those changes, an ABEC sim went from about one hour to nearly three hours. This was with 4,742 elements.
 

Attachments

  • 2022-04-11 18_42_13-squaft - TightVNC Viewer.png
    2022-04-11 18_42_13-squaft - TightVNC Viewer.png
    21.6 KB · Views: 68
Apologies for reviving such an old thread, but I bookmarked this a whole back as it seemed like a sensible & reasonable approach. I'd rented an Azure instance temporarily while working on my MSc, but my time was running so short that I just ended up letting an unused workstation (thanks to COVID) crunch the models for 48 hours.

However, thanks to the insane computing power requirements at our new virtual film production startup I now find myself having access to multiple Windows PC workstations that have 128 CPU cores, 256GB or more of RAM, and 48GB of VRAM...

This isn't about bragging, but apart from some fun research we're running with various AI model stuff currently, they're mostly idle overnight.

The short of it is that I'd be happy to run some of the more 'scary' ABEC/AKABAK models in the downtime on one of the machines if something looks promising enough to justify it.

AKABAK is much better at being a modern, multi-threaded application by the way. But you still need to consider the amount of RAM that is going to be required by each process for parallel calculation of each element. Optimising that cut my runtimes in half for some full-3D multi-horn models with >60k elements.

I should probably post this in the main Ath4 thread, but don't want to be absolutely swamped immediately. I know you tend to churn out ideas @Patrick Bateman but since many of them are based on 3D models and my personal favourite Synergy/Unity alignments, it seems to make sense to start with some of the stuff you've been experimenting with of late.

Let me know if you're interested. I'm only a PM away 🙂
 
  • Like
Reactions: tmuikku
Can someone please give an example or two of what a typical AKAKBAK simulation that takes many hours on 16 cores and 32 GB of memory is simulating. The reason for asking is that I suspect there may be a more efficient way of performing the simulation. Not for grids with small numbers of elements but for those with relatively large numbers.