[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reducing Mesa closure size

From: Pierre Neidhardt
Subject: Reducing Mesa closure size
Date: Fri, 12 Jun 2020 11:16:50 +0200

Mesa is a dependency for more or less everything graphical.
Since it's so ubiquitous, can we reduce it's closure size?

--8<---------------cut here---------------start------------->8---
> guix size mesa
store item                                                       total    self
/gnu/store/skxkrhgn9z0fg9hmnbcyfdgzs5w4ryrr-llvm-9.0.1             199.9   
128.5  37.6%
/gnu/store/8jn365r0kk69j1f4b1q2b7aa2qm1xvg1-mesa-19.3.4            341.6   
114.6  33.6%
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31              38.4    
36.7  10.8%
/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib           71.0    
32.6   9.6%
/gnu/store/c8w9z48vvx2a3q3k44ch9yn00wk1qwhb-libxml2-2.9.10          81.1     
7.9   2.3%
/gnu/store/a8gdwnmpryd39jixzy4xs9p4i7gy17qv-libxcb-1.14             76.2     
4.5   1.3%
--8<---------------cut here---------------end--------------->8---

Reducing LLVM would help here.  See the other "Reducing LLVM closure
size" thread.

But Mesa itself can be substantially reduced.  Let's look at the files:

--8<---------------cut here---------------start------------->8---
$ du -h $(find /gnu/store/8jn365r0kk69j1f4b1q2b7aa2qm1xvg1-mesa-19 -type f 
-size +1M) | sort -n
7.5M    ./lib/
7.6M    ./lib/
8.4M    ./lib/
8.7M    ./lib/
12M     ./lib/dri/
12M     ./lib/vdpau/
14M     ./lib/
17M     ./lib/dri/
26M     ./lib/dri/
--8<---------------cut here---------------end--------------->8---

Most systems need only one graphics driver.  Allowing the user to choose
which mesa-driver they want could help them save quite a lot.  For
with a radeon (not radeonsi) I can remove

8.4M    ./lib/
8.7M    ./lib/
12M     ./lib/dri/
26M     ./lib/dri/

which total 55.1 MiB.  Not bad, what do you think?
( is used by all drivers.)

The "dri" folder is used at least by our Xorg wrapper.
See xorg-wrapper in gnu/services/xorg.scm:

--8<---------------cut here---------------start------------->8---
(define* (xorg-wrapper #:optional (config (xorg-configuration)))
  "Return a derivation that builds a script to start the X server with the
given @var{config}.  The resulting script should be used in place of
  define exp
    ;; Write a small wrapper around the X server.
        (setenv "XORG_DRI_DRIVER_PATH" (string-append #$mesa "/lib/dri"))
--8<---------------cut here---------------end--------------->8---

So what the following strategy:

- Extract the various mesa drivers to separate package,
  e.g. mesa-radeon, mesa-radeonsi, mesa-nouveau, etc.

- Modify xorg-wrapper to accept an extra `drivers'

- Extend xorg-configuration to accept a list of mesa drivers.

Pierre Neidhardt

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]