pymapdl icon indicating copy to clipboard operation
pymapdl copied to clipboard

Examples of Numba and NVIDIA GPU Acceleration with PyMechanical and PyMAPDL

Open RomanIlchenko1308 opened this issue 1 year ago • 0 comments

Description

I am seeking examples or guidance on how to leverage Numba and NVIDIA GPU acceleration directly within the PyMechanical and PyMAPDL libraries of the PyAnsys project.

While I understand that Ansys Mechanical and MAPDL have built-in support for GPU acceleration, my goal is to explore the potential of custom GPU-accelerated computations using Numba and CUDA in conjunction with PyAnsys tools.

Questions:

  • Is it possible to integrate Numba with PyMechanical and PyMAPDL for custom GPU-accelerated computations?
  • Can NVIDIA GPUs be utilized effectively within PyMechanical and PyMAPDL for enhanced performance?
  • Has Ansys extended tutorials about how to use GPUs for the Ansys Fluent / Ansys Mechanical to speed up simulations?

Environment

  • Operating System: Windows 11
  • Ansys Version: 2022R2
  • NVIDIA Driver Version: 546.01
  • CUDA Version: 12.3
  • GPU Model: NVIDIA GeForce RTX 4060
  • CUDA Toolkit Version: 12.3

How to check the version of NVIDIA and CUDA on Windows 11:

NVIDIA and CUDA version:

nvidia-smi

Ouput:

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 546.01                 Driver Version: 546.01       CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                                                                             |                                                                                                 
|-----------------------------------------+----------------------+----------------------+
|  NVIDIA GeForce RTX 4060 ...  WDDM                                                    |                                             
+-----------------------------------------+----------------------+----------------------+

CUDA Toolkit version

nvcc --version

Output:

+-----------------------------------------+----------------------+----------------------+
| CUDA Toolkit 12.3                                                                     |
+-----------------------------------------+----------------------+----------------------+

p.s. if I missed something in the issue description, please let me know and I will try to add it.

🐍 Which Python version are you using?

3.11

📦 Installed packages

ansys-api-mapdl==0.5.1
ansys-api-mechanical==0.1.2
ansys-api-platform-instancemanagement==1.1.0
ansys-mapdl-core==0.68.3
ansys-mapdl-reader==0.53.0
ansys-math-core==0.1.5
ansys-mechanical-core==0.11.1
ansys-mechanical-env==0.1.6
ansys-platform-instancemanagement==1.1.2
ansys-pythonnet==3.1.0rc3
ansys-tools-path==0.6.0
appdirs==1.4.4
certifi==2024.7.4
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
clr-loader==0.2.6
colorama==0.4.6
contourpy==1.2.1
cycler==0.12.1
fonttools==4.53.1
geomdl==5.3.1
grpcio==1.64.1
idna==3.7
importlib_metadata==8.0.0
kiwisolver==1.4.5
llvmlite==0.43.0
matplotlib==3.9.1
numba==0.60.0
numpy==1.26.4
packaging==24.1
pandas==2.2.2
pillow==10.4.0
platformdirs==4.2.2
pooch==1.8.2
protobuf==3.20.3
psutil==6.0.0
pyansys-tools-versioning==0.5.0
pycparser==2.22
pyiges==0.3.1
pyparsing==3.1.2
python-dateutil==2.9.0.post0
pytz==2024.1
pyvista==0.44.0
requests==2.32.3
scipy==1.14.0
scooby==0.10.0
six==1.16.0
tabulate==0.9.0
tqdm==4.66.4
typing_extensions==4.12.2
tzdata==2024.1
urllib3==2.2.2
vtk==9.3.1
zipp==3.19.2

RomanIlchenko1308 avatar Jul 10 '24 16:07 RomanIlchenko1308