• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1VMware SVGA3D
2=============
3
4This page describes how to build, install and use the
5`VMware <https://www.vmware.com/>`__ guest GL driver (aka the SVGA or
6SVGA3D driver) for Linux using the latest source code. This driver gives
7a Linux virtual machine access to the host's GPU for
8hardware-accelerated 3D. VMware Workstation running on Linux or Windows
9and VMware Fusion running on MacOS are all supported.
10
11With VMware Workstation 17 / Fusion 13 releases, OpenGL 4.3 is
12supported 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
18You can disable GL4.3 support using environment variable SVGA_GL43=0 or
19lowering hardware version.
20
21Most modern Linux distributions include the SVGA3D driver so end users
22shouldn't be concerned with this information. But if your distributions
23lacks the driver or you want to update to the latest code these
24instructions explain what to do.
25
26Components
27----------
28
29The components involved in this include:
30
31-  Linux kernel module: vmwgfx
32-  User-space libdrm library
33-  Mesa/Gallium OpenGL driver: "svga"
34
35All of these components reside in the guest Linux virtual machine. On
36the host, all you're doing is running VMware
37`Workstation Pro <https://www.vmware.com/products/workstation-pro.html>`__ or
38`Fusion <https://www.vmware.com/products/fusion.html>`__.
39
40Prerequisites
41-------------
42
43-  vmwgfx Kernel module version at least 2.20
44-  Ubuntu: For Ubuntu you need to install a number of build
45   dependencies.
46
47   ::
48
49      sudo apt-get install autoconf automake libtool flex bison zstd
50      sudo apt-get install build-essential g++ git
51      sudo apt-get install libexpat1-dev libpciaccess-dev \
52                           libpthread-stubs0-dev \
53                           libudev-dev libx11-xcb-dev \
54                           libxcb-dri2-0-dev libxcb-dri3-dev
55      sudo apt-get install libxcb-glx0-dev libxcb-present-dev \
56                           libxcb-shm0-dev libxcb-xfixes0-dev
57      sudo apt-get install libxdamage-dev libxext-dev \
58                           libxfixes-dev libxkbcommon-dev
59      sudo apt-get install libxml2-dev libxrandr-dev \
60                           libxshmfence-dev libxxf86vm-dev
61      sudo apt-get install mesa-utils meson ninja-build \
62                           pkg-config python3-mako python3-setuptools
63      sudo apt-get install x11proto-dri2-dev x11proto-gl-dev \
64                           xutils-dev libglvnd-dev
65
66Depending on your Linux distribution, other packages may be needed. Meson
67should tell you what's missing.
68
69Getting the Latest Source Code
70------------------------------
71
72Begin by saving your current directory location:
73
74::
75
76   export TOP=$PWD
77
78
79-  Mesa/Gallium main branch. This code is used to build libGL, and the
80   direct rendering svga driver for libGL, vmwgfx_dri.so, and the X
81   acceleration library libxatracker.so.x.x.x.
82
83   ::
84
85      git clone https://gitlab.freedesktop.org/mesa/mesa.git
86
87
88-  libdrm, a user-space library that interfaces with DRM. Most
89   distributions ship with this but it's safest to install a newer
90   version. To get the latest code from Git:
91
92   ::
93
94      git clone https://gitlab.freedesktop.org/mesa/drm.git
95
96
97Building the Code
98-----------------
99
100-  Determine where the GL-related libraries reside on your system and
101   set the LIBDIR environment variable accordingly.
102
103   For Ubuntu systems:
104
105   ::
106
107      export LIBDIR=/usr/lib/x86_64-linux-gnu
108
109
110-  Build libdrm:
111
112   ::
113
114      cd $TOP/drm
115      meson builddir --prefix=/usr --libdir=${LIBDIR}
116      meson compile -C builddir
117      sudo meson install -C builddir
118
119
120-  Build Mesa:
121
122   ::
123
124      cd $TOP/mesa
125      meson builddir -Dvulkan-drivers= -Dgallium-drivers=svga -Ddri-drivers= -Dglvnd=true -Dglvnd-vendor-name=mesa
126
127      meson compile -C builddir
128      sudo meson install -C builddir
129
130
131   Note that you may have to install other packages that Mesa depends
132   upon if they're not installed in your system. You should be told
133   what's missing.
134
135   The generated vmwgfx_dri.so is used by the OpenGL libraries during direct rendering, and by the X.Org
136   server during accelerated indirect GL rendering.
137
138Running OpenGL Programs
139-----------------------
140
141In a shell, run 'glxinfo' and look for the following to verify that the
142driver is working:
143
144::
145
146   OpenGL vendor string: VMware, Inc.
147   OpenGL renderer string: SVGA3D; build: RELEASE;
148   OpenGL version string: 4.3 (Compatibility Profile) Mesa 23.0
149
150If OpenGL 4.3 is not working (you only get OpenGL 4.1):
151
152-  Make sure the VM uses hardware version 20 or later.
153-  Make sure the vmwgfx kernel module is version 2.20.0 or later.
154-  Check the vmware.log file for errors.
155