spinsphotonics / fdtdz

Fast, scalable, accessible photonic simulation
MIT License
114 stars 13 forks source link

CUDA_ERROR_OUT_OF_MEMORY: out of memory #8

Closed Guowu-Mcgill closed 1 year ago

Guowu-Mcgill commented 1 year ago

Hey Jesse,

Thanks for this excellent open source. I tried on my end with an Nvidia GTX 3060 GPU (12 Gb Memory).

The installation finished properly without any errors. However, when I try out the example, I got warnings like below until the program failed (see below for detail). It seems the code fails because of insufficient memory. So, I tried to reduce the simulation grid cells to 100 100 100, but, the program gives me another error and still fails.

Do you have any idea about possible reasons/solutions to this? Many thanks!

image

with the same grid as the example, image

with a grid size of 100 100 100 cells, image

Regards, Guowu

jlu-spins commented 1 year ago

Thanks for bringing this up Guowu!

As expected, the speed and size of simulations does depend on the GPU that you are using. Specifically, the (gridu, gridv) parameters not attempt to use more than the number of SMs which are on your GPU (gridu * gridv < total # SMs on GPU).

Also wrote up an answer to this at https://github.com/spinsphotonics/fdtdz/blob/main/README.md#cuda_error_cooperative_launch_too_large

Hope that helps!

Guowu-Mcgill commented 1 year ago

Hey Jesse,

Many, many thanks for this help!

It works pretty well after I modified (gridu, gridv) parameters. Thanks!!!

Regards, Guowu