How to dynamically link nvrtcCompileProgram to libtorch_cuda.so

I built a pytorch 2.0 image using pytorch builder repo. I need an image with no/minimum static linking as possible. I turned off these environment variables for the same:
USE_STATIC_CUDNN=0
export ATEN_STATIC_CUDA=0
export USE_CUDA_STATIC_LINK=0

The resultant image has nvrtcCompileProgram as statically linked in libtorch_cuda.so. I need to dynamically intercept this API but static linking makes it impossible. How can I change the build to make it dynamically linked?

Could I inquire whether you’ve found a solution to this issue? I’m facing a similar need but I’m looking to intercept the CUDA Driver API.