Segmentation Fault on Jetson Nano

Hello,

I am getting a segmentation fault after running a torch GPU code in Jetson Nano. When I analyzed the core dump, the error seems to be this:

Using host libthread_db library “/lib/aarch64-linux-gnu/libthread_db.so.1”.
Core was generated by `python for_loop2.py’.

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000007ef0fd4280 in ?? () from /usr/lib/aarch64-linux-gnu/libcudnn_ops_infer.so.8
[Current thread is 1 (Thread 0x7f89c85170 (LWP 21479))]

(gdb) where
#0 0x0000007ef0fd4280 in ?? () from /usr/lib/aarch64-linux-gnu/libcudnn_ops_infer.so.8
#1 0x0000007ef0ff18f0 in ?? () from /usr/lib/aarch64-linux-gnu/libcudnn_ops_infer.so.8
Backtrace stopped: not enough registers or memory available to unwind further

Is it required to release any GPU memory specifically or make any specific call to the Nvidia APIs to let know that the program has released the GPU?