Thank you all for your kind time and consideration. Solved the issue by following the following steps:
- uninstalling cuda 11.8 and installing cuda 11.7
- copying all files of cudnn in lib, include and bin to respective folders in cuda
- removing the environment and recreating
- installing cuda version of pytorch