This might be because you have more than one screen/graphics card. You could try to write adapter-1 in the settings.txt file.
Failed to create a graphics device
The following methods may help you fix this problem on Windows 10: 1] Reinstall DirectX A basic fix for the issue is to update or reinstall DirectX. By updating or reinstalling DirectX, you can just replace the corrupt or incompatible components of DirectX from your computer. 2] Reinstall the Graphics Card Driver
The best practice for you should be to go to the website of your manufacturers like NVIDIA, AMD or Intel. Go to the section called Drivers. And download the latest drivers from there. After the download has been completed, just install the graphics driver and reboot your computer. There is another way. You may use Display Driver Uninstaller to remove AMD, INTEL, NVIDIA Drivers, and then use NVIDIA Smart Scan, AMD Driver Autodetect or Intel Driver Update Utility to download and install or update the respective drivers. 3] Check the Hardware manually You can also try cleaning the dust off the components like the Graphics Card of the computer. I would recommend using a small blower or rubbing the components with a soft cloth. Make sure that you do not damage any parts with moisture or cause harm to any circuits while carrying out this task. Check if it is not already damaged physically. Make sure that you do this very carefully. Because even a slight bruise can cause your computer to stop working and may cause you financial expenses. If you are not confident, you can ask a qualified technician to do this for you. 4] Power Cycle the computer To Power Cycle a computer means to turn off the computer in such a way that the power completely cuts off and all the fresh configurations of files are loaded when the computer is booted up. You can shut down your computer first and if you are using a laptop with a removable battery, you have to remove the battery for a few minutes as well, before you put it back in and boot your laptop. In case of a desktop, press and hold the power button until the CPU goes off and take out the power cable for a few minutes. Plug it back in and boot your computer to check if your issues are fixed then. Hope something here helps you.