How to get DX12 device and cmdlist through UE4.14

ID3D11Device* Device = (ID3D11Device*)RHIGetNativeDevice();
ID3D12GraphicsCommandList CmdList = ParentDevice>GetDefaultCommandContext().CommandListHandle.GraphicsCommandList();

D3D12: Removing Device.
    Exception thrown at 0x00007FFF1FA43C58 in UE4Editor.exe: Microsoft C++ exception: _com_error at memory location 0x000000253950E0A0.
    Assertion failed: !GIsRHIInitialized [File:C:\UE4\UEPCPSVR\UE4.14\UE4-4.14_96\Engine\Source\Runtime\D3D12RHI\Private\Windows\WindowsD3D12Device.cpp] [Line: 395]