UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero

This works! thank you so much!

Try restarting the PC, this worked for me. (SO: Ubuntu 22.04)