Compilation as python module does not use GPU

I’ve compiled blender as a python module, with Optix enable for gpu compilation but when a scene is rendered, the script seems to default to CPU rendering, without any utilization on my GPU card.
Running bpy.context.preferences.addons[‘cycles’].preferences.get_devices() returns an empty list.

Any idea what could be the issue? I simply load a scene.blend file with all my gpu presets, then call bpy.ops.render.render(write_still=True).
When I run the same script from my local Blender install (v3.5), it uses the GPU just fine. Any ideas as to what I may be doing wrong here?

Version: 3.6
OS: Windows 11
GPU: RTX A4000 (mobile)

I’m using msvc 2022 build tools 17.5.5
Compilation command: make bpy developer 2022b

gpu flags

WITH_CYCLES_CUDA_BINARIES ON
CYCLES_CUDA_BINARIES_ARCH sm_86 compute_86
OPTIX_ROOT_DIR “C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.3.0”

python flags

WITH_PYTHON_INSTALL OFF
WITH_PYTHON_MODULE ON
WITH_AUDASPACE OFF

Release: 3.6 (318f9b259bae9d044a2ff7428b441c07123904d6, 2023-Jul-24). As an aside there’s a bug in bpy_interface.cc where main_python_enter() and main_python_exit() are not declared as extern “C” so the linker looks for the mangled name instead, throwing a LNK2019 error.