Error with rtTrace

Hi,
I am getting the following error after compiling the optix code. Its coming from rtTrace() function call because after commenting it out, the compilation succeeds. Please help if I am missing something obvious.

I am using Optix3.6.2, CUDA 6.0.

ptxas : fatal error : Ptx assembly aborted due to errors

Code:

#include “Helper.cuh”
#include <optix.h>
#include <optix_world.h>

// Payload for ray type 0: visible rays
struct RadiancePL
{
float3 color;
int recursion_depth;
//int primID;
};

// Payload for ray type 1: shadow rays
struct ShadowPL
{
//int recursion_depth;
float attenuation;
};

// Optix semantic variables
rtDeclareVariable(uint2, launch_index, rtLaunchIndex, “GPU thread index”);
rtDeclareVariable(optix::Ray, cur_Ray, rtCurrentRay, “Ray in execution”);
rtDeclareVariable(ShadowPL, shadow_PL, rtPayload, “Shadow Ray Payload”);
rtDeclareVariable(RadiancePL, radiance_PL, rtPayload, “Radiance Ray Payload”);
rtDeclareVariable(float, intersect_dist, rtIntersectionDistance, “Parametric intersection distance”);

// Host variables
rtDeclareVariable(rtObject, top_object, , “Root node where Ray-Tracing context is launched”);
rtDeclareVariable(erVertex, cam_source, , “Camera source”);
rtDeclareVariable(erVertex, cam_target, , “Camera target”);
rtDeclareVariable(float, cam_fovX, , “Camera Horizontal Field of View”);
rtDeclareVariable(float, cam_fovY, , “Camera Vertical Field of View”);
rtDeclareVariable(float3, cam_up, , “Camera up”);
rtDeclareVariable(int2, img_dim, , “Image Dimensions”);

RT_PROGRAM void RayGen_Radiance()
{
RadiancePL payload;
payload.color = make_float3(0.0f);
payload.recursion_depth = 0; // initialize recursion depth

// Create ray
optix::Ray ray = /*creating code*/;

// Trace ray
rtTrace(top_object, ray, payload);

// Write result to output buffer
//writeOutput( payload.color );

}

Sounds like your nvcc command line is invoking the PTX assembler. That would mean you’re compiling to the incorrect output target. Please change the output target to produce only PTX code with the --ptx command line option.
When touching the nvcc command line in your project, also make sure to not use any debug flag (-g , -G) and use --use_fast_math to avoid inadvertent use of doubles.

Thanks! Seems to build correctly now.