# startx can't find "screens"

## silent_Walker

I have just successfully emerged and configured my ~/.xinitrc for compiz-fusion.

However after I run the command for startx a black screen appears with a white "_" in the left corner and then flashes back to the CLI.  

I get the following output:

Fatal error: 

no screens found.  

I have a radeon HD 4250. My kernel settings 

Device Drivers ---> 

Generic Driver Options ---> 

(/sbin/hotplug) path to uevent helper 

[] Maintain a devtmpfs filesystem to mount at /dev 

[ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs 

[] Select only drivers that don't need compile-time external firmware 

[] Prevent firmware from being built 

-*- Userspace firmware loading support 

[*] Include in-kernel firmware blobs in kernel binary 

(radeon/R600_rlc.bin radeon/R700_rlc.bin) External firmware blobs to build into the kernel binary 

(/lib/firmware) Firmware blobs root directory 

[ ] Driver Core verbose debug messages 

[ ] Managed device resources verbose debug messages 

Graphics support ---> 

<> /dev/agpgart (AGP Support) ---> 

--- /dev/agpgart (AGP Support) 

<> AMD Opteron/Athlon64 on-CPU GART support 

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

< > SiS chipset support 

< > VIA chipset support 

-*- VGA Arbitration 

(2) Maximum number of GPUs 

[ ] Laptop Hybrid Graphics - GPU switching support 

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

--- Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) 

< > 3dfx Banshee/Voodoo3+ (NEW) 

< > ATI Rage 128 (NEW) 

<*> ATI Radeon 

[*] Enable modesetting on radeon by default - NEW DRIVER 

< > Matrox g200/g400 (NEW) 

< > SiS video cards (NEW) 

< > Via unichrome video cards (NEW) 

< > Savage video cards (NEW) 

< > DRM driver for VMware Virtual GPU (NEW) 

< > Intel GMA500 Stub Driver 

<*> Lowlevel video output switch controls 

<*> Support for frame buffer devices ---> 

--- Support for frame buffer devices 

[*] Enable firmware EDID 

[ ] Framebuffer foreign endianness support ---> 

[*] Enable Video Mode Handling Helpers 

[*] Enable Tile Blitting Support 

*** Frame buffer hardware drivers *** 

< > Cirrus Logic support 

< > Permedia2 support 

< > CyberPro 2000/2010/5000 support 

< > Arc Monochrome LCD board support 

[ ] Asiliant (Chips) 69000 display support 

[ ] IMS Twin Turbo display support 

< > VGA 16-color graphics support 

< > Userspace VESA VGA graphics support 

[ ] VESA VGA graphics support 

< > N411 Apollo/Hecuba devkit support 

< > Hercules mono graphics support 

< > Epson S1D13XXX framebuffer support 

< > nVidia Framebuffer Support 

< > nVidia Riva support 

< > Intel LE80578 (Vermilion) support 

< > Matrox acceleration 

< > ATI Radeon display support 

< > ATI Rage128 display support 

< > ATI Mach64 display support 

< > S3 Trio/Virge support 

< > S3 Savage support 

< > SiS/XGI display support 

< > VIA UniChrome (Pro) and Chrome9 display support 

< > NeoMagic display support 

< > IMG Kyro support 

< > 3Dfx Banshee/Voodoo3/Voodoo5 display support 

< > 3Dfx Voodoo Graphics (sst1) support 

< > VIA VT8623 support 

< > Trident/CyberXXX/CyberBlade support 

< > ARK 2000PV support 

< > Permedia3 support (EXPERIMENTAL) 

< > Fujitsu carmine frame buffer support 

[ ] AMD Geode family framebuffer support (EXPERIMENTAL) 

< > SMSC UFX6000/7000 USB Framebuffer support 

< > Displaylink USB Framebuffer support 

< > Virtual Frame Buffer support (ONLY FOR TESTING!) 

< > E-Ink Metronome/8track controller support 

< > Fujitsu MB862xx GDC support 

< > E-Ink Broadsheet/Epson S1D13521 controller support 

[] Backlight & LCD device support ---> 

--- Backlight & LCD device support 

<> Lowlevel LCD controls 

< > Platform LCD controls 

-*- Lowlevel Backlight controls 

< > Generic (aka Sharp Corgi) Backlight Driver 

< > Frontpath ProGear Backlight Driver 

< > Apple Backlight Driver 

< > Tabletkiosk Sahara Touch-iT Backlight Driver 

< > Backlight Driver for ADP8860/ADP8861/ADP8863 using WLED 

< > Backlight Driver for ADP8870 using WLED 

Display device support ---> 

<*> Display panel/monitor support 

*** Display hardware drivers *** 

Console display driver support ---> 

-*- VGA text console 

[] Enable Scrollback Buffer in System RAM 

(256) Scrollback Buffer Size (in KB) 

-*- Framebuffer Console support 

-*- Map the console to the primary display device 

[ ] Framebuffer Console Rotation 

[ ] Select compiled-in fonts 

[] Bootup logo ---> 

--- Bootup logo 

[ ] Standard black and white Linux logo 

[ ] Standard 16-color Linux logo 

[] Standard 224-color Linux logo

----------

## pidsley

 *silent_Walker wrote:*   

> I have just successfully emerged and configured my ~/.xinitrc for compiz-fusion.

 

Have you been able to run any window manager in X? Did you try the recommended twm, xclock, and xterm to make sure X was working when you built it?

Please emerge wgetpaste and use it to post a link to your /var/log/Xorg.0.log file.

```
emerge wgetpaste

wgetpaste /var/log/Xorg.0.log
```

and then post the link you get from wgetpaste.

If you have a file at ~/.xsession-errors please post a link to that file too.

----------

## silent_Walker

Sorry for the long wait for a reply, forums.gentoo is having blackouts where I am at. 

http://bpaste.net/show/48397/

lines 16-25 and 413-420 are interesting.

----------

## VoidMage

Unrelated, but perhaps important - those devtmpfs options (at least first of them) should be on.

What does 'emerge -1pv libdrm mesa' print ?

----------

## pidsley

 *pidsley wrote:*   

> 
> 
> Have you been able to run any window manager in X? Did you try the recommended twm, xclock, and xterm to make sure X was working when you built it?
> 
> 

 

You're also right that the errors about KMS are interesting. Did you follow the X setup instructions in the Handbook to enable KMS? Does KMS appear to be enabled when you boot?

----------

## silent_Walker

Overlooking the X-org guide I forgot step 2.6 so I fixed that and re-emrged x but still get cannot find screens

----------

## silent_Walker

my new x log

http://bpaste.net/show/48467/

and output of 

'emerge -1pv libdrm mesa'

x11-libs/libdrm/2.4.39 USE="libkms" VIDEO_CARDS=" radeon"

media-libs/mesa-9_pre20120831-r1 USE="classic eql gallium llvm nptl shared-glapi VIDEO_CARDS="radeon"

KMS does start at boot.

----------

## VoidMage

As you've upgraded the xserver, I need to ask: did you rebuild the xorg modules ?

Also, if your udev is recent enough and those devtmpfs kernel options aren't on, many thigs tend to break.

You might want to check dmesg  regarding proper drm initialization (can't help you much there - personally I use radeon as a module, not builtin).

----------

## silent_Walker

I tried Radeon as a module and still get no screens found, however looking in my first log, the ati and radeon module were able to load and so was KMS.  KMS then failed.  In my second log ati, radeon and kms did not load.  Looking at the xorg guide yet again, I found that I have not emerged radeon-ucode and enabled the options, upon   doing that and rebuilding the modules startx works flawlessly.

Thanks VoidMage and pidsley

--edit--

nvm, now  in http://bpaste.net/show/50050

ati is still not being found by startx.

----------

## silent_Walker

Upon booting up the machine, I see a quick line that appears for a second saying "Failed to load firmware: R700_rlc.bin"and I think the next line says disabling GPU.

I was able to try and get this kernel to work with another distro but no dice

----------

## BillWho

silent_Walker,

You might want to try this configuration outline...

https://forums.gentoo.org/viewtopic-p-7101452.html#7101452

----------

## Hu

 *silent_Walker wrote:*   

> Upon booting up the machine, I see a quick line that appears for a second saying "Failed to load firmware: R700_rlc.bin"and I think the next line says disabling GPU.

 If your graphics driver is built in, then it will attempt to load firmware before the filesystem containing the firmware is mounted.  This is a bad behavior, since it means that installing the firmware to the filesystem is insufficient.  You must include the firmware in the initramfs, embed it in the kernel, or arrange for the graphics driver not to initialize until the filesystems are mounted.  Embedding the firmware is the easiest.  It can be done by listing the required files in CONFIG_EXTRA_FIRMWARE.

----------

## silent_Walker

The radeon/R700_rlc.bin would not load because I really needed the R600.  Startx still says no screens but I am now in the process of rebuilding X.

----------

## DirtyHairy

Could you pastebin a dmesg?

----------

## silent_Walker

Here is dmesg - radeon is not detected.

http://bpaste.net/show/50905/

and I rebuilt X and here is the new log - looking over it, my radeon pci is found but it failed to open the DRM. 

http://bpaste.net/show/50842/

----------

## Hu

That dmesg output is very incomplete.  For a fresh boot, you should have quite a bit more before that, and probably a fair bit after it.

Based on that X log, it may be probing the wrong location.  What is the output of lspci -vk ; cat -n /etc/X11/xorg.conf?

----------

## silent_Walker

It says no such file or directory found.

----------

## DirtyHairy

Talking about the dmesg: Hu is right, this as just a fragment at best. Can you doublecheck that this is all dmesg gives you? Also, please pastebin your kernel config. Could you also tell us the output of "cat /proc/fb"?

----------

## NeddySeagoon

silent_Walker,

```
irq 18: nobody cared (try booting with the "irqpoll" option)

Pid: 2914, comm: init Not tainted 3.5.2-gentoo #1

Call Trace:

 <IRQ>  [<ffffffff8105a0bf>] ? __report_bad_irq+0x2c/0xb4

 [<ffffffff8105a33e>] ? note_interrupt+0x166/0x1e8

 [<ffffffff810586d1>] ? handle_irq_event_percpu+0x104/0x11c

 [<ffffffff81058720>] ? handle_irq_event+0x37/0x57

 [<ffffffff8105abf5>] ? handle_fasteoi_irq+0x75/0xaa

 [<ffffffff81003107>] ? handle_irq+0x17/0x1d

 [<ffffffff81003031>] ? do_IRQ+0x45/0xad

 [<ffffffff812e3f27>] ? common_interrupt+0x67/0x67

 <EOI> 
```

Ouch!  Your BIOS is broken.  Add irqpoll to the end of the kernel line in grub.conf

Nothing attached to IRQ 18 works.

You may have other similar errors and not know it, which would possibly stop any video card from working.

Your dmesg post looks like the last screenfull. 

```
emerge wgetpaste 
```

Then do 

```
dmesg | wgetpaste
```

to put the entire output on the web.  Post the web address you get back.

----------

## silent_Walker

 *DirtyHairy wrote:*   

> Talking about the dmesg: Hu is right, this as just a fragment at best. Can you doublecheck that this is all dmesg gives you? Also, please pastebin your kernel config. Could you also tell us the output of "cat /proc/fb"?

 

Yep, after rebooting that is all that dmesg gives me.  

kernel config :

http://bpaste.net/show/51124/

cat /proc/fb :

0 radeondrmfb

----------

## silent_Walker

 *NeddySeagoon wrote:*   

> silent_Walker,
> 
> ```
> irq 18: nobody cared (try booting with the "irqpoll" option)
> 
> ...

 

would not doubt that,  this laptop is 5 years old almost  :Razz: 

I did customize my kernel and took out a lot of stuff that my laptop did not have, so maybe that is why dmesg is short?  A couple more lines were added when I edited in irqpoll, that was all USB stuff though.

----------

## NeddySeagoon

silent_Walker,

```
CONFIG_LOG_BUF_SHIFT=12
```

 is why your dmesg is so short.  Thats only a 4k buffer for dmesg.  2^CONFIG_LOG_BUF_SHIFT.

17 or 18 is a better number. 128k or 256k ... depending on how verbose you have made the kernel.

Its also good to turn on 

```
# CONFIG_PRINTK_TIME is not set
```

to add timestamps to your dmesg.  It allows you to see when things went wrong.

Adding 

```
# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
```

may fix your 	

 *dmesg wrote:*   

> irq 18: nobody cared

 problem.  irqpoll is a hack, not a fix.  It makes the kernel poll for interrupts which defeats the purpose of having an interrup in the first place.

```
CONFIG_FB_FOREIGN_ENDIAN=y

CONFIG_FB_BOTH_ENDIAN=y
```

must be off.

```
CONFIG_FB_RADEON=y
```

must be off.  You get a free framebuffer with the new radeon driver and KMS, which you have selected.

The price for this is that all other frambuffer hardware drivers must be off.  What you have done here is to select two different drivers for the same piece of hardware.  Its harmless to the hardware but you won't like the result, as neither will work.

Fix the above and try again.  You should have a much more informative dmesg this time.

----------

## silent_Walker

 *NeddySeagoon wrote:*   

> silent_Walker,
> 
> ```
> CONFIG_LOG_BUF_SHIFT=12
> ```
> ...

 

I did the fix reroute and now the irq 18 thing came up again.

anyway here is new dmesg

http://bpaste.net/show/51140/

----------

## NeddySeagoon

silent_Walker,

Thats much better - dmesg contains everything now.

```
irq 18: nobody cared (try booting with the "irqpoll" option)
```

means you need to add irqpoll back to the kernel line in grub.conf or everything shown for IRQ 18 in /proc/interrups won't work.

On my system, thats three USB busses and my video card. See my example below.

```
           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       

  0:        141        241        793       3997     111319    3549863   IO-APIC-edge      timer

  1:          0          0          0          0          0          2   IO-APIC-edge      i8042

  8:          0          0          0          0          0         46   IO-APIC-edge      rtc0

  9:          0          0          0          0          0          0   IO-APIC-fasteoi   acpi

 12:          0          0          0          0          0          3   IO-APIC-edge      i8042

 14:          0          0          0         10        641      15566   IO-APIC-edge      pata_atiixp

 15:          0          0          0          0          0          0   IO-APIC-edge      pata_atiixp

 16:          0          0          0          1         46       3575   IO-APIC-fasteoi   ohci_hcd:usb3, ohci_hcd:usb4, snd_hda_intel

 17:          0          0          2          8       1450     166349   IO-APIC-fasteoi   ehci_hcd:usb1

 18:          0          0          2         33       4952     995906   IO-APIC-fasteoi   ohci_hcd:usb5, ohci_hcd:usb6, ohci_hcd:usb7, nvidia  <----

 19:          0          0          1         12       1941     297945   IO-APIC-fasteoi   ehci_hcd:usb2, firewire_ohci

 22:          2          1          9         90       5072     708562   IO-APIC-fasteoi   ahci

 44:          0          0          4         46       2066     243861   PCI-MSI-edge      eth0

NMI:          0          0          0          0          0          0   Non-maskable interrupts

LOC:     984288     858972     893227     883345     918799     471054   Local timer interrupts

SPU:          0          0          0          0          0          0   Spurious interrupts

PMI:          0          0          0          0          0          0   Performance monitoring interrupts

IWI:          0          0          0          0          0          0   IRQ work interrupts

RTR:          0          0          0          0          0          0   APIC ICR read retries

RES:    2297634    1591482    1463256    1339668    1362276    1656958   Rescheduling interrupts

CAL:      30457      33779      32971      32182      31807      25253   Function call interrupts

TLB:          0          0          0          0          0          0   TLB shootdowns

THR:          0          0          0          0          0          0   Threshold APIC interrupts

MCE:          0          0          0          0          0          0   Machine check exceptions

MCP:         55         55         55         55         55         55   Machine check polls
```

From your dmesg, we can see that your Radeon framebuffer started properly.  If its on IRQ 18, you will have problems with it in Xorg.

irqpoll will allow you to sidestep the interrupt issue and continue with Xorg testing.  There may be other fixes for the interrupt issue, which we can come back to.

You choose - but only one at a time.  Xorg or try to solve the IRQ issue.

----------

## silent_Walker

 *NeddySeagoon wrote:*   

> silent_Walker,
> 
> Thats much better - dmesg contains everything now.
> 
> ```
> ...

 

Lets do the IRQ issue

----------

## silent_Walker

```
          CPU0       CPU1       

  0:        617          1   IO-APIC-edge      timer

  1:         24       1451   IO-APIC-edge      i8042

  2:          0          0    XT-PIC-XT-PIC    cascade

 11:          0          0    XT-PIC-XT-PIC    radeon

 12:          1          3   IO-APIC-edge      i8042

 16:          0          2   IO-APIC-fasteoi   ohci_hcd:usb3, ohci_hcd:usb4

 17:          0          0   IO-APIC-fasteoi   ehci_hcd:usb1

 18:          4        228   IO-APIC-fasteoi   ohci_hcd:usb5, ohci_hcd:usb6

 19:          0         15   IO-APIC-fasteoi   ehci_hcd:usb2

 22:         12        828   IO-APIC-fasteoi   ahci

 43:         17        777   PCI-MSI-edge      eth0

NMI:          0          0   Non-maskable interrupts

LOC:    1817005    1816616   Local timer interrupts

SPU:          0          0   Spurious interrupts

PMI:          0          0   Performance monitoring interrupts

IWI:          0          0   IRQ work interrupts

RTR:          0          0   APIC ICR read retries

RES:       5142       4431   Rescheduling interrupts

CAL:          7         21   Function call interrupts

TLB:        522        468   TLB shootdowns

ERR:          0

MIS:          0

```

18 is ohci_hcd:usb5, ohci_hcd:usb6

radeon is irq 11

----------

## NeddySeagoon

silent_Walker,

Thats probably a good choice as I see from your dmesg

```
[drm] Initialized drm 1.1.0 20060810

[drm] radeon defaulting to kernel modesetting.

[drm] radeon kernel modesetting enabled.

radeon 0000:01:05.0: can't find IRQ for PCI INT B; probably buggy MP table
```

so the system can't find an IRQ for your video card anyway.

Read the file /usr/src/linux/Documentation/kernel-parameters.txt  It comes down to some trial and error.  These are all options you can pass to your kernel at boot time.

For testing, edit the kernel line by pressing 'e' at the grub screen.  Try only one at at time. In most cases, several options do not make sense.

```
acpi=noirq

acpi=off

acpi_apic_instance=2

irqfixup

irqpoll 
```

try each of those in order, one at a time.  When the system comes up, check for the IRQ xx and nobody cared in dmesg and the speed of responsiveness of the system.

You should already have tried irqpoll.  If none of those work, it gets harder as you need to try kernel rebuilds but there is not a lot left.

Flashing the BIOS is both risky and may not fix it anyway, so thats very much a last ditch thing to try, even if you can find a newer BIOS.

----------

## silent_Walker

unfortunately none worked.

----------

## NeddySeagoon

silent_Walker,

You have lost 2 USB root hubs then.

This is a safe expreriment to try provided you do not depend on a USB keyboard and mouse for control of your system.

Its also safe if you can log in from another system using ssh to regain control.

Its hardware dependent ... some USB subsystems have Transaction Translation, some don't if you do, you can use the EHCI driver for USB1 devices too.

Turn on

```
  │    <*>   EHCI HCD (USB 2.0) support                                 │ │  

  │ │    [*]   Root Hub Transaction Translators                           │ │  

  │ │    [*]   Improved Transaction Translator scheduling  
```

and turn off 

```
< >   OHCI HCD support 
```

If your USB1 devices still work (keyboards, mice, older webcams ... ) you have Transaction translation.

dmesg will show things like

```
[    2.374831] usb 1-6.1: new low-speed USB device number 3 using ehci_hcd

[    2.566381] usb 1-6.2: new full-speed USB device number 4 using ehci_hcd
```

which is two usb1 devices using the EHCI driver.

This may work around your problem by not using IRQ 18.

It will not solve the missing Radeon IRQ though

----------

## silent_Walker

Configured the kernel and turned of irqpoll rebooted and dmesg does not show irq 18: nobody cared (try booting with the "irqpoll" option)

----------

## NeddySeagoon

silent_Walker,

Thats progress then, as long as your USB 1.0 devices still work.

OK lets try Xorg.  Make sure that /etc/X11/xorg.conf does not exist - rename it if it does, so its not used, then do startx.

Post the /var/log/Xorg.0.log file you get after the startx command.  Its too big for a forums post, so put it on a pastebin.

----------

## silent_Walker

xorg.conf does not exist

Log :

bpaste.net/show/51193

----------

## NeddySeagoon

silent_Walker,

It was all going really well until 

```
[   254.375] drmOpenDevice: node name is /dev/dri/card0

[   254.392] drmOpenByBusid: Searching for BusID pci:0000:01:05.0

[   254.392] drmOpenDevice: node name is /dev/dri/card0

[   254.408] drmOpenByBusid: drmOpenMinor returns -1
```

Does the file /dev/dri/card0 exist?

What are its permissions?

Please post your current kernel .config too.

----------

## silent_Walker

Under the dev directory I do not have a dri directory, however I do have a device file called card0.  It has superuser privliges, I believe. Also all of the other device files are under the dev dir.

current kernel config is here:

bpaste.net/show/51246

----------

## NeddySeagoon

silent_Walker,

Lets see if your /dev/card0 is what Xorg is looking for.  This is a test only, it won't stick over reboots.

Make the dri directory and make it contain a symlink to /dev/card0

```
mkdir /dev/dri

ln -s /dev/card0 /dev/dri/card0
```

If that keeps Xorg happy when you startx, we know the problem but not the fix.

```
ls -l /dev/card0
```

should belong to root and be in the video group.

----------

## silent_Walker

startx does start succesfully  now  :Very Happy:     However it just sits at a black screen with the X cursor and the entire system hangs, the caps and num lock keys wont even turn off also none of the function keys work either.

Here is my latest X log

http://bpaste.net/show/51255/

----------

## silent_Walker

Looked through the forums and found an old thread that depicted the same problem that I am having and it was solved through 

"eselect opengl set ati"

That however did not work, because accorrding to eselect I have no GPU drives loaded besides opengl.

----------

## VoidMage

That 51255 log shows only successful server termination, though the odd thing is that no input devices are getting activated, nor any input drivers are getting loaded.

Is xf86-input-evdev emerged ?

Is udev running ? If so, what does 'udevadm info' print about i.e. your mouse ?

----------

## silent_Walker

 *VoidMage wrote:*   

> That 51255 log shows only successful server termination, though the odd thing is that no input devices are getting activated, nor any input drivers are getting loaded.
> 
> Is xf86-input-evdev emerged ?
> 
> Is udev running ? If so, what does 'udevadm info' print about i.e. your mouse ?

 

I do have xf86-input-evdev emerged and udevadm info says missing option

----------

## VoidMage

 :Rolling Eyes:  'udevadm info --help', 'man udevadm'...

Though chances are the server quits simply cause you aren't running any clients (like i.e. a window manager).

----------

## silent_Walker

 *VoidMage wrote:*   

>  'udevadm info --help', 'man udevadm'...
> 
> Though chances are the server quits simply cause you aren't running any clients (like i.e. a window manager).

 

I do have compiz in my .xinitrc and desktop does display with a cursor but the mouse and keyboard will not work in a X environment.

----------

## NeddySeagoon

silent_Walker,

Move your ~/.xinitrc out of the way for now.

Do

```
emerge -1 twm xterm xclock
```

and run startx with no xorg.conf and no ~/.xinitrc

You should get twm, displaying three xterms and an analogue clock.  This is a standard test of Xorg.

Homework: Why is the -1 in the emerge command above?

----------

## silent_Walker

The -1 in emerge means it will emerge the package as normal but the package will not update.

Without .xinitrc the server just quits.

----------

## NeddySeagoon

silent_Walker,

Correct.  In this instance, the packages will not be added to your world file, (hence will not be updated) and will be removed by emerge --depclean.

Thats good as they are only intended for testing and will be removed in the normal course of system maintainence.

----------

