HOWTO AMD64
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
[edit] Introduction
We Gentoo geeks (and yes, begrudgingly, those SUSE, Mandriva, and Debian et al geeks) can have a native 64-bit operating system. Nowadays (Jan, 2008) amd64 should be as stable and feature rich as x86.
[edit] Applications without 64-bit support
- If you feel like gaming on an AMD64 system you can use all the games that are available on a regular x86 installation. The binary games will also work. The only difference is that they will pull into your system some emul-* packages as dependencies. Those emul-* packages are precompiled 32 bits versions of some basic and multimedia libraries that are needed to run 32 bit binaries under amd64. The NVidia and ATi drivers support this transparently as well.
- IMPORTANT notice about emul-linux-x86-soundlibs: check that the alsa libraries provided by this emulation package are the same as the native ones. For reference: 2.3 has version 1.0.10 and 2.4 has version 1.0.11. So, until an emulation package with version major than 1.0.11 is released, it's better for you to use alsa 1.0.11 with emulation libraries 2.4. Otherwise you will obtain weird errors for some configurations.
- If you want to view video clips, you will be glad to know that mplayer has come a long way, and it doesn't require win32codecs any longer to play Windows Media stuff. However, on very specific circumstances, you can also look into the chroot below or mplayer-bin as workarounds to the 32-bit binary codec problem.
- If you use Mozilla or Firefox there are some plugins which are not available as 64-bit versions yet. The most famous of them is the Flash plugin from Adobe. There is an open source clone called gnash but it doesn't support the newer version of Flash at the moment (and I didn't get it working). Adobe Flash can also be run with a precompiled version of Firefox, see below. (There is a petition: http://www.petitiononline.com/lin64swf/petition.html)). However it is possible to run 32-bit plugins under a 64-bit browser - give NSpluginwrapper a try. There has until very recently been no 64-bit Java plugin either, though 32-bit plugins can be made to work. There is now a working 64-bit java plugin called icedtea.
- If you want to use Adobe Acrobat Reader - Acrobat Reader 7 works fine under AMD64, the only problem is the webbrowser plugin which won't work on 64-bit browsers (but works fine with 32-bit browsers, at least Firefox). KDE's KPDF does work with Konqueror, although it doesn't support all the features of Acrobat Reader.
- Acrobat Reader plugin works for me with www-client/mozilla-firefox-2.0.0.11, app-text/acroread-7.0.9-r1, and net-www/nspluginwrapper-0.9.91.4
- Java applications (Azureus, Eclipse, etc..) are no longer a problem as there is an AMD64 version available now.
[edit] Force building of unsupported applications
For some applications that have not yet been tested for the amd64 architecture, it might work to force building them by specifying the ~x86 keyword. If it works, please submit a bug on Gentoo's Bugzilla to make developers aware of it, so they can keyword the ebuilds adequately.
Most x86 stuff will compile and run with zero problems under amd64. The reason why the ebuilds take longer to get into stable amd64 is because people do not report working ebuilds. So, please, do it.
[edit] Helpful Tips & Tricks
- If you have a Tyan board using the tg3 module for the network adapter, and it fails to install correctly, add the dummy module immediately before it. This will add a dummy network adapter, but you don't need to configure it or do anything with it. You will notice that the tg3 module now loads correctly.
- If the system hangs on boot during hotplug, don't use hotplug by adding the nohotplug option on the kernel load line in your boot loader (note: this assumes you are using Genkernel to generate your kernels). Be sure to rc-update del hotplug so that it doesn't run it during boot.
- If you have a Shuttle SN85G4, you'll need to pass the noapic option to the kernel in order for the kernel to see your SATA disk(s). Without this option, the kernel detects the 6-in-1 card reader, and fails to detect the SATA disk as a disk.
- You may run into the following problems when booting the live cd with an MSI K8T Neo2 (FIR) board:
- The SATA drivers for the VIA controller are not loaded automatically
- The command modprobe sata_via hangs
- The solution is the noapic kernel option. After that the drivers are not loaded automatically, but you can at least modprobe.
- This seems to be a problem with the kernel version of the LiveCD, because with my currently running system I don't need that option anymore.
- The MSI K8N Neo Platinum motherboard needs the noapic option passed to the LiveCD (2004.3), otherwise you will get all sorts of I/O errors and segfaults. With that you should install without problems.
- On the DFI Lanparty motherboards and other NForce 4 Chipsets with Vitesse VSC8201 Gigabit and Marvell 88E8001 Gigabit you can use modprobe forcedeth to load the open source drivers if the network interface is not detected.
- Partimage does also not work. I dont know any workaround, only way use an other 32bit-linux or a LiveCD.
- Note that when using a compiled version of firefox on a 64-bit system realplayer, flash and mplayer (probably others) do not come in 64-bit flavours and as such you will not be able to view flash websites, listen to realplayer embedded into a website (for example bbc radio), or watch embedded video that requires the win32codecs. The alternative is to use the -bin equivalent packages (eg. mozilla-firefox-bin for mozilla-firefox)
[edit] multilib vs no-multilib profile
If you don't know what multilib is, read this first: http://www.gentoo.org/doc/en/gentoo-amd64-faq.xml#multilib
If you decided to use a no-multilib system and removed all multilib components from your system previously you can change back to a multilib system (e.g. you want to use wine or virtualbox now), even though the gentoo documentation says that you cannot switch from a no-multilib to a multilib-enabled profile (dunno who wrote that). Just follow these steps:
- Step 1:
| Code: Change your profile |
rm /etc/make.profile ln -s /usr/portage/profiles/default/linux/amd64/2008.0/desktop/ /etc/make.profile |
You may use another profile of your choice of course.
- Step 2:
| Code: Install a multilib-enabled system on your computer and chroot into this system |
mkdir /mnt/gentoo cd /mnt/gentoo |
Download stage3 from your nearest gentoo mirror into /mnt/gentoo; the file is called stage3-amd64-2008.0_beta2.tar.bz2 (or later)
| Code: |
tar xvjpf stage3-amd64-2008.0_beta2.tar.bz2 mount -t proc none /mnt/gentoo/proc mount -o bind /dev /mnt/gentoo/dev cp -r /usr/portage /mnt/gentoo/usr chroot /mnt/gentoo /bin/bash env-update |
- Step 3:
| Code: Build a binary package for glibc and install it on your main system |
quickpkg glibc exit cp -r /mnt/gentoo/usr/portage/packages /usr/portage emerge -K glibc |
- Step 4:
| Code: Cleanup and recompile glibc and gcc |
umount /mnt/gentoo/dev umount /mnt/gentoo/proc rm -rf /mnt/gentoo emerge -av gcc glibc |
Make sure, that both ebuilds have multilib enabled (and your favorite useflags of course).
After you have finished compiling gcc and glibc, you may recompile your system with the new default useflags from your new profile. But look at the new packages and flags before installing them blindly, the new profile might introduce some stuff you don't like (just edit /etc/make.conf and correct your USE-flags).
| Code: recompile packages with changed useflags |
emerge -av --newuse world |
[edit] Kernel Support for 32-bit Applications
To allow a 64-bit system to run 32-bit applications, the kernel must have support for running 32-bit binaries. This is achieved by enabling the options shown below
| Linux Kernel Configuration: 32-bit application support in a 64-bit kernel |
Executable file formats / Emulations [*] IA32 Emulation [*] IA32 a.out support |
[edit] 32-bit Libraries
If you find a 32-bit application isn't working on a 64-bit system, it may indicate that some of the required libraries are missing. The following is a list of packages which provide 32-bit libraries on a 64-bit system.
Obviously not all applications will require all libraries, so a bit of brain power may be needed to work out which is required. For a list of what libraries are included in which of these packages, see The app-emulation/emul-linux-x86-* packages
All the following packages can be found in the app-emulation category in portage. Generally portage should emerge these packages as required. If a missing dependency is found in a package in portage, please report it to Gentoo's Bugzilla.
- emul-linux-x86-baselibs
- emul-linux-x86-compat
- emul-linux-x86-gtklibs
- emul-linux-x86-java
- emul-linux-x86-medialibs
- emul-linux-x86-qtlibs
- emul-linux-x86-sdl
- emul-linux-x86-soundlibs
- emul-linux-x86-xlibs
[edit] Firefox
The following instructions will get some popular plugins working with Firefox. However, you need to be using the 32-bit binary package. To install it, run: emerge mozilla-firefox-bin
Note that the 32-bit version of Firefox will be able to use profiles created by the 64-bit version and vice-versa, so all your settings and extensions should remain unchanged.
[edit] Troubleshooting: firefox-bin Starts 64-bit Firefox
There's a caveat to this method: if you run firefox and then run firefox-bin without closing the first Firefox, instead of starting an instance of the 32-bit Firefox, another copy of the 64-bit Firefox will start instead. This also works the other way around.
The solution is to only use the 64-bit compiled version of Firefox or only the 32-bit binary version of Firefox. Alternatively, you can create different profiles by running firefox -ProfileManager and run firefox-bin -P 32bit instead of firefox-bin.
[edit] Setting up a 32-bit chroot environment
See the chroot subpage.
[edit] Reiser4 and AMD64
Reiser4 has just recently been updated to work on AMD64 system, however a newer kernel is required. The following are a list of kernels that are reported to work with Reiser4 and AMD64, please note that these kernels (and Reiser4) are experimental and may cause problems:
mm patchset: 2.6.14* beyond-sources: 2.6.16* cko-sources: 2.6.12-cko3
For a guide to installing Gentoo with Reiser4, see the Unofficial CONRAD Gentoo Reiser4 Install LiveCD amd64
[2008-02-19] http://linuxhelp.150m.com/installs/compile-kernel.htm [2008-02-19] http://chichkin_i.zelnet.ru/namesys
[edit] Mplayer and 32bit codecs
Add the following entries to /etc/portage/package.keywords.
| File: /etc/portage/package.keywords entries |
media-video/mplayer-bin media-libs/win32codecs app-emulation/emul-linux-x86-medialibs app-emulation/emul-linux-x86-soundlibs app-emulation/emul-linux-x86-baselibs |
Start the 32-bit mplayer with mplayer-bin or gmplayer-bin if you want a GUI. You may find that you get better results with gmplayer-bin mplayer-bin.
- If you get a -vo error stating: /dev/mga_vid couldn't be found try -vo xv.
- If you get an error stating:
Win32 LoadLibrary failed to load: wmvdmod.dll /usr/lib/win32/wmvdmod.dll, /usr/local/lib/win32/wmvdmod.dll
or similar, make a link to lib32 directory: ln -s /usr/lib32/win32 /usr/lib/win32
[edit] RealPlayer
Emerge media-sound/alsa-driver with the oss USE flag:
echo "media-sound/alsa-driver oss" >> /etc/portage/package.use emerge -av media-sound/alsa-driver /etc/init.d/alsasound restart
Emerge media-video/realplayer:
emerge -av media-video/realplayer
Lauch RealPlayer:
realplay
If you have green picture, turn off XVideo: Tools » Preferences » Hardware » Use XVideo
If you have problems with choppy image, it can be because of the OSS drivers problems. Try to execute RealPlayer like this:
aoss32 realplay
[edit] Radeon 3D-acceleration in 32-bit programs
Getting 3D acceleration working with ATI Radeon requires proprietary drivers for some chips (in particular newer ones) and some 32-bit programs must be enabled with the correct GL-drivers setting.
Before you run your game, you should export the proper LIBGL_DRIVERS_PATH environment variable:
export LIBGL_DRIVERS_PATH=/usr/X11R6/lib32/modules/dri
or just run the game/program with the variable included in the command:
LIBGL_DRIVERS_PATH=/usr/X11R6/lib32/modules/dri enemy-territory
