I had the same error while compiling on a remote server. I think this happened because I logged in using Remote Desktop (RDP). When I logged in using VNC and compiled, the error no longer ran.
Please note that it is not possible to install the CUDA Toolkit through RDP, so this is unlikely to happen if you do not use both methods to connect to the server.
source share