Ptxas error while migrating from OptiX 6.0 to 7.2

Could you please list some details about your system configuration as well:
OS version, installed GPU(s), and display driver version are always required.

First, do the OptiX SDK 7.2.0 examples compile and work on your system?

As there are plenty of API differences, I have to rewrite my CUDA files, however, for some reason I can’t compile them anymore.

The code looks fine on first glance.

Are you saying this error happens during compile time of your CUDA code to PTX source code?
In that case there shouldn’t be any errors from the PTX assembler (ptxas) because that it not involved at that step.
The NVCC command line needs to compile from CUDA to PTX source only, not obj or cubins.

I can compile that just fine with MSVS 2019 and CUDA 11.1 and OptiX 7.2.0 headers.
(I just plugged your code into the raygeneration.cu of my OptiX 7 examples.)
The resulting PTX code contains one inline assembly “call” instruction which can only be resolved by the OptiX internal compiler.

// Generated by NVIDIA NVVM Compiler
//
// Compiler Build ID: CL-29069683
// Cuda compilation tools, release 11.1, V11.1.74
// Based on LLVM 3.4svn

.version 7.1
.target sm_50
.address_size 64

  // .globl	__raygen__oxMain
.visible .const .align 8 .b8 cs[8];

.visible .entry __raygen__oxMain(

)
{
  .reg .f32 	%f<2>;
  .reg .b32 	%r<4>;
  .reg .b64 	%rd<5>;


  .loc 1 41 1

  .loc 2 1096 5
  // inline asm
  call (%r1), _optix_get_launch_index_x, ();
  // inline asm
  .loc 1 44 3
  ld.const.u64 	%rd1, [cs];
  cvta.to.global.u64 	%rd2, %rd1;
  mul.wide.u32 	%rd3, %r1, 16;
  add.s64 	%rd4, %rd2, %rd3;
  mov.f32 	%f1, 0f00000000;
  .loc 1 44 3
  st.global.v4.f32 	[%rd4], {%f1, %f1, %f1, %f1};
  .loc 1 45 1
  ret;
}

Please read some of these threads which talk about the CUDA to PTX compilation NVCC command line options:
https://forums.developer.nvidia.com/t/how-would-you-generally-compile-and-run-a-program-which-has-optix-without-make-or-cmake/75302/2
https://forums.developer.nvidia.com/t/problem-with-running-optix-6-5-program-invalid-value-for-gpu-architecture/157284/4

include <optix.h>

Make sure that is the version from OptiX SDK 7.2.0.

Which SM target version did you use for the PTX compilation?
Try SM 5.0 which is the minimum GPU version (Maxwell) supported by OptiX since version 6.

You could also try updating the CUDA Toolkit to 10.x or 11.x versions.
(Always install in ascending order. Never install the display driver components of that.)
According to the CUDA installation guide for Windows even CUDA 11.1 still supports versions of MSVS 2015.

If you say this happens with the compiled PTX code during OptiX module compile or pipeline compile and link time, then that would mean you have a new enough display driver for OptiX 7.2.0 installed, otherwise you wouldn’t have passed the function table ABI version check.
The error is from the ptxas which ships with the display driver and is invoked by OptiX at runtime, so it’s GPU and driver dependent (that’s why that system configuration is mandatory).

Just to be sure, did you compile the PTX input sources with debug information, --device-debug or -G on the NVCC command line? (But then the OptiX compiler would have complained earlier.)
If yes, try without.