Thanks for your post in Microsoft Community.
Hello, I noticed that you set GpuPreference to 2. Do you have multiple discrete graphics cards installed in your computer?
If you only have your own integrated graphics card and a discrete graphics card, this value is usually set to 0/1
The specific GPU number represents the graphics card you can CTRL+SHIFT+ESC to open the Task Manager and click on the Performance tab, the bottom will be GPU0/GPU1 to represent your current graphics card usage number.
If you don't have more than one discrete graphics card and set GPuPreference to 2, it will not be able to call the information of the graphics card represented by this number, and it will automatically return to the integrated graphics card represented by 0.
At the same time, if you are using an NVIDIA graphics card, please go to the NVIDIA graphics control interface and the system's Start - Settings - Games - Game Mode - Graphics Settings, add Java.exe under the Java path to a separate control list, and then set it to a high-performance graphics card.
If anything is unclear, please do not hesitate to let me know.
Best Regards,
Edward - MSFT | Microsoft Community Support Specialist