Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Safety of overriding USE=-wayland on a per-package basis
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Wed Sep 11, 2024 11:46 am    Post subject: Safety of overriding USE=-wayland on a per-package basis Reply with quote

Hi folks

I'm sorry to bring this up again, but I'm clearly not understanding what I'm reading about this subject. The background is that I want to use binary packages as much as possible in my older machines, but it's difficult because so many of the binaries are build for Wayland support:

Code:

!!! The following binary packages have been ignored due to non matching USE:

    =app-crypt/pinentry-1.3.0-r3 keyring wayland
    =gui-libs/gtk-4.14.4-r1 -cpu_flags_x86_f16c wayland
    =media-libs/vulkan-loader-1.3.290.0 wayland
    ...


I can override my `USE=-wayland` choice on a per-package basis, to encourage emerge to use the binary, and I've been told repeatedly that this is a safe thing to do, because the applications won't use Wayland if there is no support for it.

But how does that actually work? When I look at, for example, libgtk on a system that does have a working Wayland, I see that it has a run-time dependency on Wayland libraries:

Code:

$  objdump -p /usr/lib64/libgtk-4.so.1 | grep NEEDED | grep -i way
  NEEDED               libwayland-client.so.0
  NEEDED               libwayland-egl.so.1


I don't have those libraries on my non-Wayland machine, and I don't know how to get them. And if I do get them, I don't know how that will prevent Wayland trying (and failing) to be used.

What am I missing here?

BR, Lars.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 9262

PostPosted: Wed Sep 11, 2024 12:17 pm    Post subject: Re: Safety of overriding USE=-wayland on a per-package basis Reply with quote

lars_the_bear wrote:
And if I do get them, I don't know how that will prevent Wayland trying (and failing) to be used.

Wayland does not "try to get used".
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Wed Sep 11, 2024 12:25 pm    Post subject: Re: Safety of overriding USE=-wayland on a per-package basis Reply with quote

asturm wrote:

Wayland does not "try to get used".


OK. So can you explain, in numpty language that even I can understand, what's going on here?

If applications appear to require Wayland libraries, and those libraries aren't present, how will the application start?

And if the libraries are present, how do they get there (when I haven't installed anything), and what prevents applications doing 'Wayland stuff' when the libraries can be loaded?

I have no clue how applications determine whether Wayland is available.

BR, Lars.
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 3038

PostPosted: Wed Sep 11, 2024 12:47 pm    Post subject: Re: Safety of overriding USE=-wayland on a per-package basis Reply with quote

lars_the_bear wrote:

I have no clue how applications determine whether Wayland is available.

BR, Lars.

There needs to be a compositor running (such as sway, mutter, kwin, hyprland).

Just like X apps need X server running.
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 3038

PostPosted: Wed Sep 11, 2024 12:48 pm    Post subject: Re: Safety of overriding USE=-wayland on a per-package basis Reply with quote

lars_the_bear wrote:
I want to use binary packages as much as possible in my older machines

The path of least resistance then is to adjust your USE flags to what the binhost (official/unofficial) is using.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Wed Sep 11, 2024 1:09 pm    Post subject: Re: Safety of overriding USE=-wayland on a per-package basis Reply with quote

kimchi_sg wrote:
a compositor running (such as sway, mutter, kwin, hyprland).

Just like X apps need X server running.


OK. I'm aware that, on my Fedora systems, I can choose to run X or Wayland in the display manager, and I'm still using the same applications. So I appreciate that applications are somehow able to tell what to use.

But my Fedora systems have Wayland libraries, and my Gentoo (X only) systems do not. I don't know how to install the libraries, and I'm not sure what effect installing them will have, if any, on other aspects of system operation.

BR, Lars.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 9262

PostPosted: Wed Sep 11, 2024 1:10 pm    Post subject: Reply with quote

lars_the_bear wrote:
Code:

!!! The following binary packages have been ignored due to non matching USE:

    =app-crypt/pinentry-1.3.0-r3 keyring wayland
    =gui-libs/gtk-4.14.4-r1 -cpu_flags_x86_f16c wayland
    =media-libs/vulkan-loader-1.3.290.0 wayland
    ...


I can override my `USE=-wayland` choice on a per-package basis, to encourage emerge to use the binary, and I've been told repeatedly that this is a safe thing to do, because the applications won't use Wayland if there is no support for it.

You've completely misunderstood that. If an application was built with linking to a dependency, and you override those dependencies, and they are missing, your application will likely crash on startup. Why do you insist on making your life with Gentoo so complicated?

If you just leave that flag alone, it will work just as it does in Fedora ...

lars_the_bear wrote:
I don't know how to install the libraries

You don't. Portage does, if you just let it work.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Wed Sep 11, 2024 1:54 pm    Post subject: Reply with quote

asturm wrote:

You don't. Portage does, if you just let it work.


That's what I thought, when I tried to run `USE=pulseaudio emerge something` on my ALSA-only installation. I can't remember now what I was installing, but it would have taken a long time to compile (vlc, perhaps? Can't be sure now). I was told that it was safe to do this, but it wasn't. emerge not only installed the Pulse libraries and Pulse server, which I don't want, but over-wrote the ALSA configuration that I had spent hours tuning, with a Pulse-specific one.

It took me hours to recover from this situation, but at least I had a working system (apart from audio) to do it on. If I mess up the display configuration, I'll be trying to recover by booting from a memory stick.

So what I'm trying to understand is what exactly happens if I do 'USE=wayland emerge something' on my system that currently has no Wayland support. If nobody knows, or wants to take the time to explain, I guess I'll have to fall back on setting up yet another virtual machine try it out. But, since I've been bitten by this kind of thing in the past, I'm not going to try it on a computer I use every day unless I know exactly what the consequences are likely to be.

BR, Lars.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 9262

PostPosted: Wed Sep 11, 2024 2:05 pm    Post subject: Reply with quote

I think you've heard the answer already plenty of times. If that did not satisfy you yet, no number of people telling you will. So go ahead and try it out in a VM if you must.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Wed Sep 11, 2024 2:12 pm    Post subject: Reply with quote

asturm wrote:
I think you've heard the answer already plenty of times. If that did not satisfy you yet, no number of people telling you will. So go ahead and try it out in a VM if you must.


I've not heard the answer to my qustion any times. Not once. My question is: exactly what happens? And the answer I keep getting is: just do it, it will be fine. That's not an answer to my question.

But on the one occasion I tried setting USE flags on a per-package basis to get a binary that did not match my base configuration, I ended up with a broken system and hours of work. It wasn't fine, not at all.

So I hope you'll understand my reticence.

BR, Lars.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3686
Location: Rasi, Finland

PostPosted: Wed Sep 11, 2024 2:15 pm    Post subject: Reply with quote

lars_the_bear wrote:
but over-wrote the ALSA configuration that I had spent hours tuning, with a Pulse-specific one.
That shouldn't happen, unless you've changed CONFIG_PROTECT in make.conf.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 9262

PostPosted: Wed Sep 11, 2024 3:00 pm    Post subject: Reply with quote

lars_the_bear wrote:
I've not heard the answer to my qustion any times. Not once.

Even this thread alone contains your answers, and if you need more detail to them, you can use the keywords to dig out more information on e.g. what a Compositor is, or that Wayland is not its own runtime thing.

No one knows what degree of detail will satisfy you, and no one can give you a definitive guarantee since as with all things Gentoo, much depends on the execution of the user, as you've seen with pulseaudio.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Wed Sep 11, 2024 3:02 pm    Post subject: Reply with quote

Zucca wrote:
lars_the_bear wrote:
but over-wrote the ALSA configuration that I had spent hours tuning, with a Pulse-specific one.
That shouldn't happen, unless you've changed CONFIG_PROTECT in make.conf.


Shouldn't happen. Did happen :)

Did I screw something up? Almost certainly. But I don't know what.

It seems to me that it would be nice if `emerge` could give a lot more detail about what would be changed -- to the level of specific files, if possible. I appreciate that this is difficult when the installation includes running scripts and what-not. But maybe some information is already available, but I don't know how to get it?

Incidentally, I tried `USE=wayland emerge...` in a VM and it seemed fine. But it caused a load of other libraries to rebuild, and the video drivers, since (I guess) previously they had been built on the basis of my global setting of USE=-wayland. So as a way to reduce the amount of compilation, I'm not sure how effective this approach is.

Also, I guess that every X application that uses a Wayland-compatible library like GTK will get some additional Wayland stuff linked at runtime, right? I don't know how significant that is. The libraries themselves are not huge, but I don't know what (if anything) they actually do, if they aren't actually used in a Wayland session.

BR, Lars.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 9262

PostPosted: Wed Sep 11, 2024 3:24 pm    Post subject: Reply with quote

Again, they do nothing.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22616

PostPosted: Wed Sep 11, 2024 3:56 pm    Post subject: Reply with quote

lars_the_bear wrote:
It seems to me that it would be nice if `emerge` could give a lot more detail about what would be changed -- to the level of specific files, if possible.
This would be unusably noisy. Large packages install hundreds of files, and potentially change all of them on an update. How would you notice anything important in the list?

Portage already protects configuration files, unless you disable that.
lars_the_bear wrote:
Also, I guess that every X application that uses a Wayland-compatible library like GTK will get some additional Wayland stuff linked at runtime, right? I don't know how significant that is. The libraries themselves are not huge, but I don't know what (if anything) they actually do, if they aren't actually used in a Wayland session.
The same thing they do on Fedora when you tell Fedora to log in using X11 instead of Wayland. The binary distributions almost certainly ship with optional Wayland support enabled on everything, and per your earlier comments, Fedora's Wayland support has not troubled you.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3686
Location: Rasi, Finland

PostPosted: Wed Sep 11, 2024 4:30 pm    Post subject: Reply with quote

lars_the_bear wrote:
Zucca wrote:
lars_the_bear wrote:
but over-wrote the ALSA configuration that I had spent hours tuning, with a Pulse-specific one.
That shouldn't happen, unless you've changed CONFIG_PROTECT in make.conf.


Shouldn't happen. Did happen :)
Code:
emerge --info | grep ^CONFIG_PROTECT
Will show your config file protection settings.

Where did you store your alsa settings?
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1948

PostPosted: Wed Sep 11, 2024 7:20 pm    Post subject: Reply with quote

Hu wrote:

lars_the_bear wrote:

It seems to me that it would be nice if `emerge` could give a lot more detail about what would be changed -- to the level of specific files, if possible.

This would be unusably noisy. Large packages install hundreds of files, and potentially change all of them on an update. How would you notice anything important in the list?


iwdevtools does this but I suspect that OP will end up worrying over innocuous changes next..

Hu wrote:

Portage already protects configuration files, unless you disable that.
lars_the_bear wrote:

Also, I guess that every X application that uses a Wayland-compatible library like GTK will get some additional Wayland stuff linked at runtime, right? I don't know how significant that is. The libraries themselves are not huge, but I don't know what (if anything) they actually do, if they aren't actually used in a Wayland session.
The same thing they do on Fedora when you tell Fedora to log in using X11 instead of Wayland. The binary distributions almost certainly ship with optional Wayland support enabled on everything, and per your earlier comments, Fedora's Wayland support has not troubled you.


I believe I've explained exactly that already but it went unheeded.

There was one case which Eli already explained where -wayland could break things and he's fixed that with gtk. I believe he also told OP that specifically. I think we concluded that OP had hit the case Eli fixed but I don't remember for sure. In general, you can assume that when people say "$X should work", they're not saying "and I promise no bugs exist". Defaults are defaults are defaults.

Most distributions enable many of the things which are USE flags (and hence optional) in Gentoo. They rely on the ability to disable/configure functionality at runtime. Disabling these things is a bonus in Gentoo. If you're trying to optimise for e.g. using binpkgs, do as several of us have said before, and rely on the ability to e.g. disable pulseaudio at runtime instead.

In some cases, Wayland is required by applications but could technically be made optional as a runtime check is done, but nobody cares to do it, and it sometimes makes things more brittle if it's n to going to be tested. But in some other cases, it's more deeply entwined.

I still don't really get what we're doing here. I feel like the same thing is being explained over and over across many threads.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Thu Sep 12, 2024 7:38 am    Post subject: Reply with quote

Hu wrote:
The binary distributions almost certainly ship with optional Wayland support enabled on everything, and per your earlier comments, Fedora's Wayland support has not troubled you.


Yeah. But I'm running Fedora on a machine with 96 CPU cores and 128Gb RAM. I can run anything on that. I'm running Gentoo on 2015-era laptops with much more humble specifications, and I'm trying to make every byte of memory count.

This is all rather frustrating. It seems to me as if I'm asking a reasonable question, but I just get responses that suggest that I'm too damned stupid to understand. I fully admit that I'm not the sharpest knife in the drawer, but it seems to me that nobody has answered my question, except to say that if I enable Wayland support in applications 'nothing happens'.

But that's clearly not true. As a minimum, the loader has to make space for the extra libraries in the process memory space. I can see from `pmap` that certain applications have loaded libwayland-client.so, libwayland-egl.so, and others -- even on an installation that isn't using a Wayland compositor. These aren't large libraries in themselves but, presumably. they run some kind of initialization code, even if it has no effect outside a Wayland system. What the consequences of these things are, I don't know. But they can't be 'nothing'.

On my systems use Wayland, I've never had to worry about how it works -- it either works, or it doesn't. And, if it doesn't, I just switch back to using X instead. As a result, the operation of Wayland remains a mystery to me.

Come on, have a bit of charity -- try to think down to my level. I know it's difficult :)

BR, Lars.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1948

PostPosted: Thu Sep 12, 2024 2:07 pm    Post subject: Reply with quote

You may get slightly bigger binaries on disk and slightly bigger RAM usage (but not too much as not everything will be mapped, depending on how things are used). You may have more dependencies installed as a result.

Note that with regard to initialisation, C doesn't have the concept of constructors and the extensions for it aren't used heavily anyway. It's very possible that indeed nothing is setup unless Wayland is configured at runtime.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Fri Sep 13, 2024 10:13 am    Post subject: Reply with quote

sam_ wrote:
You may get slightly bigger binaries on disk and slightly bigger RAM usage (but not too much as not everything will be mapped, depending on how things are used). You may have more dependencies installed as a result.


Thank you. That was the information I was looking for. There definitely is slightly larger RAM usage for applications that are Wayland-capable (either directly, or via some library). I did a before-and-after comparison in a VM . Obviously, applications that use X directly, or use a library that is not Wayland-capable, aren't affected.

As a way of avoiding compilation, using USE=wayland on a per-package basis might not help all that much because, even though it leads to more binaries being available, a heap of other stuff ends up getting recompiled. But maybe that only happens once -- I'm not sure.

BR, Lars.
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 214

PostPosted: Fri Sep 13, 2024 1:55 pm    Post subject: Reply with quote

lars_the_bear wrote:
Hi folks

I'm sorry to bring this up again, but I'm clearly not understanding what I'm reading about this subject. The background is that I want to use binary packages as much as possible in my older machines, but it's difficult because so many of the binaries are build for Wayland support:

Code:

!!! The following binary packages have been ignored due to non matching USE:

    =app-crypt/pinentry-1.3.0-r3 keyring wayland
    =gui-libs/gtk-4.14.4-r1 -cpu_flags_x86_f16c wayland
    =media-libs/vulkan-loader-1.3.290.0 wayland
    ...


I can override my `USE=-wayland` choice on a per-package basis, to encourage emerge to use the binary, and I've been told repeatedly that this is a safe thing to do, because the applications won't use Wayland if there is no support for it.

But how does that actually work? When I look at, for example, libgtk on a system that does have a working Wayland, I see that it has a run-time dependency on Wayland libraries:

Code:

$  objdump -p /usr/lib64/libgtk-4.so.1 | grep NEEDED | grep -i way
  NEEDED               libwayland-client.so.0
  NEEDED               libwayland-egl.so.1


I don't have those libraries on my non-Wayland machine, and I don't know how to get them. And if I do get them, I don't know how that will prevent Wayland trying (and failing) to be used.

What am I missing here?

BR, Lars.


lars_the_bear wrote:

But that's clearly not true. As a minimum, the loader has to make space for the extra libraries in the process memory space. I can see from `pmap` that certain applications have loaded libwayland-client.so, libwayland-egl.so, and others -- even on an installation that isn't using a Wayland compositor. These aren't large libraries in themselves but, presumably. they run some kind of initialization code, even if it has no effect outside a Wayland system. What the consequences of these things are, I don't know. But they can't be 'nothing'.


Applications can have source code that looks like this:

Code:

if(current_running_session_is_wayland()) {
    interact_with_wayland_session();
    run_more_wayland_specific_code();
    run_yet_more_wayland_specific_code();
}


The only code that actually *runs* on an X11 system is the current_running_session_is_wayland(), which is basically just looking up the current display object, and performing a G_TYPE_CHECK_INSTANCE_TYPE to see whether the returned type is equal to the object type for GDK's wayland backend.

To do this, it needs to make space in the process memory space for /usr/lib64/libgdk-3.so which it... already does anyway, because that's also the X11 library. Okay, fine, so then you ask, why does /usr/lib64/libgdk-3.so have to link to wayland? Answer: because code that doesn't run has a symbol use of libwayland-*.so, and the ELF loader has to pull that wayland library into the process memory space since the ELF loader doesn't know whether you will perform conditional runtime branches in the form of an if statement ***that concludes the runtime answer is yes, and executes the wayland symbols***.

I have no idea why you would automatically jump to the conclusion that "presumably. they run some kind of initialization code". There is no presumably about it. Initialization code is a concept that exists in computer programming, but there is no implication that just because the concept exists, all, or even most, or even a statistically significant number of, libraries use that concept. Even in C++, which Gtk doesn't use.

It is sufficient for the purpose of this discussion that the "compiled binaries" specification encodes the notion of libraries being dependencies and loading into the process memory space due to the fact that the "compiled binaries" specification does not know whether the code will be executed at runtime, but has to load into the process memory space in order to accommodate the possibility that while Lars the Bear doesn't use wayland, Barry the Lion does.

Such is the way of binpackages and USE flags. Disabling wayland via USE flags means you reduce the load on the process memory space, and that is all.

Aside: https://gitweb.gentoo.org/proj/binhost.git/commit/?id=d06884c8ce125cf6ee217afbb38cdb5b3fe1d101

We are finally field testing variants support. The MVP includes a no-pulseaudio variant build. If all goes well, tomorrow will include a no-wayland variant build. A no-wayland variant was always one of the things relatively close to the top of my mind. :)
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Fri Sep 13, 2024 2:36 pm    Post subject: Reply with quote

eschwartz wrote:

We are finally field testing variants support. The MVP includes a no-pulseaudio variant build. If all goes well, tomorrow will include a no-wayland variant build. A no-wayland variant was always one of the things relatively close to the top of my mind. :)


Thank you; this is excellent news. Even if the implications of adding Wayland or Pulse support to applications are minimal, it's got to be cleaner to avoid doing so. Especially if you're trying to run KiCAD on a system with 8Gb RAM.

BR, Lars.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20484

PostPosted: Fri Sep 13, 2024 2:55 pm    Post subject: Reply with quote

lars_the_bear wrote:
it seems to me that nobody has answered my question, except to say that if I enable Wayland support in applications 'nothing happens'.

But that's clearly not true. As a minimum, the loader has to make space for the extra libraries in the process memory space. I can see from `pmap` that certain applications have loaded libwayland-client.so, libwayland-egl.so, and others -- even on an installation that isn't using a Wayland compositor. These aren't large libraries in themselves but, presumably. they run some kind of initialization code, even if it has no effect outside a Wayland system. What the consequences of these things are, I don't know. But they can't be 'nothing'.
It's still not clear (to me) what sort of answer will satisfy the question.

Two things that may alleviate or exacerbate your concern. The software you're likely to use almost certainly includes a disclaimer about the lack of guarantees of working, and that the authors accept no liability if it does fail. Related to that is also the halting problem.

lars_the_bear wrote:
Come on, have a bit of charity -- try to think down to my level. I know it's difficult :)
It seems to me that the questions you ask which are similar to this one are very open ended and difficult to answer.

This may not be a correct way to view it, but... If there's code in a program that is never executed, will it be casually apparent that it effectively does nothing?

It seems to me that you might experience far less frustration by having two systems... your daily driver, and one that mimics it that you use for experiments, update testing, etc.

Actual problems are either solvable or ale to be mitigated. Theoretical problems are academic.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 214

PostPosted: Fri Sep 13, 2024 3:58 pm    Post subject: Reply with quote

lars_the_bear wrote:
eschwartz wrote:

We are finally field testing variants support. The MVP includes a no-pulseaudio variant build. If all goes well, tomorrow will include a no-wayland variant build. A no-wayland variant was always one of the things relatively close to the top of my mind. :)


Thank you; this is excellent news. Even if the implications of adding Wayland or Pulse support to applications are minimal, it's got to be cleaner to avoid doing so. Especially if you're trying to run KiCAD on a system with 8Gb RAM.

BR, Lars.


Well, that and the fact that it isn't in many people's global USE which means a lot of missed opportunities for cache hits. :)
Back to top
View user's profile Send private message
wanne32
n00b
n00b


Joined: 11 Nov 2023
Posts: 69

PostPosted: Fri Sep 13, 2024 11:21 pm    Post subject: Reply with quote

lars_the_bear wrote:
I'm running Gentoo on 2015-era laptops with much more humble specifications, and I'm trying to make every byte of memory count.
And then you are using X11 which uses magnitudes more Memory than wayland?
Just try it out: Compile mpv+sway or kodi without X11 and mpv+i3 or kodi wihtout wayland suppot. And look how your memory usage increases before and after you start them to show a low res picture on a low res screen on a newly booted system. You will see, that the increase is a two digit times higher on the X11 variant since the protocol is much more complex. even so sway is much more capable than i3. On >>4k the difference fades away and both will use similar amounts of memory. But I assume this is not your 2015 Laptop.
Quote:
I can see from `pmap` that certain applications have loaded libwayland-client.so, libwayland-egl.so, and others -- even on an installation that isn't using a Wayland compositor.
This is virtual memory. It will stay on disk if you are low on memory. This is btw. the reason, why systems with swap can be much faster than those without: If you are low on memory and have no swap linux will put even used libs to disk which will make them horribly slow, while things like your loginscreen background image on swap won't make a difference. Of course in the other direction having for a long time unused libs in Memory while swapping the text in your console will be horrible. This is why you want to balance your sappiness.
Quote:
These aren't large libraries in themselves but, presumably. they run some kind of initialization code, even if it has no effect outside a Wayland system. What the consequences of these things are, I don't know. But they can't be 'nothing'.
I would bet, that they are doing nothing at the moment. – Just set a few breakpoints with gdb.But I am very sure that this won't stay this way. qt and gtk where using already wayland like pixel based composition techniques. This was the idea behind wayland in the first place. While the current code was clearly developed x11 first, in the future there will be the question why just not use the functions that libs for wayland provide even when running on x11. Similar to how many applications now use systemd or pulseaudio libs. But then you won't be able to just disable them on compile time you would need to replace them by something with similar functionality like elogind or pipewire which provide the same functionality like logind and pulseaudio.
lars_the_bear wrote:
I've never had to worry about how it works -- it either works, or it doesn't. And, if it doesn't, I just switch back to using X instead. As a result, the operation of Wayland remains a mystery to me.
But if you insist on your stupidity you will make stupid statements like that. If you do not understand that "war" is not a set of humans you will never understand why you could not just kill them and solve all the problems accompanied with it. Similar if you do not understand that there is no program like x.org that actually does things you will never understand why "the operation of Wayland" is a very stupid sentence.

X11-Servers are programs that turn abstract descriptions like triangles or lines into instructions for your specific GPU-Driver how to print the these. So a program that is written for X11 can displayed everywhere where a X11-Server is running and only the X11 has to be changed to be compatible with new drivers. This is utterly inefficient in a world where everybody works with stupid pixel-images. Modern day software does not do that. QT or gtk just asks the X11 server how to send images to the driver directly and and will go this short route and only fall back to the old ways if this does not work since they are not created to generate abstract descriptions they will be horribly inefficient in doing that. This direct method is called DRM. This eliminates the advantage of X11: kwin had for long times more or less completely different codes for nvidia and intel cards.

Wayland is no special program or conversion method. It is a very fancy word for a extreme simple image format and how to send it to other programs via a file descriptor. Since all graphic drivers should be able to understand that, there is no need for any program that "does" a conversion or similar things. In worst case all that happens is that your program tries to open a file. (And a IMHO much to complicated way how to find out where that file might be located. They could have just used environment variables for that...) And if it works the creation of an image. Since you need to do that for DRM anyway you could just create it in a wayland compatible format in the first place and then "convert" it into all the formats you have to use for DRM in X11. This is the part when you think about just using wayland libs in the first place. – In reality there is no conversion needed since it is anyway more or less the same image format – A array of RGB-, RGBA- or RGBX-pixels. Only the way to transmit it, differs slightly.

I should be mentioning that you are sending these images to the compositor not to the GPU as it is done with DRM. But while this sounds like a big difference it isn't so much. Modern day computers (with modern day I mean i286) you have a MMU so you have to tell the hardware anyway where you want to have your stuff in memory and most GPUs will anyway pull the data from wherever you tell it to do so. So while there is a little bit of magic to do that everything fits together. There is no actual work to do if you do it intelligent: If the MMU puts the images on the place where the GPU is reading it from you as compositor can just sit by and letting both parties think that they are talking to you.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum