Interesting. I wonder if you accidentally have values beyond 255 in your caption. That usually gives a nastier looking error, but it could explain what you’re seeing.
You might try running this with the environment variable CUDA_LAUNCH_BLOCKING=1.  That usually will make the stack trace point to the line where things are actually going wrong.