Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Avoiding LLVM on X or alternatives
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
user29039805
n00b
n00b


Joined: 21 Jan 2019
Posts: 5

PostPosted: Mon Jan 21, 2019 12:50 am    Post subject: Avoiding LLVM on X or alternatives Reply with quote

LLVM takes so long to compile that it discourages me to update. But, LLVM is required for xorg-server... What are my alternatives? Is there any way to avoid LLVM yet still have a window server? I wish to run dwm only, not XFCE or any full DE.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 2414
Location: Frankfurt, Germany

PostPosted: Mon Jan 21, 2019 12:58 am    Post subject: Reply with quote

Hello user29039805,

welcome to the Gentoo forums!

It's probably not the Xorg server, but Mesa that pulls in LLVM.

Which CPU and graphics chip do you have? Intel? Nvidia? AMD? Which graphics driver do you use?

Depending on your graphics chip, it might be possible to install Mesa without LLVM or to completely uninstall Mesa and LLVM.

Mike
Back to top
View user's profile Send private message
user29039805
n00b
n00b


Joined: 21 Jan 2019
Posts: 5

PostPosted: Mon Jan 21, 2019 3:27 am    Post subject: Reply with quote

mike155 wrote:
Hello user29039805,
Which CPU and graphics chip do you have? Intel? Nvidia? AMD? Which graphics driver do you use?

CPU is Core 2 Duo P8400. Graphics is:
Code:
VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated
Graphics Controller (rev 07)

I have set make.conf to use
Code:
VIDEO_CARDS="intel"

_________________
ACCEPT_LICENSE="-* @FREE"
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1783

PostPosted: Mon Jan 21, 2019 7:00 am    Post subject: Reply with quote

I know it is fully possible to compile mesa without llvm (the llvm use flag is defaulted to be enabled). From what the mesa ebuild looks like, only the radeon/amd video drivers directly need llvm, otherwise, you should be able to turn it off without much trouble.

Code:
ct85711@Oate ~ $ emerge -pv mesa llvm

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] sys-devel/llvm-common-7.0.1::gentoo  27,648 KiB
[ebuild   R    ] media-libs/mesa-18.3.1::gentoo  USE="classic dri3 egl gallium gbm lm_sensors osmesa -d3d9 -debug -gles1 -gles2 -llvm -opencl -pax_kernel -pic (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan -wayland -xa -xvmc" ABI_X86="(64) -32 (-x32)" VIDEO_CARDS="nouveau (-freedreno) -i915 -i965 (-imx) -intel -r100 -r200 -r300 -r600 -radeon -radeonsi (-vc4) -virgl (-vivante) -vmware" 0 KiB
[ebuild  N     ] sys-devel/llvm-7.0.1:7::gentoo  USE="libffi ncurses xml -debug -doc -exegesis -gold -libedit -test -xar" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="AMDGPU BPF NVPTX (X86) -AArch64 -ARM -Hexagon -Lanai -MSP430 -Mips -PowerPC -Sparc -SystemZ -XCore" 119 KiB
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 7959
Location: Austria

PostPosted: Mon Jan 21, 2019 7:25 am    Post subject: Reply with quote

Code:
equery d llvm

_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 2414
Location: Frankfurt, Germany

PostPosted: Mon Jan 21, 2019 11:38 am    Post subject: Reply with quote

Add the line below to /etc/portage/package.use:
Code:
media-libs/mesa -llvm

After that, run
Code:
emerge --update --deep --newuse -av @world
emerge --depclean
Back to top
View user's profile Send private message
user29039805
n00b
n00b


Joined: 21 Jan 2019
Posts: 5

PostPosted: Wed Jan 23, 2019 6:06 am    Post subject: Reply with quote

mike155 wrote:
Add the line below to /etc/portage/package.use:
Code:
media-libs/mesa -llvm

After that, run
Code:
emerge --update --deep --newuse -av @world
emerge --depclean


Thanks, I can confirm that worked.

I might clarify, that there were no other dependencies as this was a new install, but I was avoiding LLVM from the start based on another Gentoo box, where it is slow updating.

LLVM is not something to install lightly! Now to remove it from the other machine...
_________________
ACCEPT_LICENSE="-* @FREE"
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6380

PostPosted: Thu Jan 24, 2019 9:19 pm    Post subject: Reply with quote

user29039805 wrote:
Now to remove it from the other machine...

Before you do that, test whether the Xorg applications you use are still fast enough for you. For example, googleearth or tuxracer will likely become unusable slow.
Back to top
View user's profile Send private message
rogerx
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2004
Posts: 118

PostPosted: Wed Mar 04, 2020 7:48 am    Post subject: Reply with quote

[quote="mv"][quote="user29039805"]Now to remove it from the other machine...[/quote]
Before you do that, test whether the Xorg applications you use are still fast enough for you. For example, googleearth or tuxracer will likely become unusable slow.[/quote]

I just ran into this bug as well, using an older pentium3 platform, llvm taking days to compile and not really worth it's weight installing on such an older platform not making much use of mesa or opengl.

If I'm not mistaken, google earth and tuxracer are mesa/opengl related programs.

Can't believe I skipped over the USE -llvm option however am now enlightened. Also found LLVM_TARGETS="x86" to be helpful for preventing building other not needed targets such as amdgpu. More specifically desired, LLVM_TARGETS="bpf nvptx x86" for another faster ivybridge platform, and not known if bpf target is needed on slower platforms, although bpf is stated as being pretty light.
_________________
Roger
http://rogerx.freeshell.org/
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46287
Location: 56N 3W

PostPosted: Wed Mar 04, 2020 11:00 am    Post subject: Reply with quote

rogerx,

As a bonus, rust also takes LLVM_TARGETS= when it builds its own internal LLVM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2676
Location: here, there or in transit

PostPosted: Wed Mar 11, 2020 3:22 pm    Post subject: Reply with quote

rogerx wrote:
I just ran into this bug as well, using an older pentium3 platform, llvm taking days to compile and not really worth it's weight installing on such an older platform not making much use of mesa or opengl.
I discovered this while updating (rebuilding, really...) my old 2.4GHz Pentium 4 server. It was building package 5 of 43 when I logged out for the night, expecting to move on to the kernel build this morning. When I found it had only reached 11/43 overnight I said, "hm." Finding it still churning on package #11 (LLVM, of course) two hours later changed "hm" to "wtf?". It didn't take long to discover this thread, kill the merge, and restart with LLVM out of the mix. "Days" is my timeline for the whole rebuild project, not just one stinkin' package!

Presently blazing along (as only 18-year-old hardware can "blaze") on #12/32...only 20 to go until kernel time. 8)

(I haven't stopped 'round in years...nice to see that the forums are as useful as ever. :D )
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
xahodo
n00b
n00b


Joined: 17 May 2007
Posts: 49
Location: Gouda, the Netherlands

PostPosted: Wed Mar 11, 2020 8:58 pm    Post subject: Reply with quote

I just found this thread, and now I'm wondering whether it would be a good idea for me to remove llvm. It's not entirely clear whether this will have any negative effect for me if I remove llvm, as I am using kde with some desktop effects and firefox hardware acceleration on intel hardware. Not anything else that would appreciate hardware acceleration.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46287
Location: 56N 3W

PostPosted: Wed Mar 11, 2020 9:30 pm    Post subject: Reply with quote

xahodo,

Its almost free to test. quickpkg llvm and the things you have installed that depend on it.

Turn off nte llvm use flag, then rebuild @world with the -ND flags.
Only things that are changed by the USE=-llvm option should be rebuilt and you quickpkg'ed them earlier.

Once that @word update finishes. Test.

If you don't like the effects revert the USE change.
Fix the damage with emerge @world -NDK. That won't build anything, it will reinstall the binary packages you made at the start.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rogerx
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2004
Posts: 118

PostPosted: Thu Mar 12, 2020 1:13 am    Post subject: Reply with quote

[quote="xahodo"]I just found this thread, and now I'm wondering whether it would be a good idea for me to remove llvm. It's not entirely clear whether this will have any negative effect for me if I remove llvm, as I am using kde with some desktop effects and firefox hardware acceleration on intel hardware. Not anything else that would appreciate hardware acceleration.[/quote]

Without examining the licenses in depth, I think the new & upcoming LLVM is just providing another compiler for compiling graphics acceleration related packages under a different license separate of GPL. This could possibly be to avoid disclosing specifications, etc who knows? No reason to get paranoid though. I'm avoiding LLVM due to maintaining slower CPU platforms and the excessive compile times LLVM inhibits.

I'm guessing, if you play graphics accelerated games most of the time, develop OpenGL graphics, or have no problems with the increased compile times with including LLVM (on your 8+ core CPU platform), likely stick with LLVM.

I have little problems with including LLVM on my i7-3770K (4 core + 4 hyperthread) CPU with ~32GB RAM, but on my Pentium3 platforms using <1G or a couple hundred MB of RAM, I say forget or limit LLVM.

Also, if you need faster/quicker compiled binaries, take a look at the USE flag lto for the GCC compiler. LTO provides a significant performance boost, I'm using for certain frequently used applications here.
_________________
Roger
http://rogerx.freeshell.org/
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2835
Location: Canada

PostPosted: Thu Mar 12, 2020 4:08 am    Post subject: Reply with quote

so is llvm actually used when VIDEO_CARDS='intel' or 'i965' ? I see that mesa have only 'classic' architecture for those choices (it does gallium as a choice for i915), while llvm is said to be used for gallium3D ?
Back to top
View user's profile Send private message
rogerx
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2004
Posts: 118

PostPosted: Fri Mar 13, 2020 12:05 am    Post subject: Reply with quote

[quote="dmpogo"]so is llvm actually used when VIDEO_CARDS='intel' or 'i965' ? I see that mesa have only 'classic' architecture for those choices (it does gallium as a choice for i915), while llvm is said to be used for gallium3D ?[/quote]

Since I do not maintain or file bugs against LLVM, I'm not knowledgeable as to whether or not a package is built using or with LLVM headers/libraries. Even so, seems a be a bit of a gray area.

I think you can do an "emerge" command incanatation checking for dependencies, and/or while flipping around a couple of USE flags should answer your question.

Last I checked, some packages seemed all too happy to pull in LLVM, such as mesa OpenGL package. Since intel OpenGL depends on mesa, I would imagine yes they do. But if you're not using OpenGL as in my case with older or slower hardware, then you'll likely see no change forgoing LLVM except having quicker build times avoiding LLVM.

Don't ask me as to why mesa is requiring LLVM instead of gcc. A little more research:

Frame rates comparison between GCC/LLVM compilers, somewhat old.
https://www.phoronix.com/scan.php?page=article&item=llvm_dragonegg_mesa&num=1

What is LLVM and why do we need version 3.9 for OpenGL 4.5 MESA?
https://www.reddit.com/r/linux/comments/4uo6gs/what_is_llvm_and_why_do_we_need_version_39_for/

Skip down to comments made by:
cac257 6 points · 3 years ago
adler187 8 points · 3 years ago

Intel supposedly doesn't use LLVM, AMD driver yes, nouveau possibly also.

Digging a little further:
nouveau (software) Wikipedia
https://en.wikipedia.org/wiki/Nouveau_(software)
"In Mesa GalliumCompute is also the main project for Nvidia, but only AMD part is near beta for OpenCL 1.0, 1.1, and 1.2.[16]"
Reference #16 references LLVM libraries/headers.

So I'm going to guess, LLVM is only needed for likely the open sourced and/or compilable AMD graphics card drivers. Possibly Intel but doubtful, and no for NVidia Nouveau?
_________________
Roger
http://rogerx.freeshell.org/
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6714

PostPosted: Sat Mar 14, 2020 7:10 pm    Post subject: Reply with quote

AMD has a backend called "aco" that doesn't need LLVM at all (and may be faster in general), but Gentoo's not bleeding-edge enough to enable it yet.
Back to top
View user's profile Send private message
ff11
Guru
Guru


Joined: 10 Mar 2014
Posts: 592

PostPosted: Sat Mar 14, 2020 9:13 pm    Post subject: Reply with quote

Ant P. wrote:
AMD has a backend called "aco" that doesn't need LLVM at all (and may be faster in general), but Gentoo's not bleeding-edge enough to enable it yet.

I tested it now using media-libs/mesa-20.0.1-r1 and it worked very well on vkcube:
Code:
$ RADV_PERFTEST=aco VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json vkcube

_________________
| Proverbs 26:12 |
| There is more hope for a fool than for a wise man that are wise in his own eyes. |
* AlphaGo - The Movie - Full Documentary
"I want to apologize for being so powerless" - Lee
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1124
Location: sweden

PostPosted: Sun Apr 12, 2020 9:51 pm    Post subject: Reply with quote

Ant P. wrote:
AMD has a backend called "aco" that doesn't need LLVM at all (and may be faster in general)


Ant P

as far as i understad it. we cannot get rid of llvm yet:

Quote:

Sep 27, 2019
This commit is a step towards the goal of being able to build RADV
without LLVM. In the future we would like to offer the option to
use RADV solely with ACO. There is still a need for the common AMD
code located in amd/common but the LLVM specific parts need to be
separated.


Ant P. wrote:
but Gentoo's not bleeding-edge enough to enable it yet.

i made a custom mesa-9999 with patches "enable/disable by useflag aco". Gentoo= freedom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
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