# Radeon no DRI?

## The_Great_Sephiroth

I am having a problem with yet ANOTHER ATI-based system. Every time I try to put Gentoo onto a system with an ATI/AMD card in it, X fails to start and SDDM crashes with it being unable to open "/dev/dri/card0". I have never solved this and always wind up putting Windows 7 on the systems, which works flawlessly. What do I need to check to get this working? I have the kernel stuff selected including DRI and no framebuffer stuff. This always just works with Intel and nVidia, but ATI must need something extra.

I am not in front of the system in question and cannot post the config at this time. If you can tell me what needs to be selected in the kernel for this thing to show up I will be more than happy to do so. I will say that I used the Gentoo Radeon Guide, but it has not solved this issue. I did include the ucode into my kernel, but the system gets an 80x25 console with or without that ucode, and it doesn't complain about the ucode missing if it isn't built into the kernel, so I do not believe that is the issue.

The card in question is an AMD 6520G. Again, 80x25 works, but SDDM crashes and the X log shows two lines where it's unable to open "/dev/dri/card0". SDDM is in the video group (not sure if it needs to be for ATI, but it does for nVidia).

----------

## Tony0945

Maybe this: https://forums.gentoo.org/viewtopic-p-7940068.html?sid=04d52165cc5c383b34121fe90c490a47

I see my bapste has expired. i could pastebin it again if you want, but if you read the thread, you will see that it was a permissions problem, not a kernel problem.

----------

## Ant P.

dmesg would help...

----------

## The_Great_Sephiroth

Ant, I do not have a way to get you dmesg output from the machine, it is incomplete. There are no errors or warnings in dmesg however, only in X.org.log, and then only the inability to open /dev/dri/card0. I did not see the device listed, so permissions are a moot point, but I will check again soon.

*UPDATE*

I was right, /dev/dri does not exist.

----------

## Tony0945

 *The_Great_Sephiroth wrote:*   

> I was right, /dev/dri does not exist.

 

Which are you running: udev, eudev. mdev or a fixed /dev?Last edited by Tony0945 on Mon Aug 15, 2016 5:49 pm; edited 1 time in total

----------

## The_Great_Sephiroth

I run eudev on all of my Gentoo systems.

----------

## Tony0945

Here is my config for the A6-7600 APU system:  http://bpaste.net/show/2e85add69cbd

Here is my config for an older system with radeon on mobo : http://bpaste.net/show/d235e5d64e67

Hope they help.

----------

## Tony0945

I think you want "Direct Rendering Manager", CONFIG_DRM

Symbol: DRM [=y]                                                                                                                                                                      x

  x Type  : tristate                                                                                                                                                                      x

  x Prompt: Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)                                                                                                               x

  x   Location:                                                                                                                                                                           x

  x     -> Device Drivers                                                                                                                                                                 x

  x (1)   -> Graphics support

----------

## NeddySeagoon

The_Great_Sephiroth,

You have a bit missing from your kernel.

It will be something under Direct Rendering Manager

----------

## The_Great_Sephiroth

I have DRI selected, it was the first thing that I checked. I will go through the options again and report back. Thank you all for your help thus far.

*UPDATE*

I have DRM selected as built-in in my kernel, as well as "ATI Radeon" and the sub-option "Always enable userptr support". I also have the legacy fbdev selected under the DRM menu. It is the only option under DRM. All of these are selected as built-in.

----------

## Tony0945

With eudev if you modprobe radeon, it should produce /dev/dri.

You should see this 9with different date/times):

```
gentoo linux # ls -l /dev/dri

total 0

crw-rw---- 1 root video 226,   0 Aug 12 11:50 card0

crw-rw---- 1 root video 226,  64 Aug 12 11:50 controlD64

crw-rw---- 1 root video 226, 128 Aug 12 11:50 renderD128

```

----------

## The_Great_Sephiroth

Radeon is built into my kernel, so I should not even be able to modprobe it. I always build the permanent hardware drivers into my kernels. This system is a laptop, so the video is permanent. I will try it this afternoon anyway, but I do not know if it will do anything and I expect it to error out.

----------

## Tony0945

Try it as a module. Possibly, eudev will not detect it as a built-in. Add it to /etc/conf.d/modules to be sure it's loaded.

i.e.

```
# ohci_pci and ehci_pci needed for usb mouse

modules="r8168 ath9k radeon snd_hda_intel"

modules="${modules} xhci_hcd ahci ohci-pci ehci-pci"

modules="${modules} pata_atiixp k10temp fam15h_power"

```

----------

## chithanh

Workaround for sddm is putting the sddm user in the video group. Similar things have been done for the gdm user in the past.

Of course this negates part of the reason why there is a separate user for sddm but who cares...

If radeon is built into your kernel, then firmware needs to be built-in too: https://wiki.gentoo.org/wiki/Radeon#Firmware

About normal users, they don't need to be in the video group as long as your kernel has CONFIG_TMPFS_POSIX_ACL=y

----------

## The_Great_Sephiroth

SDDM is in the video group. After emerging it I always do that. My users are also normally in the video group. Oh and yes, I did build the firmware into the kernel. I am not getting firmware missing messages, just no /dev/dri being created. I am going to try modprobing in a bit when I get to the system, but again, I seem to recall modprobe not working on things built into the kernel.

*UPDATE*

I did as asked. Running "modprobe radeon" does nothing. No error because it is already loaded (part of the kernel) and no /dev/dri is created. Again, I have never had ATI/AMD cards work in Gentoo, not sure why.

Let me ask this first. Will I obtain better performance if I use the proprietary driver? If so, what is the bare minimum that I need to get the system up?

----------

## Tony0945

Again, build it as a module. Look at the two kernel configs I posted. Those are both working configs using the in-kernel driver, one from February 2010, the from a recent mobo purchased last month.  

Radeon has given me much less trouble than nouveau.

----------

## chithanh

Also check what is the content of /proc/fb (should be radeondrmfb when radeon KMS is active).

----------

## The_Great_Sephiroth

I suspect radeon would give you lass trouble than nouveau, since nouveau is for nVidia cards. Also, why can't we build radeon into the kernel? I will rebuild as a module, but I prefer for this stuff to be in-kernel.

----------

## Tony0945

 *The_Great_Sephiroth wrote:*   

> I suspect radeon would give you lass trouble than nouveau, since nouveau is for nVidia cards. 

 

I have two systems wirh ATI cards/mobo/GPU and two systems with nvidia. One of them has a radeon on-mobo chip that is flawless in Gentoo but blue screens on Windows, so I bought an nvidia PCIe card to satisfy Windows.

----------

## The_Great_Sephiroth

Oh OK. I despise nouveau personally and have had trouble with it also, but I use the official nVidia drivers on those systems and have not had an issue since. This is also why I asked about using the official ATI/AMD drivers. Performance is a factor here, so if they're better suited for the job, what would I need in my kernel?

----------

## Tony0945

 *The_Great_Sephiroth wrote:*   

> Oh OK. I despise nouveau personally and have had trouble with it also, but I use the official nVidia drivers on those systems and have not had an issue since. 

 

This is off your main thread but I had to switch from nvidia-drivers to nouveau when my systems became officially too old to support.

----------

## The_Great_Sephiroth

I tried the radeon driver as a module. Same thing. No /dev/dri and nothing in /proc/fb at all. I then tried with radeon as a module AND the radeon framebuffer device as a module. No dice. I also tried modprobing the radeon driver, still no /dev/dri. I honestly believe it is broken somehow. I have NEVER had the slightest issue with Intel or nVidia, but I have yet to get an AMD/ATI card running, for this exact reason.

----------

## Tony0945

What does eudev log when you modprobe radeon? Be sure you have error logging enabled in eudev?

----------

## NeddySeagoon

The_Great_Sephiroth,

Radeon does work both modular and built in.  My media player uses Radeon as built in. 

The complication is building into the kernel the right firmware for your card, hence the advice to make it work as a module first.

dmesg will tell you the firmware files needed - there may be several.

The kernel Radeon driver gives you radeonfb for free.  All the frambuffer hardware drivers in the kernel must be off, especially ATI/AMD ones.

If they load they grab the hardware, the Radeon driver you need will not work 

The media player is off just now so I can only get the kernel config file from when it used to PXE boot.

That's a few years ago now.  To keep it silent, (no moving parts) it now has an SSD.

----------

## The_Great_Sephiroth

Sorry for the slow response. I have been sick since Friday. Nothing major, but it has had me not wanting to even see a computer. Anyway, here is my update.

There are no firmware-related messages in dmesg or /var/log/messages, leading me to believe that there is no error as far as that goes. As for eudev, it is at default emerge settings. How do I enable more logging from it? Oh, and I removed the FB devices from the kernel. I was merely testing it.

*UPDATE*

On a whim I checked the logs for SDDM stuff and found a segfault. This happens every time SDDM is started.

Segfault Image

----------

## The_Great_Sephiroth

Anybody? I enabled debug in eudev and still get no firmware errors. I believe my firmware is good. I installed the 'linux-firmware' package and despite not using an initramfs, also included the recommended firmware blobs for my chipset into the kernel itself. I do not believe this is a firmware issue. In fact the ONLY error I am getting from boot is the SDDM segfault. The thing is, now that I have radeon as a module and not built into my kernel, I do not see it with lsmod, even after modprobing it, which also gives no errors. I truly believe it is broken due to this, but have not had issues with anything EXCEPT Radeon cards, so I am hesitant to jump onboard that boat right away.

----------

## NeddySeagoon

The_Great_Sephiroth,

That modprobe did not report any errors is encouraging.

did you look in dmesg after the modprobe?

It's not an error to modprobe something already installed.

That radeon is not listed in lsmod suggests two things,

a) it loaded, looked around and found nothing to do, so it unloaded again.

b) its already built into the kernel.

If you have a module both built in and as a loadable module, there are several causes.

You messed up the kernel install, so you have a set of modules that do not match the kernel (easy done)

Time took a step back on your system, so the kernel make step did the wrong thing.

If you have /proc/config.gz, thats the .config for the running kernel, what does it say about radeon?

If not, look at the kernel build time in 

```
uname -a
```

 is it what you expect?

-- edit --

Firmware loading is done by the kernel.  Even if all your firmware is loaded as a result of kernel modules loading, you still need firmware loading support it the kernel.

udev dropped userspace firmware loading a long time ago, with much gnashing of teeth from users left with no fimware loader at all.

----------

## The_Great_Sephiroth

I fixed it. I am now openly stating that something is very wrong with the radeon module in the kernel. I disabled DRM, the radeon module, and AMD AGPGART, rebuilt the kernel, rebooted, emerged ati-drivers, and all is golden. From now on this will be my approach for ATI/AMD systems. After all, I want full hardware acceleration anyway, so why not use the official driver?

As to your last response, Neddy, I have the required firmware built into the kernel. I did not build it as a module and a built-in. I tried it as a module, and then separately as built-in. Neither worked, no errors were ever logged, and even as a module it would not load. I checked dmesg, /var/log/messages, and /var/log/X.org.log for messages. From a logging standpoint, everything was fine. It just didn't work. Using the official driver appears to have fixed everything. I Will monitor it for a day or two and report back, but for me the fix was using the official driver. The official driver did require the following to be done.

Disable the kernel radeon driver completely

Disable DRM in the kernel

Disable AMD AGPGART in the kernel

Now it is good.

----------

## asturm

 *The_Great_Sephiroth wrote:*   

> After all, I want full hardware acceleration anyway, so why not use the official driver?

 

Because it is effectively abandoned. fglrx will not be updated anymore to receive latest X server or kernel support. amdgpu is the way forward but I can't say much about it at this point. Maybe when AMD Zen hits the market.

radeon gives you full hardware acceleration as well.

----------

## The_Great_Sephiroth

OK, but it works for my card. The radeon driver was not working nor has it ever seemed to work. However, I upgraded today and have a new issue. SDDM doesn't even come up and I get a shell login. The log says it cannot find the module "ati". The module is "fglrx". I do not have an X configuration file and I have VIDEO_CARDS set to "fglrx". Why is it doing this?

----------

## chithanh

You need to create a configuration file snippet, for example

```
Section "Device"

    Identifier "fglrx card"

    Driver "fglrx"

EndSection
```

Alternatively you can use the aticonfig tool to generate an xorg.conf

----------

## asturm

There is a wiki for that as well, btw: https://wiki.gentoo.org/wiki/Fglrx#Configuration

----------

## The_Great_Sephiroth

Yeah I figured that out. I just made the section for the driver and all is good again. Now I get to install Windows 7 into a virtualbox and the laptop is golden. Thanks to everybody who helped!

----------

## The_Great_Sephiroth

New problem. I have no shell. If I use CTRL+ALT+F1 I get a blank screen. How can I fix that?

----------

## Tony0945

 *The_Great_Sephiroth wrote:*   

> New problem. I have no shell. If I use CTRL+ALT+F1 I get a blank screen. How can I fix that?

 

You should start a new thread. You can include a link to this one.

----------

## Ant P.

 *The_Great_Sephiroth wrote:*   

> New problem. I have no shell. If I use CTRL+ALT+F1 I get a blank screen. How can I fix that?

 

fglrx does not have framebuffer/VT support, so you can't.

----------

## The_Great_Sephiroth

That explains that. I am going to backup my kernel configuration, make.conf, and a few other settings, zero the disk, and try again with the radeon driver, from scratch. After the thousandth rebuild I do not have faith that there isn't something left over on the system giving me grief.

----------

