Press Ctrl + S to save the change and restart the game to check if the “GTA 5 failed initialization err_gfx_d3d_init” error gets solved.
If you are using DirectX 10 version, change the value to 0. Press Ctrl + F keys to open the Find box and type dx in it. Press Win + E keys to open File Explorer, and then locate the DocumentsRockstar GamesGTA V (or GTA 5) directory and right-click the settings.xml file and select Open with Notepad. To fix the error, you can try changing the DirectX value based on your graphics card version. Sometimes the “GTA 5 err_gfx_d3d_init” error occurs due to improper DirectX value. Tip: If you have a multiple GPU setup, try running the game with only one GPU and check if the “err gfx d3d init” error gets solved.