Programs compile but cannot be loaded

I have been able to setup sample1 from scratch without any problems, this was relatively simple as it only requires 1 ptx to display a green buffer.

But as soon as I tried to run sample2 I started having runtime problems. My .cu files successfully compile, although two of them have warnings:

warning : Cannot tell what pointer points to, assuming global memory space

This shouldn’t really cause any trouble, but strangely enough these programs don’t load in runtime:

The ray gen program is nullptr. So is the phong first hit, but not the any hit. I tried resolving this warning by setting compute_10,sm_10 to compute_20,sm_20 but that just broke more programs.

You can ignore this warning. It will show up when you use compute_10, sm_10.

Can you verify that “C:\Users\Diede\Documents\Visual Studio 2010\Projects\OptixSample2\Debug\pinhole_camera.cu.ptx” exists? If the ptx file is in a different location, you will have a problem.

You could also wrap the lines with error checking to make debugging much easier:

RT_CHECK_ERROR2( rtProgramCreateFromPTXFile( *context, path_to_ptx, "pinhole_camera", &ray_gen_program ) );

Yes, if I paste the path in the explorer and remove the extra ‘/’ the files opens. I currently can’t do RT_CHECK_ERROR2() because I use my own rendering library and therefor didn’t get sutil in it. I can try to add it some later time. Any other ideas? I’m guessing there might be something wrong with the compilation, as some parts work (like the fist hit in phong.cu fails, but the any hit works fine). Thanks for the swift reply.

After debugging like you said, I found I had the same problem as in this post: https://devtalk.nvidia.com/default/topic/764788/rttrace-causes-weird-error/

The issue has been resolved, thanks again!