Open vincefn opened 3 years ago
I tested this also under windows 10 with CUDA 11.2 and the issue is reproduced with the above code snippet
In the CUDA 11.2 release notes you can read among known issues: "cuFFT planning and plan estimation functions may not restore correct context affecting CUDA driver API applications"
Under linux with cuda toolkit 11.5 installed in a conda environment (cufftGetVersion() reports 106000 ; driver 460.91.03), the issue is still present, even if the cuda release notes do not mention the issue any more (?)...
Problem
I have found an issue when using CUDA 11.1, where creating a FFT plan, using it and doing another operation (simple sum reduction), then deleting the plan, re-creating another one and doing this again ends up with a
cuFuncSetBlockShape failed: invalid resource handle
The following minimal example can be used to reproduce the issue (needs to be done in a fresh session for reproductibility)
Using the above code in a fresh python session always ends up with the following error:
The error occurs during the pycuda sum reduction, but it seems triggered by the deletion of the plan and re-creation of another one, so it may be due to cuFFT. I noted than in CUDA 11.1 the release notes indicate: "After successfully creating a plan, cuFFT now enforces a lock on the cufftHandle. Subsequent calls to any planning function with the same cufftHandle will fail" but I have no idea if that can be related.
Environment
List the following info: