# Video Card Woes! [solved]

## PP133

Hey peeps, it seems that every time I install Gentoo I struggle with the video card settings.  I cannot fully apply my notes from last time because I'm not using an Nvidia card on this laptop.

So here's the rundown.  I'm using an IBM x60 laptop with what I believe is an intel graphics card (not knowing for sure is part of the problem):

```

tungsten pfernandez # lspci | grep -i graphic

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)

```

Below is the video card section of my xorg.conf:

```

Section "Device"

        ### Available Driver options are:-

        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",

        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"

        ### [arg]: arg optional

        #Option     "NoAccel"                   # [<bool>]

        #Option     "SWcursor"                  # [<bool>]

        #Option     "ColorKey"                  # <i>

        #Option     "CacheLines"                # <i>

        #Option     "Dac6Bit"                   # [<bool>]

        #Option     "DRI"                       # [<bool>]

        #Option     "NoDDC"                     # [<bool>]

        #Option     "ShowCache"                 # [<bool>]

        #Option     "XvMCSurfaces"              # <i>

        #Option     "PageFlip"                  # [<bool>]

        Identifier  "Card0"

        Driver      "i810"

        #Driver      "fglrx"

        #Driver      "radeon"

        VendorName  "Intel Corporation"

        BoardName   "Mobile 945GM/GMS/940GML Express Integrated Graphics Controller"

        BusID       "PCI:0:2:0"

EndSection

```

As you may have noticed, I tried a few other drivers thinking that my video card was actually a radeon, but they never worked.

When I run glxinfo, I see that video's not being rendered by the hardware:

```

tungsten / # glxinfo | grep -i direct

direct rendering: No

OpenGL renderer string: Mesa GLX Indirect

```

The i810 driver seems to work, I mean, it gets me into X, but it doesn't seem to be working completely.

So I guess my questions are these:  

Based on the output of lspci, I have an intel graphics card, right?  I usually know what all of my hardware is because I build the PC myself, but since this is a laptop I'm a little in the dark.

If it is an intel card, am I using the correct driver?  If it's not an intel card, can someone tell me what it is?

If I am using the correct driver, why does glxinfo report that video is not being processed by hardware?

Thanks in advance!

----------

## didymos

It's an intel device.  First off, did you set the right kernel DRM options for that chip?

Here's my device section, for the closely related i945G:

```

Section "Device"

        Identifier              "Intel GMA950"

        Driver                  "i810"

        BusID                   "PCI:0:2:0"

        VideoRAM                131072

        Option                   "AccelMethod"               "EXA"

EndSection

```

The AccelMethod can be ignored, but you may want to try setting VideoRam.  I'd recommend at least 65536.  We'd get a better idea of what's going on if you could find any DRI related messages in /var/log/Xorg.0.log.  The xserver and i810 driver versions would be good too.  Lastly, emerge --info.

----------

## PP133

Hey didymos, it seems that you answer all of my gentoo questions  :Smile: 

As for the DRM options...Below are the only two DRM related kernel configs that I have:

```

root@tungsten /usr/src/linux $ grep -i drm .config

CONFIG_DRM=y

CONFIG_DRM_RADEON=y

```

I have the radeon config in there because I was under the impression that I had a radeon chip at first.

I'm going to add the videoram entry to my xorg.conf now and restart X.  I'll be back in a few minutes to post what I find.

Thx!

----------

## PP133

K, I set the videoram in xorg.conf and restarted X.  These are the errors in my Xorg logs:

```

root@tungsten ~ $ tail -200 /var/log/Xorg.0.log | egrep "(EE|WW)"

(WW) I810(0): Bad V_BIOS checksum

(EE) I810(0): [dri] DRIScreenInit failed. Disabling DRI.

(WW) I810(0): Extended BIOS function 0x5f05 failed.

(EE) AIGLX: Screen 0 is not DRI capable

```

I'm oblivious to what this means, please shed some light  :Smile: 

Thx!

----------

## didymos

You need to reconfigure the kernel.  You want these in the "Character Devices" sub-menu:

```

<M>   Intel 440LX/BX/GX, I8xx and E7x05 chipset support

<snip>

<M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)

<snip>

<M>   Intel 830M, 845G, 852GM, 855GM, 865G 

< >     i830 driver

<M>     i915 driver 

```

It says i915, and the help in menuconfig doesn't mention it, but it actually supports the newer stuff like i945, i945GM, etc..  You can ditch the radeon module, but it doesn't really matter.  It just wastes a little disk space.

----------

## PP133

K, I just made the changes and booted to the new kernel...now what?

```

root@tungsten ~ $ lsmod 

Module                  Size  Used by

i915                   23040  1 

drm                    67860  2 i915

truecrypt             151940  0 

intel_agp              23964  1

```

```

root@tungsten ~ $ glxinfo | grep -i direct

direct rendering: No

OpenGL renderer string: Mesa GLX Indirect

```

----------

## PP133

Looking back at the notes I made for myself the last time I installed Gentoo, I found these towards the bottom:

11.  Run eselect so that X uses the nvidia glx libraries

Baleeted linux # eselect opengl set nvidia

Switching to nvidia OpenGL interface... done

12.  Add the user to the video group so that the user has access to the nvidia device files

Baleeted linux # gpasswd -a pfernandez video

Adding user pfernandez to group video

Is 11 applicable at all to Intel graphics cards?  Something similar?

Do I have to do something like 12?

----------

## didymos

Make sure you have this VIDEO_CARDS="i810".  Now do an "emerge -DNva world".  Mesa and some other stuff will need to rebuilt to use that card.   If that's been done, then try the eselect thing.  You should see "xorg-x11" listed.  Even if it's selected, set it again.  You also want to add the user to the video group, yes.

----------

## PP133

 *didymos wrote:*   

> Make sure you have this VIDEO_CARDS="i810".  Now do an "emerge -DNva world".  Mesa and some other stuff will need to rebuilt to use that card.   If that's been done, then try the eselect thing.  You should see "xorg-x11" listed.  Even if it's selected, set it again.  You also want to add the user to the video group, yes.

 

Where do I need to have that video_cards line?

----------

## didymos

Sorry, accidentally deleted part of that. I meant to have:

Make sure you have this line in /etc/make.conf: VIDEO_CARDS="i810"

----------

## PP133

I just started the emerge.  Is there a way to pause the emerge in case I need to head home and close up the laptop?

----------

## didymos

Well, you can just kill it with CTRL-C, then do emerge --resume.  The disadvantage of that is that any package emerging when you kill it will start over when you resume.  But, anything actually emerged by then doesn't have to be redone.  Also, since you're emerging world, you can just do that again.  Portage will automatically figure out which packages still need updating.  If you've got suspend/resume working well, then you can probably CTRL-Z the emerge, then let the laptop sleep, pop it open later, and do "fg" to pick up at the exact same point.

----------

## PP133

 *didymos wrote:*   

> Make sure you have this VIDEO_CARDS="i810".  Now do an "emerge -DNva world".  Mesa and some other stuff will need to rebuilt to use that card.   If that's been done, then try the eselect thing.  You should see "xorg-x11" listed.  Even if it's selected, set it again.  You also want to add the user to the video group, yes.

 

I finished doing the emerge world.  You said to do the eselect thing, but how should I change it since I'm not using nvidia?

```

eselect opengl set nvidia

```

----------

## didymos

Is "xorg-x11" listed by "eselect opengl list"?  If so, then do "eselect opengl set xorg-x11".

----------

## PP133

 *didymos wrote:*   

> Is "xorg-x11" listed by "eselect opengl list"?  If so, then do "eselect opengl set xorg-x11".

 

```

root@tungsten ~ # eselect opengl list

Available OpenGL implementations:

  [1]   ati

  [2]   xorg-x11 *

root@tungsten ~ # eselect opengl set xorg-x11

Switching to xorg-x11 OpenGL interface... done

```

----------

## PP133

Hrmm, I was thinking that that might've been the fix, but I restarted X and I'm still not getting hardward support from the video card.

----------

## didymos

OK, exit X if you're in it, then delete the file /var/log/Xorg.0.log, then restart X.  Look in  /var/log/Xorg.0.log, which will have been recreated, for anything with "DRM", "DRI", or "direct rendering" in it, and post it here, or just post the whole log in a pastebin somewhere.  Do post all of xorg.conf here.  I want to double-check it.

----------

## PP133

 *didymos wrote:*   

> OK, exit X if you're in it, then delete the file /var/log/Xorg.0.log, then restart X.  Look in  /var/log/Xorg.0.log, which will have been recreated, for anything with "DRM", "DRI", or "direct rendering" in it, and post it here, or just post the whole log in a pastebin somewhere.  Do post all of xorg.conf here.  I want to double-check it.

 

Here ya go:

http://rafb.net/p/rH3Ga132.html

----------

## didymos

 *Quote:*   

> WW) intel(0): Not enough video memory.  Disabling DRI.

 

OK, for VideoRAM try 98304, then 131072 if that doesn't work.  I thought 64MiB was sufficient, guess not.

----------

## PP133

 *didymos wrote:*   

>  *Quote:*   WW) intel(0): Not enough video memory.  Disabling DRI. 
> 
> OK, for VideoRAM try 98304, then 131072 if that doesn't work.  I thought 64MiB was sufficient, guess not.

 

K, here ya go...btw, thx for spending so much time troubleshooting this with me!

WW errors when set to 98304:

```

(WW) The directory "/usr/share/fonts/TTF/" does not exist.

(WW) The directory "/usr/share/fonts/OTF" does not exist.

(WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)

(WW) intel: No matching Device section for instance (BusID PCI:0:2:1) found

(WW) intel(0): Bad V_BIOS checksum

(WW) intel(0): xf86AllocateGARTMemory: allocation of 10 pages failed

(WW) intel(0): Failed to allocate texture space.

(WW) intel(0): xf86AllocateGARTMemory: allocation of 10 pages failed

(WW) AIGLX: 3D driver claims to not support visual 0x23

(WW) AIGLX: 3D driver claims to not support visual 0x24

(WW) AIGLX: 3D driver claims to not support visual 0x25

(WW) AIGLX: 3D driver claims to not support visual 0x26

(WW) AIGLX: 3D driver claims to not support visual 0x27

(WW) AIGLX: 3D driver claims to not support visual 0x28

(WW) AIGLX: 3D driver claims to not support visual 0x29

(WW) AIGLX: 3D driver claims to not support visual 0x2a

(WW) AIGLX: 3D driver claims to not support visual 0x2b

(WW) AIGLX: 3D driver claims to not support visual 0x2c

(WW) AIGLX: 3D driver claims to not support visual 0x2d

(WW) AIGLX: 3D driver claims to not support visual 0x2e

(WW) AIGLX: 3D driver claims to not support visual 0x2f

(WW) AIGLX: 3D driver claims to not support visual 0x30

(WW) AIGLX: 3D driver claims to not support visual 0x31

(WW) AIGLX: 3D driver claims to not support visual 0x32

```

WW errors when set to 131072:

```

(WW) The directory "/usr/share/fonts/TTF/" does not exist.

(WW) The directory "/usr/share/fonts/OTF" does not exist.

(WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)

(WW) intel: No matching Device section for instance (BusID PCI:0:2:1) found

(WW) intel(0): Bad V_BIOS checksum

(WW) intel(0): xf86AllocateGARTMemory: allocation of 10 pages failed

(WW) AIGLX: 3D driver claims to not support visual 0x23

(WW) AIGLX: 3D driver claims to not support visual 0x24

(WW) AIGLX: 3D driver claims to not support visual 0x25

(WW) AIGLX: 3D driver claims to not support visual 0x26

(WW) AIGLX: 3D driver claims to not support visual 0x27

(WW) AIGLX: 3D driver claims to not support visual 0x28

(WW) AIGLX: 3D driver claims to not support visual 0x29

(WW) AIGLX: 3D driver claims to not support visual 0x2a

(WW) AIGLX: 3D driver claims to not support visual 0x2b

(WW) AIGLX: 3D driver claims to not support visual 0x2c

(WW) AIGLX: 3D driver claims to not support visual 0x2d

(WW) AIGLX: 3D driver claims to not support visual 0x2e

(WW) AIGLX: 3D driver claims to not support visual 0x2f

(WW) AIGLX: 3D driver claims to not support visual 0x30

(WW) AIGLX: 3D driver claims to not support visual 0x31

(WW) AIGLX: 3D driver claims to not support visual 0x32

```

----------

## didymos

Yeah, those are going to appear pretty much no matter what. X will try allocating different areas of memory and eventually find some (hopefully). What matters is whether or not a line like this appears:

```

(II) intel(0): direct rendering: Enabled

```

The other warnings can be ignored as well. Does glxinfo show direct rendering being on now?

----------

## PP133

Looks good, then:

```

root@tungsten ~ $ grep -i render /var/log/Xorg.0.log

        X.Org Font Renderer : 0.5

        Module class: X.Org Font Renderer

        ABI class: X.Org Font Renderer, version 0.5

        Module class: X.Org Font Renderer

        ABI class: X.Org Font Renderer, version 0.5

(II) intel(0): direct rendering: Enabled

(II) Initializing built-in extension RENDER

```

But why does this still show no direct rendering?

```

root@tungsten ~ $ glxinfo | grep -i direct

libGL error: open DRM failed (Operation not permitted)

libGL error: reverting to (slow) indirect rendering

direct rendering: No

```

----------

## manny15

I have the same problem. I can't seem to get DRI to work with x11-drivers/xf86-video-i810-2.1.0. Xorg reports DRI is enabled but glxinfo says it's not. Could it be due to permissions? I'm in the video group but /dev/dri/card0 is crw-rw---- 1 root root.

----------

## didymos

That's not what it should be:

```

#ls -l /dev/dri

total 0

crw-rw-rw- 1 root video 226, 0 2007-07-10 17:57 card0

```

although, I'm not sure why my system has it r/w for anyone.

[edit] Nevermind.  I forgot the DRI section at the end of xorg.conf sets that up.  Make sure you have this:

```

Section "DRI"

        Group                   "video"

        Mode                    0660

EndSection

```

or this:

```

Section "DRI"

        Mode                    0666

EndSection

```

----------

## PP133

So should I change the permissions on mine to 666?

```

root@tungsten ~/audio # ls -l /dev/dri

total 0

crw-rw---- 1 root root 226, 0 Jul 13 15:06 card0

```

Here's what my current DRI section looks like:

```

Section "DRI"

        Group        0

EndSection

```

----------

## didymos

Yeah, that's setting it so only root can use it (unless you've added someone to the root group, which isn't recommended).  Like I said, either use:

```

Section "DRI"

        Group                   "video"

        Mode                    0660

EndSection 

```

or 

```

Section "DRI"

        Mode                    0666

EndSection 

```

I had 666, and switched to the top version just after last posting to this thread.  Both work.

----------

## PP133

I'm just waiting for an emerge to finish and then I'll restart X.  In the mean-time, I noticed that this is at the very bottom of my xorg.conf:

```

Section "Extensions"

        Option "Composite" "Disable"  #make DRI work with fglrx.

EndSection

```

Should I remove that?

----------

## PP133

K, I made those changes to my xorg.conf and rebooted

```

root@tungsten ~ # cat /var/log/Xorg.0.log | grep -i render

        X.Org Font Renderer : 0.5

        Module class: X.Org Font Renderer

        ABI class: X.Org Font Renderer, version 0.5

        Module class: X.Org Font Renderer

        ABI class: X.Org Font Renderer, version 0.5

(II) intel(0): direct rendering: Enabled

(II) Initializing built-in extension RENDER

```

Still indirectly rendered, tho  :Sad: 

```

root@tungsten ~ # glxinfo | grep -i direct

libGL error: open DRM failed (Operation not permitted)

libGL error: reverting to (slow) indirect rendering

direct rendering: No

```

----------

## manny15

I placed the following in /etc/X11/xorg.conf but it didn't work:

```

Section "DRI"

        Mode 0660

        Group "video"

EndSection

```

What does work is changing the group on /dev/dri/card0 to video. udev contains the proper rule, so I'm not sure what's causing the problem. At least I do know it's a permission issue.

----------

## PP133

 *manny15 wrote:*   

> I placed the following in /etc/X11/xorg.conf but it didn't work:
> 
> ```
> 
> Section "DRI"
> ...

 

When you say "What does work", do you mean that your problem is fixed by the permission change?

----------

## manny15

 *PP133 wrote:*   

>  *manny15 wrote:*   I placed the following in /etc/X11/xorg.conf but it didn't work:
> 
> ```
> 
> Section "DRI"
> ...

 

Yes! Changing the group to from root to video worked for me. In an effort to find the source of the problem I tried an older version of the i810 driver and udev. Using an older i810 driver did not fix the problem, but I'm not sure if it's udev because I somehow broke it when I downgraded. I had to restore from a backup.

----------

## PP133

Did you make those DRI changes to your xorg.conf?  Also, what is udev?

----------

## manny15

I've tried it with and without DRI settings in xorg.conf. udev is responsible for creating the device files in /dev. Because it broke when I downgraded (I think I messed up the config file) it failed to create the device files needed to run properly (my wireless NIC and sound card failed).

----------

## PP133

 *manny15 wrote:*   

> I've tried it with and without DRI settings in xorg.conf. udev is responsible for creating the device files in /dev. Because it broke when I downgraded (I think I messed up the config file) it failed to create the device files needed to run properly (my wireless NIC and sound card failed).

 

So did it not work with the DRI settings?  Because I changed the permissions on that file and added the DRI settings, but it's still not working.  I'm wondering if I should remove those DRI settings but keep the permission change.

----------

## PP133

Ha!  I finally got it working.  It was the permissions.  I set that card0 file so that everyone had rw access, but /dev/dri itself was restricting my user from using it.  I figured it out after I su'ed to root and ran glxinfo | grep dri and saw that it worked.

Thx for all the help, guys!

----------

