I assume the created code snippet in the error message runs fine or does it also crash?
Assuming the former, could you post an executable code snippet to reproduce this issue as well as which GPU you are using?