When configuring a platform layer for a vGPU, the nVidia control panel may fail to launch. The driver may be working or it may fail with code 31 or code 43, but the nVidia control panel itself will not open. You may see an event in the Windows Application event log about nvcplui.exe crashing. The same behavior can be seen in a published image where any Elastic Layering mode is enabled. You can install the nVidia drivers in your OS layer safely, but the published image will still have the problem.
Install NVidia in the Platform Layer.
Create a new layer called 'Preserve NVidia"
In that layer, open the registry and navigate to:
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\unifltr]
Add a value called AlwaysOnBoot (if it doesn't already exist) as a multi string value. Add the following two lines:
C:\Program Files\NVIDIA Corporation\
C:\Program Files (x86)\NVIDIA Corporation\
Please note the trailing \ at the end of the paths, as that tells the software that it is a directory, and we should
keep all of the children of the directory on the image.
Nothing else is to be added or installed in this layer.
Finalize the layer.
When deploying an image that requires NVidia, include the layer 'Preserve NVidia'. This will preserve the settings for NVidia in the final Image. This is because any update to the NVidia directories that may have taken place while in a deployed desktop that is running and using the image with NVidia, will not persist after the desktop has been reverted.