Thanks for the information.
By stack trace I mean the output before the THCudaCheck error.
Do you get any lines of code?
Is the code working on a single T4 or does it also crash?
Would it be possible to get a reproducible code snippet, so that we could have a look?