| 1 |
VMware SVGA3D |
| 2 |
============= |
| 3 |
|
| 4 |
This page describes how to build, install and use the |
| 5 |
`VMware <https://www.vmware.com/>`__ guest GL driver (aka the SVGA or |
| 6 |
SVGA3D driver) for Linux using the latest source code. This driver gives |
| 7 |
a Linux virtual machine access to the host's GPU for |
| 8 |
hardware-accelerated 3D. VMware Workstation running on Linux or Windows |
| 9 |
and VMware Fusion running on MacOS are all supported. |
| 10 |
|
| 11 |
With VMware Workstation 17 / Fusion 13 releases, OpenGL 4.3 is |
| 12 |
supported in the guest. This requires |
| 13 |
|
| 14 |
- The vmwgfx kernel module version 2.20 or later |
| 15 |
- The VM needs to be configured to hardware version 20 or later. |
| 16 |
- MESA 22.0 or later should be installed. |
| 17 |
|
| 18 |
You can disable GL4.3 support using environment variable SVGA_GL43=0 or |
| 19 |
lowering hardware version. |
| 20 |
|
| 21 |
Most modern Linux distributions include the SVGA3D driver so end users |
| 22 |
shouldn't be concerned with this information. But if your distributions |
| 23 |
lacks the driver or you want to update to the latest code these |
| 24 |
instructions explain what to do. |
| 25 |
|
| 26 |
Getting VMware Workstation Pro for Linux |
| 27 |
---------------------------------------- |
| 28 |
|
| 29 |
Before you can run Mesa on an SVGA3D device in a VM, you need to actually have |
| 30 |
a hypervisor that supports SVGA3D in its entirety. Such hypervisors are VMware's |
| 31 |
Workstaton Pro (Linux, Windows) and Fusion (macOS). Here we list the steps to |
| 32 |
get VMware Workstation Pro running on Linux. |
| 33 |
|
| 34 |
- Step 1: Find VMware Workstation Pro to download |
| 35 |
|
| 36 |
- Step 1.1: Create a broadcom.com account |
| 37 |
|
| 38 |
* Go to https://support.broadcom.com and click "log in" at the top-right |
| 39 |
* Create an account |
| 40 |
* Go to your email to verify your account |
| 41 |
* Log in to your account |
| 42 |
|
| 43 |
- Step 1.2: Once logged in, navigate to the Free Downloads section |
| 44 |
|
| 45 |
* Follow link to Free Downloads section https://support.broadcom.com/group/ecx/free-downloads |
| 46 |
|
| 47 |
- Step 1.3: Select your VMware Workstation Pro release |
| 48 |
|
| 49 |
* In the search box type "VMware Workstation Pro", wait for results to show up |
| 50 |
* Select "VMware Workstation Pro" |
| 51 |
* Select version 17 (as of this writing) platform -- Linux or Windows |
| 52 |
* Select the desired full version -- 17.6.3 as of this writing |
| 53 |
|
| 54 |
- Step 1.4: Accept the Terms & Conditions and download |
| 55 |
|
| 56 |
* There's a checkbox for this above the file list - tick it |
| 57 |
* Click the cloud-download button-icon for the Linux version at the bottom of the list |
| 58 |
* You will now be prompted to enter your full name and address for export controls |
| 59 |
* It will probably return you to the base support page now, so repeat steps 1.2, 1.3, 1.4 |
| 60 |
* You are now downloading the vmware workstation bundle |
| 61 |
|
| 62 |
- Step 2: Install VMware Workstation Pro |
| 63 |
|
| 64 |
* It is advisable to uninstall any previous version first; check for potentially installed *vmware-workstation* |
| 65 |
|
| 66 |
:: |
| 67 |
|
| 68 |
sudo ./VMware-Workstation-Full-17.6.3-24583834.x86_64.bundle -l |
| 69 |
|
| 70 |
* If present, proceed to uninstall it; make sure to keep your old configuration if asked! |
| 71 |
|
| 72 |
:: |
| 73 |
|
| 74 |
sudo ./VMware-Workstation-Full-17.6.3-24583834.x86_64.bundle --uninstall-component=vmware-workstation |
| 75 |
|
| 76 |
* Provide kernel headers for Workstation kernel modules built by the bundle setup script |
| 77 |
* On Ubuntu |
| 78 |
|
| 79 |
:: |
| 80 |
|
| 81 |
sudo apt-get install linux-headers-$(uname -r) |
| 82 |
|
| 83 |
* On Fedora |
| 84 |
|
| 85 |
:: |
| 86 |
|
| 87 |
sudo dnf install linux-devel-$(uname -r) |
| 88 |
|
| 89 |
* Run the following to install the package |
| 90 |
|
| 91 |
:: |
| 92 |
|
| 93 |
sudo ./VMware-Workstation-Full-17.6.3-24583834.x86_64.bundle |
| 94 |
|
| 95 |
- Step 3: Run VMware Workstation Pro |
| 96 |
|
| 97 |
:: |
| 98 |
|
| 99 |
/usr/bin/vmware |
| 100 |
|
| 101 |
|
| 102 |
Components |
| 103 |
---------- |
| 104 |
|
| 105 |
The components involved in this include: |
| 106 |
|
| 107 |
- Linux kernel module: vmwgfx |
| 108 |
- User-space libdrm library |
| 109 |
- Mesa/Gallium OpenGL driver: "svga" |
| 110 |
|
| 111 |
All of these components reside in the guest Linux virtual machine. On |
| 112 |
the host, all you're doing is running VMware |
| 113 |
`Fusion or Workstation <https://www.vmware.com/products/desktop-hypervisor/workstation-and-fusion>`__. |
| 114 |
|
| 115 |
Prerequisites |
| 116 |
------------- |
| 117 |
|
| 118 |
- vmwgfx Kernel module version at least 2.20 |
| 119 |
- Ubuntu: For Ubuntu you need to install a number of build |
| 120 |
dependencies. |
| 121 |
|
| 122 |
:: |
| 123 |
|
| 124 |
sudo apt-get install autoconf automake libtool flex bison zstd |
| 125 |
sudo apt-get install build-essential g++ git |
| 126 |
sudo apt-get install libexpat1-dev libpciaccess-dev \ |
| 127 |
libpthread-stubs0-dev \ |
| 128 |
libudev-dev libx11-xcb-dev \ |
| 129 |
libxcb-dri2-0-dev libxcb-dri3-dev |
| 130 |
sudo apt-get install libxcb-glx0-dev libxcb-present-dev \ |
| 131 |
libxcb-shm0-dev libxcb-xfixes0-dev |
| 132 |
sudo apt-get install libxdamage-dev libxext-dev \ |
| 133 |
libxfixes-dev libxkbcommon-dev |
| 134 |
sudo apt-get install libxml2-dev libxrandr-dev \ |
| 135 |
libxshmfence-dev libxxf86vm-dev |
| 136 |
sudo apt-get install mesa-utils meson ninja-build \ |
| 137 |
pkg-config python3-mako python3-setuptools |
| 138 |
sudo apt-get install x11proto-dri2-dev x11proto-gl-dev \ |
| 139 |
xutils-dev libglvnd-dev |
| 140 |
|
| 141 |
Depending on your Linux distribution, other packages may be needed. Meson |
| 142 |
should tell you what's missing. |
| 143 |
|
| 144 |
Getting the Latest Source Code |
| 145 |
------------------------------ |
| 146 |
|
| 147 |
Begin by saving your current directory location: |
| 148 |
|
| 149 |
:: |
| 150 |
|
| 151 |
export TOP=$PWD |
| 152 |
|
| 153 |
|
| 154 |
- Mesa/Gallium main branch. This code is used to build libGL, and the |
| 155 |
direct rendering svga driver for libGL, vmwgfx_dri.so, and the X |
| 156 |
acceleration library libxatracker.so.x.x.x. |
| 157 |
|
| 158 |
:: |
| 159 |
|
| 160 |
git clone https://gitlab.freedesktop.org/mesa/mesa.git |
| 161 |
|
| 162 |
|
| 163 |
- libdrm, a user-space library that interfaces with DRM. Most |
| 164 |
distributions ship with this but it's safest to install a newer |
| 165 |
version. To get the latest code from Git: |
| 166 |
|
| 167 |
:: |
| 168 |
|
| 169 |
git clone https://gitlab.freedesktop.org/mesa/drm.git |
| 170 |
|
| 171 |
|
| 172 |
Building the Code |
| 173 |
----------------- |
| 174 |
|
| 175 |
- Determine where the GL-related libraries reside on your system and |
| 176 |
set the LIBDIR environment variable accordingly. |
| 177 |
|
| 178 |
For Ubuntu systems: |
| 179 |
|
| 180 |
:: |
| 181 |
|
| 182 |
export LIBDIR=/usr/lib/x86_64-linux-gnu |
| 183 |
|
| 184 |
|
| 185 |
- Build libdrm: |
| 186 |
|
| 187 |
:: |
| 188 |
|
| 189 |
cd $TOP/drm |
| 190 |
meson builddir --prefix=/usr --libdir=${LIBDIR} |
| 191 |
meson compile -C builddir |
| 192 |
sudo meson install -C builddir |
| 193 |
|
| 194 |
|
| 195 |
- Build Mesa: |
| 196 |
|
| 197 |
:: |
| 198 |
|
| 199 |
cd $TOP/mesa |
| 200 |
meson builddir -Dvulkan-drivers= -Dgallium-drivers=svga -Ddri-drivers= -Dglvnd=enabled -Dglvnd-vendor-name=mesa |
| 201 |
|
| 202 |
meson compile -C builddir |
| 203 |
sudo meson install -C builddir |
| 204 |
|
| 205 |
|
| 206 |
Note that you may have to install other packages that Mesa depends |
| 207 |
upon if they're not installed in your system. You should be told |
| 208 |
what's missing. |
| 209 |
|
| 210 |
The generated vmwgfx_dri.so is used by the OpenGL libraries during direct rendering, and by the X.Org |
| 211 |
server during accelerated indirect GL rendering. |
| 212 |
|
| 213 |
Running OpenGL Programs |
| 214 |
----------------------- |
| 215 |
|
| 216 |
In a shell, run 'glxinfo' and look for the following to verify that the |
| 217 |
driver is working: |
| 218 |
|
| 219 |
:: |
| 220 |
|
| 221 |
OpenGL vendor string: VMware, Inc. |
| 222 |
OpenGL renderer string: SVGA3D; build: RELEASE; |
| 223 |
OpenGL version string: 4.3 (Compatibility Profile) Mesa 23.0 |
| 224 |
|
| 225 |
If OpenGL 4.3 is not working (you only get OpenGL 4.1): |
| 226 |
|
| 227 |
- Make sure the VM uses hardware version 20 or later. |
| 228 |
- Make sure the vmwgfx kernel module is version 2.20.0 or later. |
| 229 |
- Check the vmware.log file for errors. |