# How to disable IOMMU support?

## einheitlix

Hi,

I'm using an ATI Radeon 9600 Pro card (AGP 8x) on an AMD64 architecture and trying to get Beryl running here. The proprietary fglrx drivers are running fine and I have finally managed to be able to start Beryl on a Xgl server along with xfce4. However I have found it to be very slow and "experimental" (random crashes etc.), hence I am now trying to get 3D acceleration to work with the opensource drm drivers for Radeon cards, so I can use AIGLX instead of XGL.

I have set VIDEO_CARDS="radeon fglrx" in /etc/make.conf and emerged xorg-server with that.

However, when I start X with the radeon driver, although the modules "radeon" and "drm" (used by radeon) are loaded, I get no direct rendering.

```

malte@ririu ~ $ lsmod

Module                  Size  Used by

radeon                112736  1 

drm                    78760  2 radeon

malte@ririu ~ $ glxinfo | grep direct

direct rendering: No

OpenGL renderer string: Mesa GLX Indirect

```

And indeed, glxgears runs very slowly.

I have read on http://www.gentoo.org/doc/en/ati-faq.xml and also on http://de.gentoo-wiki.com/AMD_64 that, in order to be able to enable agpgart correctly on AMD64 architectures, it might be necessary to disable "IOMMU support" in "Processor types and features". However I do not see this option in "Processor types and features".

When I run

```

ririu linux # grep -i iommu .config

CONFIG_IOMMU=y

# CONFIG_CALGARY_IOMMU is not set

```

then as one can see, IOMMU support is enabled. When I disable it manually and run make oldconfig, it is automatically re-enabled. I guess it is switched on by something else and I cannot disable it, and maybe that's why it doesn't even appear in the menuconfig. Any ideas on how I could disable IOMMU support in my kernel, or at least on how I could make it appear in "Processor types and features"? (that would already get my one step forward)

I have little experience with configuring kernels, so any help would be greatly appreciated  :Smile: 

Thanks,

Malte

----------

## dleverton

Under "General setup", select "Configure standard kernel features (for small systems)" (this will enable an extra submenu, but don't mess with it unless you know what you're doing), then "IOMMU support" will appear under "Processor type and features".

----------

## einheitlix

Thanks a lot! I have successfully disabled IOMMU support. I have also compiled agpgart as a module.

However, hardware acceleration still doesn't work  :Sad:  glxinfo keeps telling me I have no direct rendering.

The Xorg server log says:

 *Quote:*   

> 
> 
> (WW) RADEON(0): [agp] AGP not available
> 
> (EE) RADEON(0): [agp] AGP failed to initialize. Disabling the DRI.
> ...

 

But I'm sure the modules were loaded in the right order.  First I loaded agpgart, then drm, then radeon. Until then dmesg outputs:

 *Quote:*   

> 
> 
> Linux agpgart interface v0.101 (c) Dave Jones
> 
> [drm] Initialized drm 1.0.1 20051102
> ...

 

But when I try to start a X server, dmesg says:

 *Quote:*   

> 
> 
> mtrr: 0xd0000000,0x10000000 overlaps existing 0xd0000000,0x8000000
> 
> mtrr: 0xd0000000,0x10000000 overlaps existing 0xd0000000,0x8000000
> ...

 

Then X starst up fine, except I have no direct rendering. Any ideas why it may not be working? Why could agp failed to initialize, although the modules are loaded in the right order?

----------

## dleverton

 *einheitlix wrote:*   

> 
> 
>  *Quote:*   
> 
> [drm:radeon_cp_init] *ERROR* radeon_cp_init called without lock held
> ...

 

This thread suggests you need to enable and load the specific driver for your AGP chipset - for AMD64, IIRC that's the amd64-agp kernel module.

----------

## einheitlix

Thanks a lot. Upon loading amd64-agp, then agpgart, then drm and finally radeon in that order, DRI was now successfully enabled according to the Xorg server log. Nevertheless, glxinfo still said I had no direct rendering, and when I ran beryl-manager, I got:

 *Quote:*   

> 
> 
> XGL Absent, checking for NVIDIA
> 
> beryl: GLX_SGIX_fbconfig is missing
> ...

 

although GLX_SGIX_fbconfig was loaded as server glx extension according to glxinfo. If anyone else encounters this, the solution is to unmerge ati-drivers. It would seem they conflicted with the radeon drivers (even though the fglrx module wasn't loaded). After unmerging the ati-drivers, glxinfo finally had to admit I got direct rendering up and running  :Smile: 

beryl-manager now works with AIGLX, but I also find it quite slow, maybe even slower than with XGL, although the symptons are a little different. I have yet to find out how I can get it to work faster... but not tonight  :Wink: 

----------

## dleverton

 *einheitlix wrote:*   

> If anyone else encounters this, the solution is to unmerge ati-drivers. It would seem they conflicted with the radeon drivers (even though the fglrx module wasn't loaded). After unmerging the ati-drivers, glxinfo finally had to admit I got direct rendering up and running 

 

For the record, this should be fixable without unmerging anything by doing 

```
eselect opengl set xorg-x11
```

 for the open driver and 

```
eselect opengl set ati
```

 if/when you want to change back to the proprietary driver.  It doesn't really matter, since you're using the open source drivers anyway, but I just thought you might like to know.  :Smile: 

----------

## einheitlix

You're right. I was mislead as this article (http://www.gentoo.org/doc/en/ati-faq.xml) suggested switching to the ati opengl interface whether one decides to use the open source or the proprietary drivers. But of course only to do this when using the ati drivers makes more sense  :Smile: 

----------

