Adding to launch parameter leads to error on optixLaunch()

I’m experiencing problems when trying to add variables to the launch parameter struct. I’ve used the OptixTriangle example from the SDK as a reference and it is working as expected. When I try to add lighting variables to the launch parameter it leads to an optixLaunch failure (code 7001). Here is what the struct looks like:

struct SystemParameter
{
    //8-byte alignment
    OptixTraversableHandle top_object;
    float4* output_buffer;

    // From triangle SDK example
    float3 cam_eye;
    float3 cam_u, cam_v, cam_w;
    
    // Variables added that lead to error
    float3 ambient_light_direction;
    float view_sensitivty;
};

However, this code runs successfully on another laptop with the same driver version (511.79) but different GPU (my laptop has a M1000M). Both laptops are using CUDA 11.4 and OptiX 7.4. Does anyone know if my GPU is causing the issue or something else?

That’s definitely not enough information to say what is going wrong.

You changed the launch parameter struct and things stopped working on one of your systems. And now?

Please always provide the following system configuration information when asking about OptiX issues:
OS version, installed GPU(s), VRAM amount, display driver version, OptiX (major.minor.micro) version, CUDA toolkit version (major.minor) used to generate the input PTX, host compiler version.

Your laptop with the Maxwell GPU is failing? What is the other one not failing?
Did this work before? Means is that a regression with the 511.79 display drivers?
Which streaming multiprocessor target did you use for the *.cu to *.ptx source code compilation?
(Maxwell needs SM 5.x versions and SM 5.0 is deprecated in CUDA 11. Should still work though, you would just need to suppress the deprecation warnings with -Wno-deprecated-gpu-targets on the nvcc command line.)

If that launch failure code 7001 is from OptiX, that is an OPTIX_ERROR_INVALID_VALUE.
Please try setting a logger callback with the highest level 4 inside the OptixDeviceContextOptions and enable the validation mode in there as well in debug targets. (You can find examples doing that inside the OptiX SDK.)

For any further analysis you’d need to provide a minimal and complete reproducer.