Tutorial: Steps to run on AWS (Windows Machine with CUDA)

Hi and thanks for creating this great tool! I had a case that was too large for my own GPU, and setting it up on AWS was a bit tricky.

Here's a step-by-step approach to getting a case running in the AWS cloud:


  • download FreeCad for Windows from here: https://www.freecadweb.org/downloads.php
  • login to AWS console, navigate to EC2, quick link to your running instances would be this, but it depends on your region: https://eu-central-1.console.aws.amazon.com/ec2/v2/home?region=eu-central-1#Instances:instanceState=running
  • after clicking on "launch instance", you can give it a name and select an image. When you head to "Browse more AMIs", you can search for "Microsoft Windows Server 2019 with NVIDIA Tesla Driver", it should appear in the "AWS Marketplace AMIs" tab, select it and continue
  • Under "Instance type" in the launch screen, the "p3.2xlarge" is selected by default. Such a big one might not be necessary, for me a "p2.xlarge" was working just fine
  • The "Network Settings" can be left as default, it's important to leave the "Allow RDP traffic from" setting the way it is, since we'll be accessing the Windows server from a Windows client (laptop). RDP is a protocol from Microsoft to access other computers remotely
  • Under "Configure Storage", choose how much GB of storage you need, an SSD (the default "gp2) should be selected

=> then you're ready to launch the instance. When prompted for a signature file, download it and open it with a text editor. It is used for getting the password of the instance.

That can take a while, on the EC2 instances screen you can see the "Instance state" and "Status check", once they're both green you're ready to connect.

  • select the checkbox on the left of the table to select your instance
  • click "connect" on the top right of the screen
  • on the next screen, go to the "RDP client" tab
  • click "Download remote desktop file". The file name should be the instance name from the previous step
  • on the lower end of the screen, click "Get password" and paste the content of the certificate. This will reveal the password. Copy it
  • in your client's download folder, double-click the remote desktop file you just downloaded, which will connect you to your instance, and prompt you for a password, paste it here

=> That should log you in to your instance, you should now see the screen of the instance. Important note: Clicking the "X" on the top will not shut down the remote computer, it only closes the remote connection. For instances to not create additional cost, they need to be shut down and terminated in the EC2 console.

  • Minify the remote (server) window, and copy the freecad installer on your client. Open the server window again and paste it, e.g. on the server's desktop. Once it is done copying, you can run the installation of FreeCAD
  • When the FreeCAD installation in the server is done, open a file explorer and head to "C:\Program Files\FreeCAD 0.19\bin".
  • There, copy and paste the file "opengl32sw.dll" and rename it to "opengl32.dll"
  • Now, FreeCAD can be run without errors
  • The installation of the DualSPhysics Macro inside FreeCAD is the same as on a local machine:
  • In the header bar, select "Macro/Macros..." then "Addons..." and look for "DesignSPHysics"
  • install the macro and restart FreeCAD

=> Now, FreeCAD is able to run DesignSPhysics Cases. You can create them on your client, zip them and copy and paste the zipped file to the server to save some time (and money). Likewise, you can copy and paste the simulation results to your client, which can take a while

  • Important note: When you're copy and pasting larger files, the download or upload will be stopped when you copy anything else on your client or the server. It's good to get a coffee. If you're downloading multiple files, only the most recent file will be stopped, so check that you have ALL the parts of the simulation
  • you can copy and paste while the simulation is running


Finally, a note about costs: I ran 5 machines in parallel, for more than 50 hours each. The bill was about 1190 USD for EC2 and almost 90 USD in data transfer costs for that month. The AMI itself is advertised at around 4-5 USD per hour. It's tempting to spin up more instances when you have that power at your fingertips... but it grows with time and the number of instances. And that price is almost a new graphics card ;-)

So here's the final bit, how to stop the instances and not pay more (after you've downloaded the files):

  • go to the EC2 console, select the instance
  • in the top right, under "Instance state" you can "Terminate instance", which will remove the storage as well as remove the instance - you don't pay anything more from this point. If you choose "Stop instance", it will keep your data and incur less costs than a running instance. I have no exact numbers for this though
Sign In or Register to comment.