ERR in nvidia-smi

I have two RTX 3090 GPUs. One from gigabyte and one from Zotac. I am using them to run OpenACC/CUDA jobs on Linux Mint. I have nvidia hpc SDK 23.1. I am getting ERR! under fan speed in nvidia-smi after I finish one application running. The GPU gets stuck in P5 state. The only way to reset it is to restart the system. This error happens to the GPU in slot 0, ie the gigabyte one. Any help?