Probably you could use os.environ['CUDA_LAUNCH_BLOCKING'] = 1 at the beginning of your notebook before importing any other library.
If that doesn’t work, you could export the notebook as a Python script (.py) and run it in your terminal.