OptiX sample from scratch

I’m trying to recreate the OptiX samples from scratch in Visual Studio 2010, everything seems to work just fine except one line in my .cu:

When I remove the last line the program runs just fine. What could be causing this? The error messages aren’t really clear. Thanks!

The problem is that you’re running your PTX file through the PTX assembler ptxas.
Make sure your nvcc command line is generating PTX code only by using the --ptx parameter.

The actual ptxas error comes from a macro which OptiX will convert to PTX code when stitching the final kernel from your intermediate PTX input. Only the final kernel will be sent to the PTX assembler during runtime of your application later on.

This solved my problem, thanks!