device kernel image is invalid What to look for when seeing this error message?

I’ve been getting the CUDA error:


when calling cuModuleLoad on a PTX file. Admittedly, I’m doing some non-kosher things with NVCC and CUDA so I probably deserve this error, but I was wondering if anyone could provide general pointers as to what to look for when investigating the cause of this. All I’ve been able to find so far is a post suggesting a reinstallation of the driver (possibly to fix a version problem?).


It seems that commenting out a call line in the PTX removes the error message:

call handle_task,(%rd5, %rd20, %rd21, %rd22);

Not sure if that is helpful, just something that I’ve found.

And I’ve solved my own problem.

For future reference, I had to change the names of the parameters to handle_task in my custom PTX kernel. Maybe they were conflicting with some other variables in the kernel?