If you have a SM6 compatible card, you need to change an option in the project settings.
Project settings>Search for SM6>Check the DirectX12(SM6 Experimental) option and you’ll probably have to restart the editor and let it recompile shaders. I haven’t tried it, but that should enable it for you.
It might be that it also has to support ray tracing as well or something like that. Or maybe they have to be DX12 feature level 12.1 or something. I’m sure someone else probably has the answer. I’d stick with SM5 for now though because 6 is still experimental.
I just had this problem and in my case the SM6 optioned wasn’t enabled (DirectX12 was). Once I did, it worked.
I’m running UE5 on a GTX 1060, yup!
For what it’s worth, here’s a screenshot of the two options.
I can confirm that the suggestion by @AngryParsec works.
If your graphics drivers have DirectX 12_2 support showing Shader Model 6.6 or higher (I had to upgrade from Windows 10 to 11 to get past Shader Model 6.5, FWIW), and your Project Settings have the Platforms - Windows > D3D12 Targeted Shader Formats > SM6 checkbox already, then the problem may be the second option in their screenshot.
Targeted RHIs > Default RHI: must be set to DirectX 12. Leaving it “Default” makes the Shader Model 6 preview gray out.