Learning Center

Setting Up GPU-Accelerated Computing Within COMSOL Multiphysics®


COMSOL Multiphysics® includes support for GPU-accelerated computing. This guide features quick setup instructions for installing and configuring the software necessary to use this functionality.

In COMSOL Multiphysics®, GPU acceleration can significantly increase performance for time-dependent simulations that use the discontinuous Galerkin (dG) method, such as those using the Pressure Acoustics, Time Explicit interface, and for training deep neural network (DNN) surrogate models. This functionality is available for Windows® and Linux® operating systems and requires a compatible NVIDIA® graphics card, along with an installation of the CUDA® Toolkit.

Note: This functionality is available for COMSOL Multiphysics® version 6.3.

Compatibility and Requirements

The operating system and hardware requirements for the CUDA® Toolkit component include the following:

Setup Process for the CUDA® Toolkit

The process of installing the CUDA® Toolkit and then enabling GPU-accelerated computing in your COMSOL Multiphysics installation includes the following:

  1. Installing the NVIDIA® CUDA® Toolkit
  2. Installing COMSOL Multiphysics® with GPU compute support
  3. Verifying the CUDA Toolkit Installation in COMSOL Multiphysics®

Each step is outlined below in further detail.

Installing the NVIDIA® CUDA® Toolkit

Step 1: Download the installer

Start by downloading the CUDA Toolkit 12.4 installer from the CUDA Downloads page. You should select the appropriate operating system, architecture, distribution (option for Linux® OS), and version number from the Select Target Platform section of the CUDA Toolkit Download page.

After navigating the tree of supported configurations and systems, the final choice of installer type will be either local or network. The local installer is a larger initial download, but includes everything necessary for installation. The network installer is a much smaller initial download, which only downloads further files if and when they are needed. You can choose the installer type that best suits your needs. Both types will create installations compatible with COMSOL Multiphysics®.

Step 2: Run the installer

The installation process is different for Windows® and Linux® operating systems, and differs between Linux® distributions as well. To ensure that the installation instructions are up-to-date, please follow the official installation instructions provided by NVIDIA®:

If a minimal installation is desired, select the Custom (Advanced) installation option. The only parts of the CUDA® Toolkit that are needed for use with COMSOL Multiphysics® are the CUDA Runtime and Driver components.

Installing COMSOL Multiphysics® with GPU Compute Support

In the COMSOL Installer, there are two sections with options regarding GPU acceleration. These sections are detailed in the steps below, with screenshots from the Windows® version of the Installer. The Linux® version looks slightly different, but the same instructions apply. For general instructions on how to install COMSOL Multiphysics, please see the COMSOL Multiphysics® Installation Guide in the COMSOL Documentation or the Learning Center article "How to Install COMSOL Multiphysics®".

Step 1: The Products page

Note: This step is only required if you are installing GPU compute support for training DNN surrogate models. To resume installing GPU compute support for the dG method, please proceed to step 2.

The available selection of products to install depends on your license. All COMSOL Multiphysics 6.3 installations include support for using GPU acceleration with the discontinuous Galerkin method. To be able to use GPU acceleration for DNN training, the CUDA DNN Support component must be selected on the Products page of the Installer. Note that this will add 1.3 GB to your COMSOL Multiphysics installation on Windows® and 1.8 GB to your installation on Linux®.

A UI screenshot of the COMSOL Installer with the Products tab selected and the CUDA DNN Support checkbox highlighted.

A screenshot of the COMSOL Multiphysics 6.3 Installer with the Products page open and the CUDA DNN Support checkbox highlighted.

Step 2: The Options page

The CUDA section in the Options page contains a CUDA Directory field for the path to the CUDA Toolkit installation. In most cases, installing the CUDA® Toolkit before starting the COMSOL Multiphysics Installer will set environment variables that lets the Installer detect this path automatically. If the correct CUDA Toolkit directory is not detected automatically, the path can be set manually here or changed in the Preferences window settings after installation is complete.

A UI screenshot of the COMSOL Installer with the Options tab selected and the CUDA Directory file path entered.

A screenshot of the COMSOL Multiphysics 6.3 Installer with the Options page open and the default CUDA Toolkit installation path in the CUDA Directory field.

Verifying the CUDA Toolkit Installation in COMSOL Multiphysics®

After installing and configuring COMSOL Multiphysics® and the CUDA® Toolkit, you can verify your installation by starting COMSOL Multiphysics® and opening the Preferences window. Do this by going under the File menu and selecting Preferences. From there you can navigate to the Computing section and click on the GPU Acceleration page. Lastly, click the Verify CUDA Installation button.

A UI screenshot of the Preferences window in COMSOL Multiphysics with the Verify CUDA Installation dialog open on a Windows® operating system.

The Preferences window in COMSOL Multiphysics® in Windows®, with a Verify CUDA Installation dialog open.

A UI screenshot of the Preferences window in COMSOL Multiphysics with the Verify CUDA Installation dialog open on a Ubuntu operating system.

The Preferences window in COMSOL Multiphysics® in Ubuntu®, with a Verify CUDA Installation dialog open.

GPU-accelerated computing is now supported in your installation of COMSOL Multiphysics® and is ready for use. Some examples of enabling GPU-acceleration in the settings in COMSOL Multiphysics® can be seen in the figures below.

The Model Builder with the Pressure Acoustics, Time Explicit interface selected with the settings to enable GPU-accelerated computing selected. The Model Builder with the Pressure Acoustics, Time Explicit interface selected with the settings to enable GPU-accelerated computing selected.
The Model Builder with the Time-Dependent Solver node expanded and the Hardware Acceleration node selected showing the settings to enable GPU-accelerated computing The Model Builder with the Time-Dependent Solver node expanded and the Hardware Acceleration node selected showing the settings to enable GPU-accelerated computing
The Model Builder with the Deep Neural Network function selected with the settings to enable GPU acceleration for training. The Model Builder with the Deep Neural Network function selected with the settings to enable GPU acceleration for training.

The Use accelerated solver formulation checkbox (left), Accelerated solver for discontinuous Galerkin checkbox (center) and Train on GPU checkbox (right) are selected for a Pressure Acoustics, Time Explicit model, time-dependent simulation that uses the dG method, and DNN training, respectively.

Further Learning

For more information on GPU support for time-dependent simulations using the dG method and surrogate model training, please see the COMSOL Multiphysics Release Notes and COMSOL Multiphysics Reference Manual in the documentation.

NVIDIA and CUDA are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and/or other countries. Linux is a registered trademark of Linus Torvalds in the U.S. and other countries. Microsoft and Windows are trademarks of the Microsoft group of companies. Ubuntu is a registered trademark of Canonical Ltd.


Submit feedback about this page or contact support here.