Building OptixPathTracer from the OptixSDK Samples generates 18Kb PTX file, the exe runs on GTX1060 with ~5fps
while building from scratch the same code generates a 39Kb PTX file and runs slower ~4fps.
Win10.0.17763.0, Cuda10.1, Optix7.0.0, VS Community 2019
Probably I’m missing something but can’t figure it out, here is the procedure taken:
- Created a new CUDA Project in VS2019
- Hand copied the project configuration from the sample on every category, only the include and lib paths differ but point to the same SDK
- Created a new CUDA Source file, cloned the content from the OptixPathTracer.cu
- Copy/Pasted the sample header and cpp files inside the new project
- Changed the Project Configuration for CUDA C/C++ (-maxrregcount=0 --machine 64 -ptx -cudart static)
- Superstition number, decided to have a coffee.
- Project build successfully in Release mode, but the generated .ptx file has a lot more instructions compared with freshly build from the OptixSDK Samples.
After revisiting the project from the SDK I see that it doesn’t have CUDA as build dependency but instead it uses CMakeLists with what I’m not very familiar but obviosly is the only difference between both projects, also it’s my first experience with both CUDA and Optix and probably there is a better way to create a new project using those two that I’m not aware of but for now I’ll be happy if I could at least build the optimized .ptx file.
The Q is what nvcc flags I’m missing?