unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Reducing Mesa closure size
@ 2020-06-12  9:16 Pierre Neidhardt
  2020-06-23  8:41 ` Pierre Neidhardt
  2020-06-23 20:44 ` Marius Bakke
  0 siblings, 2 replies; 3+ messages in thread
From: Pierre Neidhardt @ 2020-06-12  9:16 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2979 bytes --]

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/libvulkan_radeon.so
7.6M	./lib/libxatracker.so.2.5.0
8.4M	./lib/libXvMCnouveau.so
8.7M	./lib/libvulkan_intel.so
12M	./lib/dri/nouveau_drv_video.so
12M	./lib/vdpau/libvdpau_nouveau.so.1.0.0
14M	./lib/libOSMesa.so.8.0.0
17M	./lib/dri/i915_dri.so
26M	./lib/dri/iris_dri.so
--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
instance,
with a radeon (not radeonsi) I can remove

8.4M	./lib/libXvMCnouveau.so
8.7M	./lib/libvulkan_intel.so
12M	./lib/dri/nouveau_drv_video.so
26M	./lib/dri/iris_dri.so

which total 55.1 MiB.  Not bad, what do you think?
(libvdpau_nouveau.so.1.0.0 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
@code{/usr/bin/X}."
  define exp
    ;; Write a small wrapper around the X server.
    #~begin
        (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'
  parameter.

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

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reducing Mesa closure size
  2020-06-12  9:16 Reducing Mesa closure size Pierre Neidhardt
@ 2020-06-23  8:41 ` Pierre Neidhardt
  2020-06-23 20:44 ` Marius Bakke
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre Neidhardt @ 2020-06-23  8:41 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

Thoughts about this?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reducing Mesa closure size
  2020-06-12  9:16 Reducing Mesa closure size Pierre Neidhardt
  2020-06-23  8:41 ` Pierre Neidhardt
@ 2020-06-23 20:44 ` Marius Bakke
  1 sibling, 0 replies; 3+ messages in thread
From: Marius Bakke @ 2020-06-23 20:44 UTC (permalink / raw)
  To: Pierre Neidhardt, guix-devel

[-- Attachment #1: Type: text/plain, Size: 760 bytes --]

Pierre Neidhardt <mail@ambrevar.xyz> writes:

> So what the following strategy:
>
> - Extract the various mesa drivers to separate package,
>   e.g. mesa-radeon, mesa-radeonsi, mesa-nouveau, etc.

I think outputs are better suited for this.

> - Modify xorg-wrapper to accept an extra `drivers'
>   parameter.
>
> - Extend xorg-configuration to accept a list of mesa drivers.

How will this work with Wayland?

On a related note, some distributions have migrated to "libglvnd", the
"vendor neutral OpenGL dispatch library".  AIUI it installs a shim
libE?GL.so that automatically loads the appropriate driver.  Perhaps it
can be useful to achieve this goal, and it might also make hardware
acceleration work on foreign graphics drivers, which would be awesome.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-23 20:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12  9:16 Reducing Mesa closure size Pierre Neidhardt
2020-06-23  8:41 ` Pierre Neidhardt
2020-06-23 20:44 ` Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).