#How to check the CPU features enabled in a chromium build?

1 messages · Page 1 of 1 (latest)

torn sage
#

hi I have this installed https://github.com/PF4Public/gentoo-overlay/blob/master/www-client/ungoogled-chromium/ungoogled-chromium-118.0.5993.70_p2.ebuild but i saw that someone created this https://github.com/Alex313031/thorium which claims that it has a performance optimization, but i don't want any google buttons on my chromium so i want ungoogled-chromium, but i have gentoo so when i installed that ungoogled-chromium it compiled the source code on my CPU,
so I am trying to find out, does the ungoogled-chromium i have already have the same optimization as that thorium thing?or is it likely that only the thorium fork can have that optimization?
The picture is a picture of what I want that thorium doesn't have, to explain, i still want to be able to go to google.com, but i just dont want it to have any google buttons in the UI

#

my CPU is AMD Ryzen 9 5950X and gentoo ran bare metal on it and compiled a version of that ebuild but i have a hard time finding: how to check if that optimization automatically happened for me?

night flume
# torn sage hi I have this installed https://github.com/PF4Public/gentoo-overlay/blob/master...
For warning I am new to gentoo I just figured I give a quick reply for the time being

Some of the things in thorium are patches specifically made in that repo

you can check the repo patches here: https://github.com/Alex313031/thorium/blob/main/infra/PATCHES.md

As far as your use flags go they should be your global flags + local flags from my understanding

your global flags should be in /etc/portage/make.conf
your local flags should be in /etc/portage/package.use/<package_name>

you should be able to get the package you are using use-flags by using equery u <package_name>

I believe the IUSE variable in what you sent are the optional useflags from my understanding.

maiden mango
#

yeah or the simple terms are it will use options set in make.conf

#

can you show the output of wgetpaste -I

#

and wgetpaste -c "emerge -vp chromium

torn sage
#

thanks, i see now that to get the highlighted optimization, i need to read this entire thread and memorize every identifier https://github.com/RobRich999/Chromium_Clang/issues/26, then diff the entire thorium codebase against the chromium codebase of same release, find all the patches in the diff that contain those identifiers, save them and then apply them all to ungoogled-chromium then compile the patched ungoogled-chromium, only after that i guess i will have the same optimization

torn sage
#

that is equery u ungoogled-chromium

torn sage
night flume
maiden mango
#

install wgetpaste

#

it's a great gentoo tool that you will use a lot

torn sage
#

ok

maiden mango
#

but yes change the second command to the package I said

torn sage
#
$ wgetpaste -c "emerge -vp ungoogled-chromium"
Your paste can be seen here: https://bpa.st/GJZA
$ wgetpaste -c "emerge -vp chromium"
Your paste can be seen here: https://bpa.st/CFGQ
maiden mango
#

I'll do my usual bit to keep the web free and open and ask if there is any reason you can't use firefox?

#

need wgetpaste -I too please

torn sage
#

firefox is my primary browser which i use for most tasks

#
$ wgetpaste -I
Your paste can be seen here: https://bpa.st/XRCQ
#

i use chromium as secondary browser for niche tasks that it happens to be more convenient for than firefox

#

small example:

#

--proxy-server command line argument

maiden mango
#

cool

#

I like you

#

have you got that emerge --info?

torn sage
#

wgetpaste -c "emerge --info"?

maiden mango
#

or wgetpaste -I

#

that is a capital i

torn sage
#

oh i sent it here?

maiden mango
#

sorry missed it

#

where did you get this ebuild from?

torn sage
maiden mango
#

as is it will enable what you have set just find in your system

torn sage
#

at least i am almost certain that is the same repository, though i might have a different release version of it

maiden mango
#

if you care about making it as fast as possible I can give you the steps to do it

night flume
maiden mango
#

create /etc/package.use/ungoogled-chromium

torn sage
night flume
#

I assume that anything you set the variables to in /etc/portage/package.use/<package_name> will overwrite the variables from the global make.conf. Correct? so you could input the cflag -03 in it?

maiden mango
#

depends on what cpu you have

#

add www-client/ungoogled-chromium optimize-thinlto optimize-webui pgo

#

compile time will go up by alot but it will be faster

#

you need 15GB of ram also

torn sage
maiden mango
#

yes

#

getting late over here

#

everything else is good though

night flume
maiden mango
#

how much ram do you have?

night flume
#

16gb

maiden mango
#

I would have at least a 4GB swap file to catch OoM errors

#

8 if you can spare the space

night flume
#

I was planning on setting up zram with writeback_device with a swap partition

maiden mango
#

zram can be good

#

but you still want that swap around

#

unless you have 64gb

torn sage
# maiden mango you need 15GB of ram also

i have found that when compiling "huge"-size apps including chromium, i have 2 options, use all my CPU threads for make jobs and, when my 32 GB RAM fills up wait for 12 hours for the entire compilation to swap through my 120 GB swap partition after which it completes successfully, or limit my make job count to some medium number which reduces the amount of RAM used, which ends up having a faster compilation time, and also completes successfully

night flume
#

Thanks for the info it has helped me understand gentoo alot better

torn sage
#

so i edit how many jobs i use on a case by case basis depending on what my experience predicts the approximate optimum job count for that app for my system is

maiden mango
#

I was lazy though when I had 16gb and just used swap

#

nowadays I don't have to worry

#

120gb though is crazy

#

I have an old ssd with 26gb though just because I have use for it

night flume
#

I have multiple tb of nvme drives but they are all on my computer with a dead motherboard simd

torn sage
maiden mango
#

-march=native will enable everything else

torn sage
#

so because i have -march=native -O2 in /etc/portage/make.conf and did ever since installing gentoo does that mean that gentoo has already automatically given me all the same CPU optimizations that thorium has except for LTO?

#

that is basically my original question

maiden mango
#

yep

#

as a secondary browser I think that's good as is

#

if you care about speed in firefox though use firefox-bin

torn sage
#

ok thank you this is very reassuring because all i knew is "gentoo automatically optimizes all source packages" and "thorium claims to have optimizations normal chromium does not" and i was very confused whether all the optimizations involved were exactly the same

torn sage
maiden mango
#

so it ends up being faster

#

it's one of the few times

torn sage
#

how to reproduce does nobody know?

#

if nobody knows how to reproduce it i'm not sure if i want that

maiden mango
#

more it's not easy to do

#

we can get there by playing with rustflags but it's not worth it

#

we normally get on par or slower but I've never seen it be faster

torn sage
#

here is emerge -avuDN @world --backtrack=100 --autounmask=y --autounmask-write --autounmask-backtrack=y after i tried to apply your file in /etc/portage/package.usehttps://termbin.com/y122

torn sage
#

the error about mate-tweak has happened for a long time after i manually installed that software BUT as far as i cant tell it is not actualy connected to any other errors, so when upgrade is successful, it's still there and i just ignore it

maiden mango
#

I missed you need to add thinlto to that package.use file

#

add that on the end and emerge -vauDU @world

#

did you try and convert an eapi 6 ebuild to 7?

torn sage
#

no i tried to remove a dependency on systemd out of the package and it worked,

night flume
torn sage
#

so i decided to just leave it untouched until the mate-tweak binary stops actually working,

maiden mango
#

don't we have that ebuild?

#

Nice to see a mate user though

torn sage
#

ldd $(which mate-tweak) shows
not a dynamic executable
so that might actually be uh... very long time..

#

at least thats what i hope

torn sage
#

do you know how to work around that a better way than i did?

maiden mango
#

custom overlays are hit and miss for quailty

#

try and avoid them unless you have to

torn sage
#

is it preferable to build software that isn't supported by gentoo fully manually using the upstream project's BUILDING.md,

#

or copy an ebuild from a custom overlay and try to edit it to work?

maiden mango
#

no, keep to ebuilds

torn sage
#

so is there any better option than using the unity-gentoo ebuild?

maiden mango
#

in this case it might be wise to speak to #gentoo-mate on irc

maiden mango
#

I beleive they are working to get it officially added though

torn sage
#

oh that good yeah

maiden mango
#

afaik they are one of the better overlays

#

but I don't work with them much to say how true that is

torn sage
#

i am going to upgrade my system in order to update my chromium and firefox releases at the same time i do this but I would like to ask some questions about something in gentoo that is very confusing to me and i would say is the most confusing thing for me about gentoo that other distros dont have

#

basically this is a description of that thing

maiden mango
#

wha'ts the question?

torn sage
#

it says the "world file" should only contain things i "personally want",

#

or in another place it says it should not contain "dependencies"

#

but i find it hard to understand, whether or not a package is technically a "dependency" or not

#

for the purposes of the "world file"

maiden mango
#

ok I think you are over thinking this

#

just run emerge -va --depclean once a month and your world file should stay nice and clean

#

and use --oneshot for packages you only use once

torn sage
#

yeah i've realized from the start that i'm not yet using gentoo the correct way that everyone else does, because,

maiden mango
torn sage
#

basically, i tried to use emerge -va --depclean a few times before, but every time i do that it says it's going to remove things that I think I need, and that I don't think i have more than one version of installed,

#

so i haven't been doing that, and when I use Debian, debian has something vaguely similar called apt autoremove, and frequently for me apt autoremove says it's going to remove things i want, so i dont usually do that on debian either

maiden mango
#

if you think you need it then emerge --noreplace <package name should be what you need

torn sage
#

ok, i'll try that,

night flume
torn sage
#

and, i am wondering: does the world file affect the behavior of emerge -va --depclean as well as emerge -avuDN @world?

maiden mango
#

depclean just removes old bdeps (build dependencies) which Sam is talking about

#

for your needs this sounds like all you need

torn sage
#

ok,

#

i was wondering, could you look at my world file and tell me if anything stands out to you as one of those things that could cause what that page said "Erroneous entries in your world file will lead to blockers when e.g. a library becomes obsolete or replaced, leading you to have to fix the problem when for most people, it'll be resolved automatically. "

#

because this is the first time i have looked at that list, and that's pretty much the thing that made me concerned,

maiden mango
#

looks rather clean

torn sage
#

since i am familiar with a part of Arch Linux's pacman that does a behavior like "replace package x with y? [Y/n]"

#

and that article makes it sound as though gentoo doesn't do any automatic equivalent and that the user is expected to manually resolve that if it happens to the gentoo equivalents of packages that happens to on arch linux

maiden mango
#

mine has some cruft in it

#

but it's ok

torn sage
#

ok good

#

how do you get dev-util/pmbootstrap package to work?

#

when i try to use it it always says "error: out of date"

#

so i always have to use a version of pmbootstrap downloaded from their github page

#

i just asked because i saw it in your list but if you dont use that thats ok

#

also i have started to get into a habit of using grep -rn /etc/portage/ -e '^=' and willy-nilly deleting the lines it prints from the files shown, then allowing emerge to recreate the ones it prompts me to,

#

i thought that should surely break my system, because i wanted to see what other errors doing that will cause, but i haven't gotten more errors from doing that yet, should that eventually cause a big conflict?

#

the logic behind it is "i don't want to be stuck with an old version of anything"

maiden mango
#

using the guru package

#

I added to the pmos docs

torn sage
#

I show all that happens when i try to do that here

#

and at the bottom i show using ~/.local/bin/pmbootstrap which is a copy downloaded from postmarketos github

#

also I am wondering, how do I uninstall KDE Plasma?

maiden mango
#

works for me so not sure

torn sage
#

while I was setting up MATE, i used KDE Plasma as a GUI to temporarily configure MATE before MATE started working

maiden mango
#

and emerge --deselect kde-meta or what every the package name is

#

then depclean

torn sage
#

now MATE is working for a long time so i wanted to remove KDE Plasma and only install it again if i need it again, but emerge --depclean --verbose qtwayland kwayland kwin layer-shell-qt libkscreen plasma-integration plasma-workspace libkworkspace plasma-integration kscreenlocker shows this

torn sage
torn sage
maiden mango
#

1.51

torn sage
#

I see this

$ sudo emerge --deselect kde-plasma/plasma-meta
>>> No matching atoms found in "world" favorites file...
maiden mango
#

you will be better asking a kde user

#

open a new topic

#

I only use good DEs 😄

torn sage
# maiden mango 1.51

ok i guess there might be some way to bypass the outdated error that i dont know

torn sage
# maiden mango you will be better asking a kde user

yes sorry i asked too many questions in the same thread
and thats why i want to remove the kde packages too because i think they are taking up too much space and using too much build time every time i upgrade the system

maiden mango
#

it's fine I just don't lnow the answer

torn sage
#

i used it to set up MATE because KDE plasma is the default GUI of the gentoo live image, so i knew it would work when MATE wasn't working immediately

#

I will mark this solved after i successfully build ungoogled chromium with LTO enabled (in my experience LTO often fails at build time unless the source used has been tested and patched to implement it)

maiden mango
#

lto works well

#

~wiki LTO

spare micaBOT
maiden mango
#

I wrote the documentation for it so you are speaking to one of the best people on the topic

torn sage
#

that is good thanks

maiden mango
#

I've added most of the fixes to make it work on a desktop system as well

#

lto is in a very good state

torn sage
#

what is the difference in effect on specifically ungoogled-chromium between having lto in make.conf USE flags and the optimize-thinlto optimize-webui pgo thinlto USE flags that are specific to that package?

#

would adding the lto flag to those have no effect on ungoogled-chromium and only affect packages whose ebuilds actually contain the identifier lto?

maiden mango
#

depends on how the ebuild is written

#

strip-flags used to remove -flto but it no longer does so there is a good chance it will still be added

#

now we have filter-lto for those cases

#

here is the fix I applied to musl

torn sage
#

the ebuild for ungoogled-chromium contains strip-flags and many instances of filter-flags but no instances of filter-lto

maiden mango
#

then it will stay

#

this is an example od poor ebuild quailty

torn sage
#

however for example it contains

if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
  filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
fi
#

are you sure that isn't disabling optimization that i asked how to check is enabled?

#

i am not sure what the end result of the logic there is so, that is sort of why i was wondering if there's a way to test the resulting binary itself for an optimization signature

#

the most direct thing i can think of is using a hex editor to search for machine language AVX and SSE4.2 exclusive instructions and compare the results with builds that are known to not have them like google chrome and builds that are known to have them like thorium?

#

though i do not know x86 machine language so that is hard for me but i wonder if that is feasable without having to do any actual disassembly

maiden mango
#

browsers are hard

#

if they are filter then it's for good reason

torn sage
#

but not a good enough reason for thorium to not use them

#

that is why i am interested to attempt to graft the thorium optimizations onto ungoogled-chromium

maiden mango
#

you would have to ask them

versed thicket
maiden mango
versed thicket
maiden mango
#

There was something else but I've forgotten it now

versed thicket
#

I'll take a look and PR at some point

maiden mango
#

Thanks my pr machine is down so I can't do any

versed thicket
#

Is that the only thing you have with more than 32M RAM? 😛

maiden mango
#

I've got a simple keywordreq which will close down two bugs if you don't mind

#

Hahah

versed thicket
#

Shoot me the details

maiden mango
#

I only keep gpg keys on one machine so everyone knows if it's signed by me its good

#

Until I get a nitro key