Bump. The lack of clear documentation on how to do this is ridiculous. I just need to generate a .ptx file from a .cu file. Selecting -ptx in Visual studio does not do anything. There is no explicitly clear explanation of what exactly to put in the nvcc command line if you do it manually.
ion\OptiX SDK 2.1.0\include" -I"C:\Program Files (x86)\Microsoft Visual Studio 1
0.0\VC\include" --machine 32
Is what I’ve been trying. I get the error “missing source file name”. I don’t know what that means. It originally gave me the error that it couldn’t find any of the windows include files, so I copied them into the OptiX folder. I have never used command line for compiling for. I’ve had no reason to. It is unreasonable to expect someone who’s never used it before to know what to do without explicit instruction. I was stuck for 2 days because I did not know you could not use spaces in names without quotes.
It does not specify these things anywhere.
It works if I use a blank .cu file. But I cannot compile anything in the SDK nor the example above.
Another thing. One of the SDK files stated it required “NOMINMAX” defined on Windows. I tried #DEFINE NOMINMAX and it still did not work. It turned out that you have to define it before #include Windows.h. I was literally stuck on this for a month. It was a huge waste of time. It might seem obvious to someone who’s used this before, but without explicit instruction, I don’t see any reason to assume these specifics.
Go to the Project Properties in Visual Studio 2010. In CUDA C/C++, in Common change the property Keep Preprocessed Files to Yes(–keep). Build the project. You can see the .ptx file in Debug folder.