Here is the fix I used to resolve the same problem of the error code 31 on the Microsoft Basic Display Adapter found in Windows Device Manager.
The conditions I was working with, Hardware installed:
- Ryzen 7 7800X3D (CPU)
- Gigabyte RTX 3070 Ti (GPU)
The drivers from the GPU were all up to date.
The attempt to reinstall drivers via Device Manager failed, same error 31 code.
My CPU has integrated graphics, so I went to AMD website support page for that CPU
(see URL: https://www.amd.com/en/support/apu/amd-ryzen-processors/amd-ryzen-7-processors/amd-ryzen-7-7800x3d )
I downloaded their Auto-Detect and Install tool for my windows version and installed it.
Using that tool, it detected all the AMD related hardware and installed all the AMD drivers I required. When that finished, the Microsoft Basic Display Adapter driver that was in error, was removed, replacing it with the drivers for my CPU (AMD Radeon Graphics drivers).
A reboot was required to complete the install.
This fix showed the error was due to the missing CPU display drivers, not the GPU drivers. My CPU has integrated graphics, and thus, required the necessary drivers for it to work with my windows version.
My BIOS would adjust settings to work accordingly since I do have a dedicated video card (GPU).
Hope that clears it up for you. :)