Maybe take a look at the implmenetation of:
static IDynamicRHIModule* LoadDynamicRHIModule(ERHIFeatureLevel::Type& DesiredFeatureLevel, const TCHAR*& LoadedRHIModuleName)
in RHI/Windows/WindowsDynamicRHI.cpp
:
RHI is chosen by the project settings (first DefaultGraphicsRHI, then TargetedRHIs are consulted, Default maps to D3D12). After this, a separate game-only setting (does not affect editor) bPreferD3D12InGame selects between D3D12 or D3D11 (but will not have any effect if Vulkan or OpenGL are chosen). Commandline switches apply after this and can force an arbitrary RHIs. If RHI isn’t supported, the game will refuse to start.
If you set a breakpoint on that call, you can see the call chain to get there.