RT_ERROR_INVALID_SOURCE with rtProgramCreateFromPTXFile()

I wrote a .cu file and I have compiled it into a .ptx file (I have used -use_fast_math and -g, G are turned off). But when I try to read the programs from the host code using rtProgramCreateFromPTXFile() or the C++ equivalent createProgramFromPTXFile(), it gives the Invalid_Source error. I also tried reading the whole file in a string but that did not help.

I am using CUDA 6.5 (also tried with CUDA 6.0), Optix 3.6.2, Geforce 750M, driver 347.09.

Here is the ptx file ([url]http://1drv.ms/1xXGCpi[/url]).

Here is the .cu file ([url]http://1drv.ms/1xXGJBj[/url]).

Engine.cu (11.9 KB)

Any idea on this? I am pulling my hair off for the last couple of days on this now. :(

That file sharing site is not accessible from within our offices. Please attach the sources to your forum post. Use the paper clip icon in the top right corner when hovering over a submitted post to attach files.

I would recommend to use OptiX 3.6.3 or OptiX 3.7 beta 2.

OptiX 3.6.2 or 3.6.3 do not support CUDA 6.5, only up to CUDA 6.0.
Please read the OptiX release notes before setting up an OptiX development environment.
If you want to compile with CUDA 6.5 please update to OptiX 3.7 beta 2.

Check your compile settings and look into the *.ptx files if they have really been built with the correct CUDA compiler.

To verify if your host side routine works, try loading any of the *.ptx files in the OptiX SDK-precompiled-samples/ptx folder.

Solved the problem. I was using the wrong dlls all along. Usually they give a “Application failed to start correctly” error but this one didn’t so I assumed I had the correct dlls.

Anyways I upgraded to Optix 3.7 beta 2 and things seems to be working.