Yes, I face the same problem with jupyter. Restarting kernel also does not do the trick. In fact, jupyter starts a bunch of processes with IDs in a sequence. They won’t even show up on your nvidia-smi command.
The only way i’ve found to find them is use
sudo fuser -v /dev/nvidia*

Then, kill the processes using PID.
OR just kill all ipython kernel stuff using
pkill -f ipykernel