View previous topic :: View next topic |
Author |
Message |
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Fri May 24, 2002 2:03 pm Post subject: Optimize KDE 3.0.1 for Gentoo |
|
|
From the gentoo mailing list:
Quote: |
1) set up Gentoo 1.1a w/stage3 per install docs
2) installed kernel-2.4.19-r4, preempt, lowlatency
3) *important: merged binutils-2.12+ in order to take advantage of combreloc (but built kernel with 2.11 beforehand just to be safe)
4) *USE flags="-march=i686 -O3 -pipe -fomit-frame-pointer" Many people use a lot of crazy optimizations, but the only one to me that makes a noticable difference in "feel" is -fomit-frame-pointer, and I don't need to debug my system so its all good.
4) *rebuilt glibc with new binutils installed
5) finish install per docs. (I use metalog, and lilo instead of grub)
6) reboot
7) use hdparm to make sure DMA is enabled
8) you now have a Gentoo system ready to build apps with the combreloc tweak (you can test this by running apps with 'LD_DEBUG=statistics' and checking the relocations)
9) build X, kdebase, kdenetwork, mozilla, vim, etc... (doesn't matter)
10) *add fam to start on boot (allows KDE to track files quicker)
11) *add your hostname to /etc/hosts (if it's not already there)
|
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
TheWart Guru
Joined: 10 May 2002 Posts: 432 Location: Nashville,TN - USA
|
Posted: Fri May 24, 2002 7:54 pm Post subject: |
|
|
Thanks, ill print that out for my desktop system, my 'server' (p200) wont be helped by that by too much _________________ Face it, we are all noobs.
On the box it said it was designed for Win XP or better, so why won't it work with Linux? |
|
Back to top |
|
|
Beast_Master Guest
|
Posted: Sat May 25, 2002 6:13 am Post subject: Could you be a bit more newbie friendly w/ that one ? :D |
|
|
Hi! .
I just finished installing Gentoo..
Finally got KDE working, and finally got the nVidia drivers and the sound working.... all was well.... although KDE seems to run a big jerky ...
so I set out to look for optimizations .... and I found your suggestion...
K.. this is what I understand so far:
2) installed kernel-2.4.19-r4, preempt, lowlatency
- I'm guessing you want me to get kernel-2.4.19 and install that
- how do I install/compile it w/ the "lowletency" setting?
3) *important: merged binutils-2.12+ in order to take advantage of combreloc (but built kernel with 2.11 beforehand just to be safe)
- I'm guessing that you'd like me to use the imerge command here to install binutils of a version greater than 2.12...
4) *USE flags="-march=i686 -O3 -pipe -fomit-frame-pointer" Many people use a lot of crazy optimizations, but the only one to me that makes a noticable difference in "feel" is -fomit-frame-pointer, and I don't need to debug my system so its all good.
- Ok, where do I use these flags? I don't understand this step at all.. my guess is that we use this in addition to other another command.. what do I type in exactly?
4) *rebuilt glibc with new binutils installed
- so you want me to re-install glibc (or rebuild it? ..?) after I install the newer version of glibc?
5) finish install per docs. (I use metalog, and lilo instead of grub)
- yep .. I understand this step
6) reboot
- and this one too
7) use hdparm to make sure DMA is enabled
- umm.. so I just type in
# hdparm -Q hda
??
you now have a Gentoo system ready to build apps with the combreloc tweak (you can test this by running apps with 'LD_DEBUG=statistics' and checking the relocations)
9) build X, kdebase, kdenetwork, mozilla, vim, etc... (doesn't matter)
- so lemme guess... just use emerge to build these?
or am I supposed to download the binaries and compile it all on my machine? What exactly should I do here?
10) *add fam to start on boot (allows KDE to track files quicker)
so I just add a "fam" to my /etc/modules.autoload file?
11) *add your hostname to /etc/hosts (if it's not already there)
- k, this one I'm having trouble w/... I'm on a dhcp cable internet connection... I don't think I get a hostname... so its just at localhost... everytime I reboot.. Gentoo warns me and tells me to change my host... does it really matter?
- Thanks for all your help and any more you can provide . I'm guessing I'll be re-doing almost all of the installation to get a nice and optimized one? Or do you know of ways I can do these tweaks w/out having to re-install? Also, I have a GeForce 2 GTS... any good optimization manuals out there for this? Thanks again!
- Cheers!
- Beast_Master |
|
Back to top |
|
|
alec Apprentice
Joined: 19 Apr 2002 Posts: 270 Location: Here
|
Posted: Sat May 25, 2002 4:04 pm Post subject: |
|
|
For #2, you'll want to make sure you have gentoo-sources emerged - it's the linux kernel with a bunch of patches like preempt, lowlatency, grsecurity, and some other stuff:
Code: | melvin src # emerge search gentoo-sources
[ Results for search key : gentoo-sources ]
[ Applications found : 1 ]
* sys-kernel/gentoo-sources
Latest version Available: 2.4.19-r5
Latest version Installed: 2.4.19-r5
Homepage: http://www.kernel.org/ http://www.gentoo.org/
Description:
Full sources for the Gentoo Linux kernel |
Then you'll want to recompile your kernel, because I'm assuming you didn't compile it with preempt and lowlatency. There are several ways to do this, but I just have a shell script that takes care of everything for me: you'll need to re-emerge alsa and nvidia stuff because they install kernel modules that you'll lose if you do a 'make modules'. You can copy and paste this into some file (I put it in /usr/src/make), run a 'chmod 777 /usr/src/make', and then run './make/.
edit: xelnix cut some fat off of it to make it quicker - thanks!
Code: | cd /usr/src/linux &&
cp .config /root/.config &&
make mrproper &&
cp /root/.config .config &&
make menuconfig &&
make dep &&
make clean &&
make bzImage &&
make modules &&
make modules_install &&
cp /boot/bzImage /boot/bzImage.old &&
cp /usr/src/linux/arch/i386/boot/bzImage /boot &&
emerge nvidia-kernel &&
emerge nvidia-glx &&
emerge alsa-driver && |
To make a long story short, it copies your kernel configuration file, makes the linux tree pristine (which overwrites your config), re-copies the config back, starts up the menu-driven configuration tool (you can substitute that with xconfig for an X-Windows based tool), makes all the modules and whatnot, backs up your old kernel, and copies the new kernel into the the old one's place. You'll need to make another entry into your grub/lilo configuration to use this old kernel. The script then emerges nvidia and alsa drivers.
You'll find preempt and low-latency under the 'processor type and features' section. Some other nifty things you might want in your kernel: General Setup -> Kernel .config support, Library routines -> both zlib options, and perhaps grsecurity if you have multiple users accessing your box over the net.
------
For the binutils-2.12: honestly, I have no idea. There are ebuilds for binutils in /usr/portage/sys-devel/binutils/ that are greater than 2.11, but emerge doesn't seem to want to emerge them for me. I checked in my /usr/portage/profiles/package.mask but didn't find them there. No ideas here.
edit (5/26): As mentioned below, the way to build these is to use the following:
Code: | ebuild /usr/portage/sys-devel/binutils/binutils-2.12.90.0.7.ebuild merge |
Thanks, cjv!
------
He didn't name it correctly: those are not USE flags, but compile-time options. You can set them by editing your CFLAGS and CXXFLAGS. For example, I'm on an Athlon, but am still using GCC 2.95.3 which does not have Athlon flags. I can still use the Pentium Pro/II/III/IV flags to get optimization, however. Here are my lines in my /etc/make.conf:
Code: | CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer" |
-----
Yes, you'll just do an 'emerge glibc'. This will recompile glibc with binutils-2.12+. Of course, that assumes you have binutils-2.12+.
-----
Again, I'd like to request some clarification on hdparm. I've never used it before, and have no clue.
-----
In Gentoo, whenever someone says build, just translate that as emerge. You'd just do 'emerge xfree', 'emerge kdebase', or you can put them all in one line, like 'emerge xfree kdebase'. It's always a good idea to use the --pretend (or -p) flag with emerge to make sure you know what you are installing: 'emerge -p kdebase', for example.
-----
To add fam to start on boot, you'd do:
Code: | rc-update add fam boot |
/etc/modules.autoload is for kernel modules, not for init scripts.
------
My /etc/hosts:
Code: | 127.0.0.1 localhost
192.168.1.6 melvin.lorax.wox.org melvin
192.168.1.5 lorax.wox.org lorax
192.168.1.6 localhost |
The computer is 192.168.1.6, or melvin. I don't know if all those are neccessary, but I put them in there because it can't hurt (or I don't know it can!). There are many free hostname services: I use dhs.org. I don't know if this is neccessary or not, but it's useful to me because I run a web/mail/ftp-server.
-------
For your GeForce 2, definitly read through http://www.gentoo.org/doc/en/nvidia_tsg.xml Jedi Knight II through winex crawled along and reminded me of trying to play Diablo on a low-end 486 (which I attempted, once, regretfully). Now it is fast to the point where I can't tell if I'm running Windows or Linux.
Good luck - I'm going to wait a few days to upgrade to KDE 3.01 simply because I've been burned too many times for rushing out to upgrade to the latest and greatest. Although I feel very confident with Gentoo's ebuilds, I would like to compile 3.01 with these optimizations but still need to resolve that binutils deal and see what problems others have encountered.
Good luck -
Alec Berryman
Last edited by alec on Sat Jun 15, 2002 3:57 am; edited 3 times in total |
|
Back to top |
|
|
Beast_Master Guest
|
Posted: Sat May 25, 2002 5:39 pm Post subject: Thanks! |
|
|
Dear Sir,
Thankyou very muchf or all this... I would not have expected anyone to spend this much time in explaining all this. I was expecting more than one user pointing out different things. Again, thanks a lot! I'll get started immediately . Cheers! |
|
Back to top |
|
|
paulisdead Guru
Joined: 10 Apr 2002 Posts: 510 Location: Seattle, WA
|
Posted: Sat May 25, 2002 6:09 pm Post subject: |
|
|
I think I figured out how to install binutils-2.12. I'm about to go do a clean install of Gentoo, so I'll let you guys know if it works. From what I've read you have to use the ebuild command instead of portage, and I believe this should work to install it
$ ebuild binutils-2.12.90.0.7.ebuild fetch unpack compile install
it started downloading, but I hit ctrl-c to kill it, since I didn't feel like installing it on this configuration, since I'll be doing a clean install on my other hard drive.
Anybody have any suggestions on which binutils-2.12 should be used, or should we just use 2.12.90.0.7? |
|
Back to top |
|
|
Beast_Master Guest
|
Posted: Sun May 26, 2002 3:58 am Post subject: Another question: :) |
|
|
While going through this, I had another question:
- I ended up following steps 1 and 2, and before moving on to step 3, I installed my nvidia drivers for my geforce 2.
Should I re-install them after steps steps 3,4,5,..8 ? Or is there no performance gain from installing the nvidia drivers w/ the -fomit-frame-pointer in make.conf? Thanks for your help.
Cheers! . |
|
Back to top |
|
|
paulisdead Guru
Joined: 10 Apr 2002 Posts: 510 Location: Seattle, WA
|
Posted: Sun May 26, 2002 5:47 am Post subject: |
|
|
You don't actually compile nvidia's drivers, it's just doing make install. Their drivers are closed source, so they're already compiled, so compile optimizations don't do anything for them. |
|
Back to top |
|
|
yagami Apprentice
Joined: 12 May 2002 Posts: 269 Location: Leiria, Portugal
|
Posted: Sun May 26, 2002 9:56 am Post subject: done it |
|
|
well... done it ...
didnt actually recompile X , but everything else was done
wow , in my athlon 700 kde 3.0.1 is very sweet |
|
Back to top |
|
|
alec Apprentice
Joined: 19 Apr 2002 Posts: 270 Location: Here
|
Posted: Sun May 26, 2002 10:49 am Post subject: |
|
|
I can confirm paulisdead's method of building binutils - I did it, about to go do KDE. To use his command, you must be in /usr/portage/sys-devel/binutils/
Yagami: Of all things, I would want to recompile X. As a rule of thumb, the larger the program, the more optimizations will show, and as we all know well from watching that thing compile (and watching, and watching, and watching...), Xfree86 is one big program. |
|
Back to top |
|
|
roTor n00b
Joined: 21 Apr 2002 Posts: 55 Location: Atlanta, GA
|
Posted: Mon May 27, 2002 8:03 pm Post subject: ebuilding binutils-2.12.90.0.7 |
|
|
Have a question about ebuilding the above. Anyone have a problem with it?
I tried an ebuild as above and get the error:
>**The command "gcc-o conftest -march=i686 -o3 -pipe -fomit-frame-pointer
>-gcc: installation problem cannot exec 'as' : No such file or directory
>** You must set the enviorment variable CC to a working compiler
>
Think my make.conf needs to be backed off?
_________________ Even if you're on the right track, you'll get run over if you just sit there.
-- Will Rogers |
|
Back to top |
|
|
cjv n00b
Joined: 23 Apr 2002 Posts: 2
|
Posted: Mon May 27, 2002 8:32 pm Post subject: |
|
|
Try a capital 'O' as in -O3 instead of -o3. |
|
Back to top |
|
|
roTor n00b
Joined: 21 Apr 2002 Posts: 55 Location: Atlanta, GA
|
Posted: Mon May 27, 2002 10:55 pm Post subject: |
|
|
cjv wrote: | Try a capital 'O' as in -O3 instead of -o3. |
Thanks for noticing that , but I was only typing it from the output of another computers terminal. The flag setting is 03 in the make.conf.
So, I guess I might just have to skip the newer binutls _________________ Even if you're on the right track, you'll get run over if you just sit there.
-- Will Rogers |
|
Back to top |
|
|
roTor n00b
Joined: 21 Apr 2002 Posts: 55 Location: Atlanta, GA
|
Posted: Mon May 27, 2002 11:07 pm Post subject: |
|
|
OK may have found a problem with the ebuild of binutils. The ebuild man states that " Normally, to merge an ebuild, you need to fetch, unpack, compile, install and qmerge."
Should there be a qmerge added to the ebuild of binutils?
_________________ Even if you're on the right track, you'll get run over if you just sit there.
-- Will Rogers |
|
Back to top |
|
|
cjv n00b
Joined: 23 Apr 2002 Posts: 2
|
Posted: Mon May 27, 2002 11:20 pm Post subject: |
|
|
Unless you really want to change something in the configuration (which in this case you don't have to) you can just type:
ebuild /usr/portage/sys-devel/binutils/binutils-2.12.90.0.7.ebuild merge
and binutils-2.12 will be built and merged automatically for you. After that, just remerge glibc and you're on your way! |
|
Back to top |
|
|
roTor n00b
Joined: 21 Apr 2002 Posts: 55 Location: Atlanta, GA
|
Posted: Mon May 27, 2002 11:26 pm Post subject: |
|
|
cjv wrote: | Unless you really want to change something in the configuration (which in this case you don't have to) you can just type:
ebuild /usr/portage/sys-devel/binutils/binutils-2.12.90.0.7.ebuild merge
and binutils-2.12 will be built and merged automatically for you. After that, just remerge glibc and you're on your way! |
Thanks, will give it a try right now. _________________ Even if you're on the right track, you'll get run over if you just sit there.
-- Will Rogers |
|
Back to top |
|
|
beast_master Guest
|
Posted: Tue May 28, 2002 3:53 am Post subject: K.. done everything... just one question about performance.. |
|
|
Hi,
K, I've done it all.. and everything works (just like it worked before I did everything.. the startup of programs is a bit quicker ). But as far as the graphics tweaks are concerned, I'm not noticing any difference.
My real question is something like this:
In winBlows XP, when I move a window really quickly (I mean really really quickly), the window still moves very smoothly, no choppiness in the movement at all... nice smoot... infact, if you just drag around a window really quickly for the heck of it (yes, I know.. I don't have a life ), the movement is still very very smooth. In KDE.. when I do the same, the movement is not so smooth - its kinda choppy, kinda feels like the system is choking when I do it... ya know.. the feeling of the loss in framerate when the action gets really hot in a feature packed game.
The other thing that's choppy is when the mouse is in its animation mode... when you open Konqueror for example, the mouse goes into its neet, yet not so transparent, animation... when I move around the mouse then (rather quickly), the movement of the mouse is really choppy.
- Now my question is the following: Is this normal? Does this happen eventhough everything is optimised? Or have I not optimised/setup stuff correctly? Is this the same for everyone using KDE?.
Another thing, the writing (font) on most websites is kinda rough around the edges. How do I go about fixing this? Thanks for the help again.
- Wasn't sure if I should post it here or in the help sections... decided to post here since the first part is kinda relevant to the optimisation post above. Thanks again! .
- Cheers!
- Beast_Master |
|
Back to top |
|
|
Beast_Master Guest
|
Posted: Tue May 28, 2002 4:46 am Post subject: - fixed the rough font problem :). |
|
|
Just fixed the rough font problem... its a simple case of turning on "anti-aliasing" in the fonts section of "look and feel" section of control pannel in KDE . Stupid rough fonts .
Cheers!
- Beast_Master |
|
Back to top |
|
|
Sivar Apprentice
Joined: 25 May 2002 Posts: 266 Location: USA
|
Posted: Wed May 29, 2002 5:26 pm Post subject: Re: K.. done everything... just one question about performan |
|
|
beast_master wrote: | Hi,
In winBlows XP, when I move a window really quickly (I mean really really quickly), the window still moves very smoothly, no choppiness in the movement at all... nice smoot... infact, if you just drag around a window really quickly for the heck of it (yes, I know.. I don't have a life ), the movement is still very very smooth. In KDE.. when I do the same, the movement is not so smooth - its kinda choppy, kinda feels like the system is choking when I do it... ya know.. the feeling of the loss in framerate when the action gets really hot in a feature packed game.
|
Hmm, not sure. This shouldn't be a huge issue, though. XFree86's method of drawing to the screen is horribly inefficient whne you are running the X server and client on the same machine, but it is better than the Windows method. It might be that the drivers for your video card are a bit generic and do not take advantage of the 2D acceleration features that it has.
Quote: | The other thing that's choppy is when the mouse is in its animation mode... when you open Konqueror for example, the mouse goes into its neet, yet not so transparent, animation... when I move around the mouse then (rather quickly), the movement of the mouse is really choppy.
|
This doesn't happen for me except when the system is doing very heavy disk I/O. For example, it does not happen noticeably when I am compiling three things at once, but does when I load Mozilla. (what does that tell you about Mozilla? )
Again, might be video drivers. Most modern video cards can handle the mouse cursor in hardware. Perhaps hte X drivers do it in software regardless--can anyone verify this?
[/quote] _________________ The greatest deeds are still undone, the greatest songs are still unsung... |
|
Back to top |
|
|
kcsduke n00b
Joined: 25 May 2002 Posts: 40 Location: Cambridge, MA
|
Posted: Thu May 30, 2002 12:39 am Post subject: |
|
|
It seems like this may be a dumb question.... but can I use X/KDE while they are recompiling? Also, will recompiling X overwrite my current X config files?
Thanks! |
|
Back to top |
|
|
alec Apprentice
Joined: 19 Apr 2002 Posts: 270 Location: Here
|
Posted: Thu May 30, 2002 1:29 am Post subject: |
|
|
Not a dumb question at all. Yes, you can use any program while it is recompiling. For example, I have an early version of exim 4 running on my server, and have actually recompiled/updated it several times, but the old version is still there running because I have been too lazy to update the configs and restart it.
Recompiling will not (or should not) overwrite your configuration files. Portage has a configuration protection - that's why you will sometimes see something to the effect of "Warning: 1 config needs updating in /etc". Portage renames the new files ._cfg0000_config (and they're numbered) and you can edit/move/copy at your leisure. If you emerge gentoolkit, you'll get a program called etc-update, which will show you diffs and let you choose to update to a new config or keep the old one.
Personally, if I'm recompiling X/KDE, I'm doing that overnight :) |
|
Back to top |
|
|
xelnix n00b
Joined: 29 May 2002 Posts: 2
|
Posted: Thu May 30, 2002 5:53 pm Post subject: alec |
|
|
Code: |
cd /usr/src/linux &&
cp .config /root/.config &&
make mrproper &&
cp /root/.config .config &&
make menuconfig &&
make dep &&
make clean &&
make bzImage &&
make modules &&
make modules_install &&
cp /boot/bzImage /boot/bzImage.old &&
cp /usr/src/linux/arch/i386/boot/bzImage /boot &&
emerge nvidia-kernel &&
emerge nvidia-glx &&
emerge alsa-driver &&
emerge alsa-lib &&
emerge alsa-utils &&
emerge alsa-oss &&
emerge alsa-tools
|
alsa-driver is the only thing containing modules, no need to re-emerge every other alsa related ebuild. |
|
Back to top |
|
|
S_aIN_t Guru
Joined: 11 May 2002 Posts: 488 Location: Ottawa
|
Posted: Thu May 30, 2002 10:27 pm Post subject: |
|
|
those are some good tips.. thanks people.. good work |
|
Back to top |
|
|
Evangelion Veteran
Joined: 31 May 2002 Posts: 1087 Location: Helsinki, Finland
|
Posted: Fri May 31, 2002 9:40 am Post subject: A stupid question: |
|
|
These tips talk about combreloc. What about prelinking? Is it enabled by default, does it mean more or less the same thing or what? How would one enable it? |
|
Back to top |
|
|
Zu` l33t
Joined: 26 May 2002 Posts: 716 Location: BE
|
Posted: Fri May 31, 2002 10:14 am Post subject: Re: Optimize KDE 3.0.1 for Gentoo |
|
|
klieber wrote: | From the gentoo mailing list:
Quote: |
1) set up Gentoo 1.1a w/stage3 per install docs
2) installed kernel-2.4.19-r4, preempt, lowlatency
3) *important: merged binutils-2.12+ in order to take advantage of combreloc (but built kernel with 2.11 beforehand just to be safe)
|
--kurt |
Compiling a new kernel won't work with binutils-2.12+ ?
And do these tips have any effect on the building of other packages? I don't use KDE. Will these settings only boost performance on KDE?
Thanks, |
|
Back to top |
|
|
|
|
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
|
|