cudnn is also used for e.g. convolutions as seen here 9.
It’s was a good idea to disable cudnn, since it can potentially hide some other errors.
As you can see in your example, the actual error is a device mismatch.
Make sure all parameters and inputs are on the same device.
While embed and h0 seem to be on the default GPU, self.gru or some other layers might still be on the CPU.
Try to run your code with CUDA_LAUNCH_BLOCKING=1 python script.py args, as this will point to the right line of code, which causes this error.