Segmentation Fault on Jetson Nano


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/”.
Core was generated by `python’.

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

(gdb) where
#0 0x0000007ef0fd4280 in ?? () from /usr/lib/aarch64-linux-gnu/
#1 0x0000007ef0ff18f0 in ?? () from /usr/lib/aarch64-linux-gnu/
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?