I just installed MS VS 2019 and CUDA 10.1 and attempted to build my project that contains three .cu files (along with a bunch of .cpp files). If I sit there and repeatedly click “Rebuild”, it occasionally builds correctly, but most of the time it fails during the .cu compiles with this error:
fatal error C1041: cannot open program database ‘D:\VarScreen\x64\Debug\vc142.pdb’; if multiple CL.EXE write to the same .PDB file, please use /FS
I tried putting /FS several places and no matter what I did it either did nothing or caused another error.
What’s weird is that this is a random failure. If I try enough times, eventually (usually after just a few tries) it builds correctly. My guess is that the CUDA compiler is trying to write to the pdb file simultaneously from several threads and it’s hit or miss contention.
Any thoughts on how to fix this? Thank you!