venturi123 / DRLinFluids

An open-source Python platform of coupling deep reinforcement learning and OpenFOAM
Other
135 stars 28 forks source link

GPU capability #7

Open e-dinesh opened 2 years ago

e-dinesh commented 2 years ago

Does this code can be run on GPUs?

venturi123 commented 2 years ago

Hi @e-dinesh, Due to the limitation of OpenFOAM and DRL approach, DRLinFluids is mainly based on CPU currently. We may develop this package so that can be run on GPU, but the schedule is still not finalized. We will be very appreciate If you have any suggestions about it.

antoniocgodoi commented 3 days ago

I managed to run machine learning code in GPU, but it didn't show much improvement because ML represents a small part of the processing. Here are the steps:

1) Install Nvidia-Container-Cli 2) Use singularity shell --writable DRLinFluids/, then inside the container do: drl, then conda install cudnn==7.6.4 and exit the container 3) Now, singularity shell --nvccli DRLinFluids/ to allow Nvidia driver inside the container. To check if the GPU is visible, inside the container, use: nvidia-smi For instance, to run the square VIV example with GPU, we use:

python launch_multiprocessing_traning_square2D_VIV.py --device 'cuda'