# Thinkpad T420 Cannot startx

## tianqingfei

Hi, all

I use nvidia-config to generate my xorg.conf file,

and I have disabled dri and dri2.

Then, there is following errors:

No devices found.

I have checked my PCI device, it seems using PCI:*(0:0:2:0)

　　　　　　　　　　　　　　　　and there is the other PCI (0:1:0:0)

Is that reason?  What should I do?

----------

## Gusar

You highly likely have an Optimus machine. Which means your main graphic card will be intel. So install xf86-video-intel and remove xorg.conf. Then, for the Nvidia card, inform yourself about Bumblebee.

----------

## tianqingfei

 *Gusar wrote:*   

> You highly likely have an Optimus machine. Which means your main graphic card will be intel. So install xf86-video-intel and remove xorg.conf. Then, for the Nvidia card, inform yourself about Bumblebee.

 

Thank you firstly. But it seems not work.

I have done following steps:

emerge -C nvidia-drivers

emerge  xf86-video-intel

Xorg -configure

and after using the new generated xorg.conf.new, the display turned to black.

I use ctrl_alt_backspace, no response

I use Alt_F1-7 and ctrl_alt_F1-7, no response.

----------

## DirtyHairy

Have you activated the intel framebuffer driver with KMS in the kernel config? I am pretty sure the X11 driver won't work without it on sandybridge. Also, you should try without a xorg.conf first and only create one if you need to change the default for some items (keyboard and touchpad are good candidates).

----------

## Gusar

Don't *ever* use Xorg -configure. Also, don't *ever* use nvidia-xconfig. Instead, do what DirtyHairy says: Make sure KMS is activated in the kernel and remove xorg.conf. If it still doesn't work, use pastebin to show us your /var/log/Xorg.0.log

----------

## DirtyHairy

For the record, what you are looking for in your kernel configuration is

```
CONFIG_DRM_I915=y

CONFIG_DRM_I915_KMS=y
```

----------

## tianqingfei

 *DirtyHairy wrote:*   

> For the record, what you are looking for in your kernel configuration is
> 
> ```
> CONFIG_DRM_I915=y
> 
> ...

 

I'm pretty sure the configure file is right: I have set the two flags.

I think I have to rebuild the whole system.

Last time, I used wrong set in bios: Optimus. 

This time, I will set to use intel graphic card only.

Hope this time could work.

Thank you

----------

## DirtyHairy

I don't want to keep you from doing it, but rebuilding your system is a unnecessary waste of time and will not fix your problem  :Wink:  Does the intel KMS driver work, i.e., do you get the high-res framebuffer? What does 

```
cat /proc/fb
```

 return?

----------

## Gusar

 *tianqingfei wrote:*   

> Last time, I used wrong set in bios: Optimus. 
> 
> This time, I will set to use intel graphic card only.

 

You have a bios setting? Can you set it to Nvidia, or is it only Intel/Optimus?

----------

## tianqingfei

To DirtyHairy,

I can see a graphic login UI, but my keyboard and mouse( touch pad) doesn't work.

So,

I will have a try again: Using nvidia graphic card only, setting in bios

emerge -C gnome-light

make sure setting in make.conf

VIDEO_CARDS="nvidia"

and

emerge --update --deep --newuse world

emerge gnome

To Gusar

Bios setting has 

Nvidia,

Intel

Optimus

Three choice. I have set it to Nvidia.

----------

## Gusar

 *tianqingfei wrote:*   

> To Gusar
> 
> Bios setting has 
> 
> Nvidia,
> ...

 

Lucky you. A lot of people wished they had such options, but they don't.

Anyway, as for your mouse and keyboard trouble... Do you have evdev support in your kernel? And is xf86-input-evdev installed?

----------

## DirtyHairy

The mouse and keyboard problem is unrelated to video. Can you post your Xorg.0.log?

----------

## tianqingfei

 *DirtyHairy wrote:*   

> The mouse and keyboard problem is unrelated to video. Can you post your Xorg.0.log?

 

I think it's a impossible mission  :Smile: 

Whenever I startx or reboot, the keyboard and mouse always don't work. So I have to switch the video card in bios to the other card, then I can log in console.

Then the xrog.0.log record the error no driver.

It would be useless.

----------

## tianqingfei

And I find some interesting thing that 

1 the right Alt button could not be used.

2 the windows button could be used to switch between different console but the ctrl_alt_f1--7 doesn't work as I expected.

I don't know why.

----------

## Jaglover

 *Quote:*   

> I think it's a impossible mission

 

Start SSH server and log on remotely.

----------

## DirtyHairy

Are you saying that, even on a plain terminal, using ctrl-alt-fx does not switch VTs? If you can neither log on remotely not switch VTs once X has started, as a last resort you can restart and then, when init starts, press i to activate interactive boot and skip over the xdm service. If you have disabled interactive boot, you can reenable it in /etc/rc.

----------

## tianqingfei

And do you ever mean that I do not need to generate xorg.conf to startx?

If I installed Xorg and gnome, and configure them as gentoo.org said. ( Do not generate xorg.config) 

I could startx directly?

----------

## Jaglover

It depends on driver used, with nvidia proprietary driver you need minimal xorg.conf. With nouveau or intel you do not need it. Please note, kernel configuration is different when you use blob.

----------

## tianqingfei

Yesterday night, I 

1 set bois using nvidia card only

2 emerge nvidia-drivers

4 modify make.conf: VIDEO_CARDS="nouveau"

5 emerge -C gnome-light

6 emerge gnome

When I login, system said 

cannot load dri, vesa and fbdev modules.

It seems I didn't emerge nvidia-drivers.

When I use the xorg.conf.new which is generated by Xorg -configure,

my laptop splashed a nvidia logo and then change to black screen.

No response to keyboard and mouse.

I have check the xorg.conf.new before apply it. 

It configured with nvidia card driver. Keyboard and mouse driver use the default.

Did I need to rebuild xorg?

How could I do?

And I don't know how to configure ssh server, anyone could help me to give me a guide doc or a webpage about that?

----------

## Jaglover

2. OK, but you should have set VIDEO_CARDS="nvidia" and the driver would have been installed for you. If you emerge without --oneshot the package will be recorded in world file as an user application, which is not recommended nor desirable.

3. See (2)

4. You set nouveau if you want nouveau friver and nvidia if you want nVidia proprietary drivers.

 *Quote:*   

> cannot load dri, vesa and fbdev modules

 

This is normal, nvidia driver has it's own dri. You do not need vesa and fbdev to run nvidia.

It is likely you haven't configured your input devices properly, black screen is normal if Xorg is running but no application or DE or WM is started.

As of SSH just emerge -av ssh (if it's not installed already), then /etc/init.d/sshd start. After that you should be able to log on from another computer using your username and su to root if needed.

----------

## chithanh

X -configure never works with KMS, don't use it. For Intel you don't need xorg.conf anyway. Just start gdm or whatever login manager you want to use.

Most Lenovo notebooks have a BIOS option to turn off Optimus and use only discrete graphics.

----------

## DirtyHairy

Also, you can add the SSH server to your default runlevel by doing "eselect rc add sshd default". This way, it will start up every time you boot the machine.

----------

## tianqingfei

Hi, all.

Thank you for you attention.

I have setup the sshd in my T420.

following is my make.conf

 *Quote:*   

> 
> 
> # These settings were set by the catalyst build script that automatically
> 
> # built this stage.
> ...

 

This is my xorg.0.log  with no xorg.conf in /etc/X11 folder

 *Quote:*   

> 
> 
> X.Org X Server 1.10.4
> 
> Release Date: 2011-08-19
> ...

 

And this is my xorg.conf.new which is generated by Xorg -configure.

After apply this configure file, my screen turn black and keyboard has no response any more.

 *Quote:*   

> 
> 
> Section "ServerLayout"
> 
>         Identifier     "X.org Configured"
> ...

 

----------

## RazielFMX

As has been stated several times, get rid of your Xorg.conf file.  You do not need it.  Do not use Xorg -configure, it will break your system with modern xorg.

In your make.conf, replace your input devices with this:

```
INPUT_DEVICES="evdev"
```

You need to emerge  x11-drivers/xf86-input-evdev.

Make sure you have EVDEV support in your kernel.

```
nightshade ~ $ grep -i evdev /usr/src/linux/.config

CONFIG_INPUT_EVDEV=m

nightshade ~ $
```

And make sure its loaded on boot (assuming you are using openrc):

```
nightshade ~ $ grep evdev /etc/conf.d/modules

modules_2_6="${modules_2_6} evdev"

module_evdev_args_2_6=""

nightshade ~ $
```

Also, please make sure your kernel is set up like described here:

http://www.gentoo.org/doc/en/xorg-config.xmlLast edited by RazielFMX on Wed Sep 28, 2011 1:53 pm; edited 1 time in total

----------

## tianqingfei

Thank you for your great help!

But there is still a few problem about ssh.

[quote=Jaglover] /etc/init.d/sshd start. After that you should be able to log on from another computer using your username and su to root if needed.[/quote]

I can not su root.

Firstly I use a user in adm group, the su command was denied.

Then, I use usrmod -g root xx to add the user to root group, the su - command still is denied.

----------

## Jaglover

You should not add your user to root group, add it to wheel group instead. However, you do not need to be root to post your Xorg log with wgetpaste.

----------

## RazielFMX

You do not need to be in the root group, you need to be in the wheel group.  You should probably have your primary user in the following groups:

```
wheel floppy audio cdrom video usb users portage plugdev
```

Did you follow the Gentoo guides?

Xorg: http://www.gentoo.org/doc/en/xorg-config.xml

Basic System Setup (amd64 as an example): http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?full=1

Specific section in above document relating to users: http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?full=1#book_part1_chap11

EDIT:  Jag beat me to the group answer while I was looking for doc links  :Very Happy: 

----------

## tianqingfei

 *RazielFMX wrote:*   

> As has been stated several times, get rid of your Xorg.conf file.  You do not need it.  Do not use Xorg -configure, it will break your system with modern xorg.
> 
> In your make.conf, replace your input devices with this:
> 
> ```
> ...

 

Maybe I didn't show clearly. Currently, I set my bios to use Nvidia graphic card only.

So I don't think I need to load intel's driver. 

I did follow the handbook said, except the .config file to the kernel.

I use the kernel config from http://www.thinkwiki.org/wiki/Installing_Gentoo_on_a_ThinkPad_T420

and use make ARCH='x86_64' to make sure it's a configure file for amd64.

Thank you for your advice about evdev setting and user group setting. I'll have a try this night. I'm in Beijing, China.

Glad to meet you if we have chance.

----------

## chithanh

su uses the wheel group, as described in the handbook http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=11

Don't confuse it with sudo, which uses the admin group on some configurations.

Also, adding a user to the root group is a security risk.

----------

