How to enable NVidia Optimus drivers so that VM’s may have hardware graphics acceleration

Take a look at the great instructions here for installing Bumblebee which will enable Optimus (Non-discrete NVidia GPU) drivers in Linux. Esentually the below (Note OS version, in this case Fedora 25):

sudo dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora25/noarch/bumblebee-release-1.2-1.noarch.rpm
sudo dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora25/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
sudo dnf install bumblebee-nvidia bbswitch-dkms VirtualGL.x86_64 VirtualGL.i686 primus.x86_64 primus.i686 kernel-devel

Reboot.

Now on the VMware Workstation application launcher (To open the KDE Menu Editor, Right-Click on the Fedora start menu icon and select “Edit Applications…”), prefix the launch command with “optirun”:

Last, edit the VMware Workstation preferences to allow blacklisted drivers:

sudo nano /home/dave/.vmware/preferences

Add the following to the end of the file:

mks.gl.allowBlacklistedDrivers = "TRUE"

Start VMware Workstation and make sure to edit the settings of the VM to enable hardware accelerated graphics. The above file edit can be done individually per VM too in the VM’s .vmx file with the same entry.