Find what the PyCUDA compilation error was

I'm trying to compile a PyCUDA kernel. The compilation fails with the error:

"nvcc preprocessing of %s failed" % source_path, cmdline, stderr=stderr
pycuda.driver.CompileError: nvcc preprocessing of C:\Users\bigvi\AppData\Local\Temp\tmpd_r5jc2z.cu failed
[command: nvcc --preprocess -use_fast_math --generate-line-info -arch sm_75 -m64 

C:\Users\bigvi\AppData\Local\Temp\tmpd_r5jc2z.cu --compiler-options -EP

Running the same command from a command prompt works fine.

The CompileError exception has a strerr attribute which contains the stderr of the compilation. It is empty. Only by placing a break-point inside PyCUDA did I find the actual error, which was reported by nvcc to stdout.

Is there a way to get the compilation output without placing breakpoints in PyCUDA?

@bigvito19 , this may be better posted into an nvidia forum (if you haven't already done that)

https://forums.developer.nvidia.com/c/accelerated-computing/cuda/206

This is often caused by a PATH or ENV issue.

Since it works fine from the command line but fails when compiling, it's possible somewhere a PATH or ENV var is changed or overwritten and so forth.

Also, maybe try working on a unix-based system instead of Windows:

C:\Users\bigvi\AppData\Local\Temp\tmpd_r5jc2z.cu failed

This is a windows filesystem but this is a forum to help linux and unix users.

As you are having trouble compiling on your windows machine, this forum is not the best place to seek help.

Personally speaking, I have not logging into any windows-based system in at least two decades, maybe closer to three.

Happy Holidays.