• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Performance Tips
2================
3
4Intel GPUs
5----------
6
7#. Keep the system updated with the latest kernel and Mesa versions.
8#. Ensure SoC firmware is up-to-date. These firmware updates currently
9   require installing the Windows graphics driver; firmware updates
10   via `fwupd` are in progress.
11#. Use Wayland where possible, as it supports additional modifiers for
12   better performance.
13#. For MTL and newer integrated GPUs, disable VT-d if virtualization is
14   not needed.
15#. For discrete GPUs:
16
17   #. Enable `ReBAR`_
18   #. For workloads that keep the GPU busy (e.g. 3D videogames),
19      minimize idle power consumption by enabling `ASPM`_ powersave mode.
20   #. For "bursty", latency-sensitive workloads (e.g. AI inference),
21      enable ASPM performance mode.
22
23.. _ReBAR: https://www.intel.com/content/www/us/en/support/articles/000090831/graphics.html
24.. _ASPM: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/6/html/power_management_guide/aspm
25
26Software rendering
27------------------
28
29#. Turn off smooth shading when you don't need it (glShadeModel)
30#. Turn off depth buffering when you don't need it.
31#. Turn off dithering when not needed.
32#. Use double buffering as it's often faster than single buffering
33#. Compile in the X Shared Memory extension option if it's supported on
34   your system by adding -DSHM to CFLAGS and -lXext to XLIBS for your
35   system in the Make-config file.
36#. Recompile Mesa with more optimization if possible.
37#. Try to maximize the amount of drawing done between glBegin/glEnd
38   pairs.
39#. Use the MESA_BACK_BUFFER variable to find best performance in double
40   buffered mode. (X users only)
41#. Optimized polygon rasterizers are employed when: rendering into back
42   buffer which is an XImage RGB mode, not grayscale, not monochrome
43   depth buffering is GL_LESS, or disabled flat or smooth shading
44   dithered or non-dithered no other rasterization operations enabled
45   (blending, stencil, etc)
46#. Optimized line drawing is employed when: rendering into back buffer
47   which is an XImage RGB mode, not grayscale, not monochrome depth
48   buffering is GL_LESS or disabled flat shading dithered or
49   non-dithered no other rasterization operations enabled (blending,
50   stencil, etc)
51#. Textured polygons are fastest when: using a 3-component (RGB), 2-D
52   texture minification and magnification filters are GL_NEAREST texture
53   coordinate wrap modes for S and T are GL_REPEAT GL_DECAL environment
54   mode glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ) depth
55   buffering is GL_LESS or disabled
56#. Lighting is fastest when: Two-sided lighting is disabled
57   GL_LIGHT_MODEL_LOCAL_VIEWER is false GL_COLOR_MATERIAL is disabled No
58   spot lights are used (all GL_SPOT_CUTOFFs are 180.0) No local lights
59   are used (all position W's are 0.0) All material and light
60   coefficients are >= zero
61#. XFree86 users: if you want to use 24-bit color try starting your X
62   server in 32-bit per pixel mode for better performance. That is,
63   start your X server with startx -- -bpp 32 instead of startx -- -bpp
64   24
65#. Try disabling dithering with the MESA_NO_DITHER environment variable.
66   If this environment variable is defined Mesa will disable dithering
67   and the command glEnable(GL_DITHER) will be ignored.
68