HOWTO AMD64

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

[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 using: NSpluginwrapper. 64bit Firefox3 and nspluginwrapper work perfectly for me using 32bit netscape-flash (10beta) binaries.

There is now a working 64-bit java plugin called icedtea.

  • 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:
    1. The SATA drivers for the VIA controller are not loaded automatically
    2. 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.

[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.


[edit] Firefox

The following links are to instructions that will enable some popular plugins in Firefox. There are now three methods, only one of which entails 32bit binary firefox.

[edit] Troubleshooting: firefox-bin Starts 64-bit Firefox

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 been updated to work on AMD64 system, however a newer kernel is required. Patches for the vanilla kernel (from 2.6.20 to 2.6.26) are available from:

For a guide to recompiling you kernel and installing Reiser4, see:

For another guide to installing Gentoo with Reiser4, see the

[edit] Mplayer and 32bit codecs

Note: The following should no longer be necessary. This author has mplayer working in 64 bit with zero issues with 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
Personal tools
In other languages