WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: 64-bit drivers from ati-fglrx-kernel-source.tcz  (Read 5982 times)

Offline MiniQ9

  • Newbie
  • *
  • Posts: 48
64-bit drivers from ati-fglrx-kernel-source.tcz
« on: January 10, 2011, 01:22:30 AM »
Help me build a driver for 64-bit system Ati from ati-fglrx-kernel-source.tcz

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #1 on: January 10, 2011, 03:23:32 AM »
i didn't test ati-fglrx extensions in an 64 bit system, but you need toolchain64 extension and tc linux kernel src patched and installed for building any kernel module, that's quite complicated for a standart user to do unfortunately, wish there was a linux-headers-* for tc 64 too

steps to do in summary
1) download linux src patched and related config file
http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/release/src/kernel/
2) load compiletc + toolchain64 extensions and open up a toolchain64 shell
3) extract linux src patched, cd to linux src, and move config file into linux src with name .config
4) prepare linux src for compiling modules
Code: [Select]
export ARCH=x86_64 CROSS_COMPILE=x86_64-unknown-linux-gnu-
make oldconfig
make modules_prepare
6) create system symlinks for pointing to linux src installation
Code: [Select]
sudo mkdir -p /usr/src
sudo ln -sf /path/to/linux/src /usr/src/linux
sudo ln -sf /usr/src/linux /lib/modules/`uname -r`/kernel/build

then you should be able compile ati fglrx kernel module by a simple make command
« Last Edit: January 10, 2011, 03:53:05 AM by Arslan S. »

Offline MiniQ9

  • Newbie
  • *
  • Posts: 48
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #2 on: January 10, 2011, 08:37:09 AM »
ATI modules compiled by ./make.sh
In make.sh many calls uname-r.
In order not to change make.sh I booted into TinyCore64.
and
1) download linux src patched and related config file
http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/release/src/kernel/
2) load compiletc + toolchain64 extensions and open up a toolchain64 shell
3) extract linux src patched, cd to linux src, and move config file into linux src with name .config
4) prepare linux src for compiling modules
Code: [Select]
export ARCH=x86_64 CROSS_COMPILE=x86_64-unknown-linux-gnu-
make oldconfig
make modules_prepare
6) create system symlinks for pointing to linux src installation
Code: [Select]
sudo mkdir -p /usr/src
sudo ln -sf /path/to/linux/src /usr/src/linux
sudo ln -sf /usr/src/linux /lib/modules/`uname -r`/kernel/build
But I have compilation errors.
Code: [Select]
AMD kernel module generator version 2.1
.
Active kernel:
uname -a = Linux box 2.6.33.3-tinycore64 #444 SMP Wed May 12 16:51:51 EEST 2010 x86_64 GNU/Linux
uname -s = Linux
uname -m = x86_64
uname -r = 2.6.33.3-tinycore64
uname -v = #444 SMP Wed May 12 16:51:51 EEST 2010
.
Target kernel:
uname -a = Linux box 2.6.33.3-tinycore64 #444 SMP Wed May 12 16:51:51 EEST 2010 x86_64 GNU/Linux
uname -s = Linux
uname -m = x86_64
uname -r = 2.6.33.3-tinycore64
uname -v = #444 SMP Wed May 12 16:51:51 EEST 2010
.
OsVersion says: SMP=1
file /lib/modules/2.6.33.3-tinycore64/build/include/generated/autoconf.h says: SMP=1
file /lib/modules/2.6.33.3-tinycore64/build/include/generated/autoconf.h says: MODVERSIONS=
file /lib/modules/2.6.33.3-tinycore64/build/arch/x86/include/asm/compat.h says: COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space
.
doing Makefile based build for kernel 2.6.x and higher
make -C /lib/modules/2.6.33.3-tinycore64/build SUBDIRS=/usr/local/src/fglrx-build/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux'
  CC [M]  /usr/local/src/fglrx-build/fglrx/build_mod/2.6.x/firegl_public.o
/usr/local/src/fglrx-build/fglrx/build_mod/2.6.x/firegl_public.c:1: error: code model ‘kernel’ not supported in the 32 bit mode
/usr/local/src/fglrx-build/fglrx/build_mod/2.6.x/firegl_public.c:1: sorry, unimplemented: 64-bit mode not compiled in
make[2]: *** [/usr/local/src/fglrx-build/fglrx/build_mod/2.6.x/firegl_public.o] Error 1
make[1]: *** [_module_/usr/local/src/fglrx-build/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux'
make: *** [kmod_build] Error 2
build failed with return value 2

Offline MiniQ9

  • Newbie
  • *
  • Posts: 48
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #3 on: January 11, 2011, 01:09:34 PM »
People, well, help the module to compile

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #4 on: January 11, 2011, 02:40:12 PM »
Aassuming you have setup linux kernel source as instructed in my first post and toolchain64.tcz is installed.

Start a toolchain64-shell (just type "toolchain64-shell" in a terminal)

Code: [Select]
patch -p0 -i makefile.patch
cd fglrx/build_mod
cp libfglrx_ip.a.GCC4.x86_64 libfglrx_ip.a.GCC4
make CC=x86_64-unknown-linux-gnu-gcc LD=x86_64-unknown-linux-gnu-ld GCC_VER_MAJ=4 SMP=1 PAGE_ATTR_FIX=0 COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space

makefile.patch
Code: [Select]
--- fglrx/build_mod/Makefile 2011-01-11 14:31:30.427033848 +0000
+++ fglrx/build_mod/Makefile 2011-01-11 14:33:51.979514906 +0000
@@ -66,6 +66,7 @@
                 -DFGL_GART_RESERVED_SLOT \
                 -DFGL_LINUX253P1_VMA_API \
                 -DPAGE_ATTR_FIX=$(PAGE_ATTR_FIX) \
+                -DCOMPAT_ALLOC_USER_SPACE=$(COMPAT_ALLOC_USER_SPACE) \
 
 ifeq ($(KERNELRELEASE),)
 # on first call from remote location we get into this path

Offline MiniQ9

  • Newbie
  • *
  • Posts: 48
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #5 on: January 12, 2011, 02:08:30 AM »
Thank you so much, the module compiled.
However, no happiness in this life (.
The module is loaded, but hangs Xorg system.
Someone tell me what else you want to change a 64 bit system?

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #6 on: January 12, 2011, 03:50:56 AM »
can you post xorg log, it is in /var/log

if your pc freezes create a symlink /var/log to some persistent storage device, thus you won't lose log files when you reboot computer

also make sure you have graphics-2.6.33.3-tinycore64.tcz installed
« Last Edit: January 12, 2011, 05:31:42 AM by Arslan S. »

Offline MiniQ9

  • Newbie
  • *
  • Posts: 48
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #7 on: January 12, 2011, 04:40:26 AM »
I have downloaded graphics-2.6.33.3-tinycore64.tcz (not graphics-2.6.33.3-tinycore.tcz)
In terminal I see "kernel panic".
May need to download the 64 bit libraries that come with proprietary drivers? Although 32-bit Xorg ...

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #8 on: January 12, 2011, 05:48:24 AM »
i don't think 64 bit glx driver will work with xorg

maybe 32 bit ati glx driver is incompatible with 64 bit fglrx kernel module

as i said before i did not test fglrx on a tc/mc64 system, but i have a tc64 setup with nvidia drivers installed

looking at your xorg log, i find lines 388-393 interesting
Quote
(EE) fglrx(0): atiddxDriScreenInit failed, GPS not been initialized.
(WW) fglrx(0): ***********************************************************
(WW) fglrx(0): * DRI initialization failed                               *
(WW) fglrx(0): * kernel module (fglrx.ko) may be missing or incompatible *
(WW) fglrx(0): * 2D and 3D acceleration disabled                         *
(WW) fglrx(0): ***********************************************************

is the module (fglrx.ko) installed somewhere in /lib/modules/2.6.33.3-tinycore64/kernel/drivers/video ?

Code: [Select]
sudo modprobe fglrxreturns any warning or error ?

« Last Edit: January 12, 2011, 05:55:44 AM by Arslan S. »

Offline MiniQ9

  • Newbie
  • *
  • Posts: 48
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #9 on: January 12, 2011, 06:28:52 AM »
fglrx.ko in memory and is loaded w/o error
dmesg says:
Code: [Select]
[fglrx] Maximum main memory to use for locked dma buffers: 1883 MBytes.
[fglrx]   vendor: 1002 device: 94c1 count: 1
[fglrx] ioport: bar 4, base 0xa000, size: 0x100
pci 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
pci 0000:01:00.0: setting latency timer to 64
[fglrx] Kernel PAT support is enabled
[fglrx] module loaded - fglrx 8.79.4 [Oct 26 2010] with 1 minors
Maybe it is time to build the 64-bit Xorg? What do you think?

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: 64-bit drivers from ati-fglrx-kernel-source.tcz
« Reply #10 on: January 12, 2011, 06:48:54 AM »
i think it is not an easy task, and why are you insisting on 64 bit so much to dare compiling xorg from scratch ?
also there is no gaurantee that you will get fglrx driver running properly at the end