xref: /aosp_15_r20/external/mesa3d/docs/drivers/svga3d.rst (revision 6104692788411f58d303aa86923a9ff6ecaded22)
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`Fusion or Workstation <https://www.vmware.com/products/desktop-hypervisor/workstation-and-fusion>`__.
38
39Prerequisites
40-------------
41
42-  vmwgfx Kernel module version at least 2.20
43-  Ubuntu: For Ubuntu you need to install a number of build
44   dependencies.
45
46   ::
47
48      sudo apt-get install autoconf automake libtool flex bison zstd
49      sudo apt-get install build-essential g++ git
50      sudo apt-get install libexpat1-dev libpciaccess-dev \
51                           libpthread-stubs0-dev \
52                           libudev-dev libx11-xcb-dev \
53                           libxcb-dri2-0-dev libxcb-dri3-dev
54      sudo apt-get install libxcb-glx0-dev libxcb-present-dev \
55                           libxcb-shm0-dev libxcb-xfixes0-dev
56      sudo apt-get install libxdamage-dev libxext-dev \
57                           libxfixes-dev libxkbcommon-dev
58      sudo apt-get install libxml2-dev libxrandr-dev \
59                           libxshmfence-dev libxxf86vm-dev
60      sudo apt-get install mesa-utils meson ninja-build \
61                           pkg-config python3-mako python3-setuptools
62      sudo apt-get install x11proto-dri2-dev x11proto-gl-dev \
63                           xutils-dev libglvnd-dev
64
65Depending on your Linux distribution, other packages may be needed. Meson
66should tell you what's missing.
67
68Getting the Latest Source Code
69------------------------------
70
71Begin by saving your current directory location:
72
73::
74
75   export TOP=$PWD
76
77
78-  Mesa/Gallium main branch. This code is used to build libGL, and the
79   direct rendering svga driver for libGL, vmwgfx_dri.so, and the X
80   acceleration library libxatracker.so.x.x.x.
81
82   ::
83
84      git clone https://gitlab.freedesktop.org/mesa/mesa.git
85
86
87-  libdrm, a user-space library that interfaces with DRM. Most
88   distributions ship with this but it's safest to install a newer
89   version. To get the latest code from Git:
90
91   ::
92
93      git clone https://gitlab.freedesktop.org/mesa/drm.git
94
95
96Building the Code
97-----------------
98
99-  Determine where the GL-related libraries reside on your system and
100   set the LIBDIR environment variable accordingly.
101
102   For Ubuntu systems:
103
104   ::
105
106      export LIBDIR=/usr/lib/x86_64-linux-gnu
107
108
109-  Build libdrm:
110
111   ::
112
113      cd $TOP/drm
114      meson builddir --prefix=/usr --libdir=${LIBDIR}
115      meson compile -C builddir
116      sudo meson install -C builddir
117
118
119-  Build Mesa:
120
121   ::
122
123      cd $TOP/mesa
124      meson builddir -Dvulkan-drivers= -Dgallium-drivers=svga -Ddri-drivers= -Dglvnd=enabled -Dglvnd-vendor-name=mesa
125
126      meson compile -C builddir
127      sudo meson install -C builddir
128
129
130   Note that you may have to install other packages that Mesa depends
131   upon if they're not installed in your system. You should be told
132   what's missing.
133
134   The generated vmwgfx_dri.so is used by the OpenGL libraries during direct rendering, and by the X.Org
135   server during accelerated indirect GL rendering.
136
137Running OpenGL Programs
138-----------------------
139
140In a shell, run 'glxinfo' and look for the following to verify that the
141driver is working:
142
143::
144
145   OpenGL vendor string: VMware, Inc.
146   OpenGL renderer string: SVGA3D; build: RELEASE;
147   OpenGL version string: 4.3 (Compatibility Profile) Mesa 23.0
148
149If OpenGL 4.3 is not working (you only get OpenGL 4.1):
150
151-  Make sure the VM uses hardware version 20 or later.
152-  Make sure the vmwgfx kernel module is version 2.20.0 or later.
153-  Check the vmware.log file for errors.
154