LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   [yet another] ATI driver install problem -2.6.* (https://www.linuxquestions.org/questions/slackware-14/%5Byet-another%5D-ati-driver-install-problem-2-6-%2A-194492/)

carboncopy 06-17-2004 03:52 AM

[yet another] ATI driver install problem -2.6.*
 
Hi!

I know there is a few ATi threads floating around but it is messy and missed out a few steps which drives me up the wall.

System:
Ati Radeon 9200SE
AMD-athlon-xp
VIA-AGP
xorg (dropline)

This is what I have done:

1. Download latest Ati driver (fglrx-4.3.0-3.9.0.i386.rpm).
2. rpm2tgz fglrx-4.3.0-3.9.0.i386.rpm
3. installpkg fglrx-4.3.0-3.9.0.i386.tgz
4. configure 2.6.7 to include via-agp (build-in)
configure 2.6.7 to exclude DRI(DRM)
5. install the kernel and reboot.

Now what?

Thanks in advance.

SBing 06-17-2004 07:05 AM

Don't you now have to edit your x.org config file to use the fglrx driver?

I _think_ it's just a case of editing the file and replacing whatever is being used as the driver with fglrx but someone will correct that.

Steve

1351 06-17-2004 10:59 AM

This is much the same discussion we were having over in this thread:
http://www.linuxquestions.org/questi...hreadid=193887

However, at the risk of being redundant, here's my method for installing the ATI drivers, slightly updated from the version I've previously posted.
I'm still chasing one last error, but the method is largely successful.

I've currently got it working on an AMD64 laptop running the latest Slackware-current (that would be Slackware 10 rc1) with kernel 2.6.6

1. Recompile your Linux kernel to modify the following:
Include as a module - Device drivers > Character devices > /dev/agpgart
Include as a module - Device drivers > Character devices > /dev/agpgart > whatever the appropriate driver is for your system (in my case, I enabled "AMD Opteron/Athlon64 on-CPU GART support")
REMOVE - Device drivers > Character devices > Direct Rendering Manager

The ATI driver should be installed or recompiled AFTER these changes have been made.

2. Get the latest (4.3.0 at time of writing) ATI Radeon driver from http://www.ati.com/support/driver.html

3. Download DRI. The latest version snapshot (as of 09-Jun-2004) doesn't work. The most recent working version I've found so far is is available at:
http://www.freedesktop.org/~dri/snap...x.i386.tar.bz2

4. Install the ATI driver. This is all best done at the command line - not in a shell console. Please note that ATI driver is very sensitive and that you should probably go through this step again every time you modify your Linux kernel.

run rpm2tgz on the ati driver rpm, and use pkgtool to install it.
cd lib/modules/fglrx/build_mod
sh make.sh
cd ..
sh make_install.sh
modprobe fglrx


lsmod to make sure that fglrx, agpgart, and the correct agp module for your system (amd64_agp in my case) are all loaded.

fglrxconfig

You'll have to enable external agp here. If you are running Xorg rather than XFree86, when you're asked if you want to save, say no to all the suggested file names and locations, and instead provide it with the following address:
/etc/X11/xorg.conf

BEFORE YOU DO THIS IT IS A VERY GOOD IDEA TO MAKE A COPY OF YOUR OLD xorg.conf FILE.
Call it xorg.conf-old or somesuch. If everything goes horribly wrong, you can copy it back to its original name to get X to at least load again.

Add this to modprobe.conf:
install fglrx /sbin/modprobe --ignore-install fglrx && { /sbin/modprobe amd64_agp; /bin/true; }

5. Go to wherever you've unpacked dri and
sh install.sh

6. Testing
You should now be able to startx with everything working, although I prefer to reboot first at this point.

That should get it up and running, with most 3d applications working, although fgl_glxgears produces "Error: couldn't get fbconfig" - a problem which I'm hunting down the cause of right now.

In X, open up a shell terminal.
There are a couple of useful utilities that you can use to test your card.

/usr/X11R6/bin/glxgears
Measures the speed in 3d - enlarge to full screen and leave running for 30 seconds or so before closing. At fullscreen 1024 x 768 it reports:
1318 frames in 5.0 seconds = 263.600 FPS

/usr/X11R6/bin/glxinfo
Provides info on your card. The line you really want to see is:
"direct rendering: Yes"

/usr/X11R6/bin/fgl_glxgears
ATI's version of the speed test. Currently produces the error: "Error: couldn't get fbconfig". :(

/usr/X11R6/bin/fglrxinfo
Should now produce something similar to the following result:
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: MOBILITY RADEON 9600 Generic
OpenGL version string: 1.3 (X4.3.0-3.9.0)

Good luck.

carboncopy 06-17-2004 11:07 AM

Okay maybe I should be more exact.

After I download both the dri and the fglrx drivers.
Which do I install first? Do I install the dri first then only build_mod fglrx?

by the way, editing xorg.conf is not a problem. I managed to edit to make use of both output as xinerama.

1351 06-17-2004 11:14 AM

Quote:

Originally posted by carboncopy
After I download both the dri and the fglrx drivers.
Which do I install first? Do I install the dri first then only build_mod fglrx?

fglrx first, then dri

carboncopy 06-17-2004 07:52 PM

Ok this is what I get at trying to build_mod fglrx:

Code:

root@bigmac:/lib/modules/fglrx/build_mod# sh make.sh
ATI module generator V 2.0
==========================
initializing...
cleaning...
patching 'highmem.h'...
skipping patch for 'drmP.h', not needed
skipping patch for 'drm_os_linux.h', not needed
assuming new VMA API since we do have kernel 2.6.x...
doing Makefile based build for kernel 2.6.x and higher
make -C /lib/modules/2.6.7/build SUBDIRS=/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-2.6.7'
  CC [M]  /lib/modules/fglrx/build_mod/2.6.x/agpgart_be.o
/lib/modules/fglrx/build_mod/2.6.x/agpgart_be.c: In function `agp_generic_alloc_page':
/lib/modules/fglrx/build_mod/2.6.x/agpgart_be.c:1405: error: structure has no member named `count'
/lib/modules/fglrx/build_mod/2.6.x/agpgart_be.c: In function `ali_alloc_page':
/lib/modules/fglrx/build_mod/2.6.x/agpgart_be.c:4416: error: structure has no member named `count'
make[2]: *** [/lib/modules/fglrx/build_mod/2.6.x/agpgart_be.o] Error 1
make[1]: *** [_module_/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.7'
make: *** [kmod_build] Error 2
build succeeded with return value 0
duplicating results into driver repository...
done.
==============================
You must change your working directory to /lib/modules/fglrx
and then call ./make_install.sh in order to install the built module.
==============================
root@bigmac:/lib/modules/fglrx/build_mod#

So what is the Error 1 and Error 2 about?
As far as I know, Error 2 means bad news. What can I do to fix this?

1351 06-17-2004 10:55 PM

Ah, it seems that the ATI drivers need modification to be made to work under kernel 2.6.7

Check out http://kerneltrap.org/node/view/3298 for a potential solution.

I'd be most appreciative if you'd let me know how it goes for you if you try this.

Best of luck!

carboncopy 06-18-2004 12:00 AM

fglrx-3.9.0 and 2.6.7 kernel patch
 
make.sh SUCCESSFUL with

Code:

Common subdirectories: a/2.6.x and b/2.6.x
diff -puN a/agpgart_be.c b/agpgart_be.c
--- a/agpgart_be.c        2004-05-06 22:51:27.000000000 -0400
+++ b/agpgart_be.c        2004-06-17 12:44:19.000000000 -0400
@@ -1402,7 +1402,7 @@ unsigned long agp_generic_alloc_page(voi
    }
 #endif
 
-    atomic_inc(&page->count);
+    get_page(page);
    set_bit(PG_locked, &page->flags);
    atomic_inc(&agp_bridge.current_memory_agp);
 
@@ -1449,7 +1449,7 @@ void agp_generic_destroy_page(unsigned l
    put_page(page);
    UnlockPage(page);
 #else /* AGPGART_2_4_19 */
-    atomic_dec(&page->count);                                               
+    __put_page(page);                                               
    clear_bit(PG_locked, &page->flags);                                     
    wake_up(&page->wait);                                                   
 #endif /* AGPGART_2_4_19 */
@@ -4413,7 +4413,7 @@ static unsigned long ali_alloc_page(void
    if (page == NULL)
        return 0;
 
-    atomic_inc(&page->count);
+    get_page(page);
    set_bit(PG_locked, &page->flags);
    atomic_inc(&agp_bridge.current_memory_agp);
 
@@ -4509,7 +4509,7 @@ static void ali_destroy_page(unsigned lo
    put_page(page);
    UnlockPage(page);
 #else /* AGPGART_2_4_19 */
-    atomic_dec(&page->count);
+    __put_page(page);
    clear_bit(PG_locked, &page->flags);
    wake_up(&page->wait);
 #endif /* AGPGART_2_4_19 */
diff -puN a/firegl_public.c b/firegl_public.c
--- a/firegl_public.c        2004-03-17 17:00:29.000000000 -0500
+++ b/firegl_public.c        2004-06-17 12:44:54.000000000 -0400
@@ -2010,7 +2010,7 @@ static __inline__ vm_nopage_ret_t do_vm_
    pMmPage = virt_to_page(kaddr);
 #endif /* LINUX_VERSION_CODE < 0x020400 */
 
-    atomic_inc(&(pMmPage->count));  /* inc usage count of page */
+    get_page(pMmPage);  /* inc usage count of page */
 
 #if LINUX_VERSION_CODE >= 0x020400
  //  __KE_DEBUG3("vm-address 0x%08lx => kernel-page-address 0x%p\n",
@@ -2052,7 +2052,7 @@ static __inline__ vm_nopage_ret_t do_vm_
    // Don't increment page usage count, cause ctx pages are allocated
    // with drm_alloc_pages, which marks all pages as reserved. Reserved
    // pages' usage count is not decremented by the kernel during unmap!!!
-    atomic_inc(&(pMmPage->count)); /* inc usage count of page */
+    get_page(pMmPage); /* inc usage count of page */
 #endif
 
 #if LINUX_VERSION_CODE >= 0x020400

Thanks to 1351

Steps,
copy the code above and save it as agpart-2.6.7-diff.patch at /lib/modules/fglrx/build_mod
at that directory

patch -p1 < agpart-2.6.7-diff.patch
sh make.sh

carboncopy 06-18-2004 12:05 AM

Ok I have modprobe fglrx and it is successful, but I haven't install dri.

Shouldn't I install dri first before modprobe fglrx?

Anyway, this is my lsmod :

Code:

root@bigmac:/lib/modules/fglrx# modprobe fglrx
root@bigmac:/lib/modules/fglrx# lsmod
Module                  Size  Used by
fglrx                213092  0
tuner                  18124  0
saa7134                96652  0
video_buf              20996  1 saa7134
v4l2_common            6272  1 saa7134
v4l1_compat            14468  1 saa7134
i2c_core              24148  2 tuner,saa7134
ir_common              4484  1 saa7134
videodev                9920  1 saa7134
root@bigmac:/lib/modules/fglrx#


1351 06-18-2004 12:19 AM

I've always installed dri as the last step before starting X and it's worked fine - most people seem to recommend doing it that way.

In your lsmod, I didn't notice agpgart or the whatever_apg module for your board - this looks like a potential problem. You might want to try modprobing them.

Edited to include:

lsmod on my system reports back the following about the relevant modules -

amd64_agp 8648 1
fglrx 213412 7
agpgart 27624 2 amd64_agp


Thanks for reporting back about the patch - I'll give it a go myself. :)

carboncopy 06-18-2004 01:14 AM

GuineaPIG
 
Quote:

Originally posted by 1351
Thanks for reporting back about the patch - I'll give it a go myself. :)
No problem. Thanks for letting me be the guniea pig. :D

Anyhow, i don't have agp_via is because it is build into the kernel. Will I encounter problem?

I am reluctant to quit my xorg and restart because I am downloading using bittorrent now. It takes a while to get connected to the tracker if I quit. Will try out once I am comfortable.

linuxquestions.org rocks !

carboncopy 06-18-2004 03:20 AM

DARN!
After installing the fglrx and dri I only get half xinerama.
What I meant is that, my mouse can cross over two both screen, BUT both screen is showing the same thing.

No matter if I am using ati or fglrx.

Looks like I am going to roll back.
I hope rebooting will help.

carboncopy 06-18-2004 03:27 AM

Rebooting doesn't help!

HELP ME PLEASE!

I don't want to wipe out my system.

1351 06-18-2004 06:40 AM

I think you may have to disable Xinerama.

According to the ATI Radeon Linux FAQ at http://www.rage3d.com/content/articles/atilinuxhowto/ the drivers don't get along at all well with Xinerama, but as you can see, the information seems a tad out of date.

Quote:

13.4 Xinerama configuration

You can find the Xinerama XF86Config-4 sample here:

http://www.rage3d.com/content/articl...-4-Xinerama.gz

Xinerama setup is like the Dual Head one. Currently, despite the fact that I tried hard, with 3.7.0 you can't get a Xinerama setup working!!!! If you follow the instructions described below you will have a desktop which is a combination of Dual Head and Clone. The first screen is cloned on the second but you can move the mouse cursor as if it was a Dual Head configuration. Basically you can't setup a Xinerama from fglrxconfig, so you will have to make your own XF86Config or edit the Xinerama XF86Config sample. The instructions are exactly the same as in Dual Head configuration, with the following differences:

You have to set the following option in the "ServerFlags" section: Option "Xinerama" "true"

You have to disable DRI, because DRI and Xinerama can't co-exist. In both Device sections set:

* Option "no_dri" "yes" # disable DRI

If you want to have overlapping screens you can use something like this, in the "ServerLayout" Section:

* Screen "Screen 2" #Resolution 1280 1024
* # Make screens overlap 80 pixels
* Screen "Screen 1" Relative "Screen 2" 1200 0 # Screen 1 is right of Screen 2

13.4.1 Problems

It doesn't work!
You may want to Google +ati +linux +xinerama or something along those lines, because I think I've seen a couple of things written by people who claim to have got it working with more recent version of the drivers - and by this point, I've read more or less every article, message board post, and rant about the ATI drivers that exists on the internet. *g*
I'm still searching up solutions to a problem I'm trying to get rid of, so if I encounter anything relevant to your situation while doing so, I'll post here immediately.

1351 06-18-2004 07:03 AM

Re: GuineaPIG
 
Quote:

Originally posted by carboncopy
Anyhow, i don't have agp_via is because it is build into the kernel. Will I encounter problem?
I'd have to answer this one with a resounding "don't know".
Going by the fact that your Xinerama setup has just screwed up, it sounds like the driver may be working, but if it doesn't check out properly (once you've fixed the Xinerama issue, at least), I'd suggest recompiling with agp_via as a module.


All times are GMT -5. The time now is 06:24 AM.