Showing posts with label xorg.conf. Show all posts
Showing posts with label xorg.conf. Show all posts

07 February 2012

58. Higher resolution on a Dell E177FPb monitor using modelines in xorg.conf on Debian Testing

Update 24 May 2013: this still works fine on the optiplex (with intel onboard graphics) but when trying it on a different machine with an external nvidia card I couldn't get it to work. There only "xrandr --output VGA-0 --scale 1.1x1.1" worked.

Original post:
I've hooked up my fancy new-ish optiplex 990 to an old Dell E177FPb monitor which I bought back in 2007. For various reasons I've also removed the nvidia quattro graphics card that the optiplex 990 came with -- the main reasons being 1) I hate displayport and _need_ vga and 2) the bios forces you to press 'any key' on each boot if you leave the card in, even though you've configured the OS to use the integrated onboard graphics.

At any rate, hooking my old screen to my dell lead to a less than overwhelming experience -- and querying the 'Displays' setting in gnome showed only two resolution options: 1024x768 and 800x600. Well, I knew for a fact that the maximum resolution should be 1280x1024.

This was a bit of a surprise given that the same xorg.conf had been used together with a fancy widescreen 1920x1080 display -- yet it would not handle a 1280x1024 display? I guess this might say more about my lack of understanding how display drivers work, but whatever.

Well, in the end it turned out to be easy to enable the missing resolution mode.

First, a minimal amount of googling told me that the max resolution was 1280x1024 at 75 Hz.
"Preset Resolution: 1280 x 1024 @ 75 Hz"

Next, using gtf I generated a Modeline line.

gtf 1280 1024 75
Modeline     "1280x1024_75.00" 138.54 1280 1368 1504 1728 1024 1025 1028 1069 -HSync +Vsync

Finally, I then edited the xorg.conf (again, see this post for the entire xorg.conf), changing


Section "Monitor"
Identifier   "Monitor0"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

to


Section "Monitor"
Identifier   "Monitor0"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
Modeline     "1280x1024_75.00" 138.54 1280 1368 1504 1728 1024 1025 1028 1069 -HSync +Vsync
EndSection

Doing startx to start up gnome, followed by selecting Displays, then selecting Resolution: 1280x1024 (5:4) yielded a beautifully satisfying  user experience.

I'm not one to fiddle with xorg.conf, but this time it turned out that the fix was easy once I had figured out what to do.

12 January 2012

48. nvidia gt520 issues and solutions on debian testing

EDIT: see here for a Linux Mint Debian Edition take on the GT 520 nouveau issue -- http://community.linuxmint.com/tutorial/view/824

EDIT: Someone made a succinct how-to for nvidia driver installation on debian: http://blog.libremath.org/2012/04/07/debian-nvidia-quick-guide/ NOTE: site seems to be down.

--start here --
I recently bought an nvidia gt520 1 GB graphics card. To my surprise it turned out to be a bit of a pain to actually get it working properly.

Sadly, we don't always document all the steps when trying to get something to work, but here's roughly what I remember.

The problem:
I plugged the nvidia gt520 into the pci express slot, connected the vga cable to the vga socket on the new graphics card and started my computer. My setup autostarts gdm3. Everything went fine -- the boot messages were flashing by as per normal, then gdm3 started. And got stuck. I experience two different types of hanging  -- either just a black screen, or a black screen with a single cursor indicator (a single _ in the top left corner).

Logging in remotely (had ssh server running) and looking at top I could see that gdm3 was using up 50+% cpu power. Leaving the system for half an hour didn't allow for any progress.

Also, even when I did ctrl+alt+f1 to bring up tty1 I would be forcibly returned to tty7 over and over again. Trying to fix anything was thus difficult. After doing ctrl+alt+f1 a few times and being thrown around it would stop responding and strange symbols would appear on the screen when trying to use the keyboard.

One last piece of information: my onboard graphics is nvidia as well, but this probably isn't relevant.

Logging in remotely I tried using the excellent smxi / sgfxi scripts (http://smxi.org/) to install the proper graphics drivers. I tried nouveau, debian-nvidia and nvidia-current . I also tried just deleting /etc/X11/xorg.conf and hoping for the best

Diagnosis:
First I made sure gmd wasn't starting anymore so that the computer wouldn't hang and I'd be able to work in peace:
sudo vim /etc/default/grub

CMD_LINUX_DEFAULT="quiet splash"
was changed to
CMD_LINUX_DEFAULT="quiet splash text"
(there may be other things on the same line -- just add text)

Then to make the changes take effect,
sudo update-grub
and reboot

Second I tried unloading any modules

sudo rmmod nouveau
sudo rmmod nvidia

I edited /etc/modules and commented out nvidia, and made sure nouveau was there. I also edited etc/modprobe.d/nvidia-kernel-common.conf and commented out blacklist nouveau.

I then tried installing the nouveu driver a last time
sudo sgfxi -N nouveau
and rebooted
After the reboot had completed dmesg| grep nouv gave me the clue I needed -- the drivers had failed to load! I don't remember what the exact message was, but it was all about failure.


Solution:
(also see first post below)

I removed the xorg.conf
sudo rm /etc/X11/xorg.conf
then
startx
The desktop started! But I found myself in fallback mode -- the graphics acceleration obviously wasn't working -- but that wasn't a surprise since the drivers had failed to load.

I then ran
sudo rmmod nouveau
sudo apt-get install nvidia-kernel-dkms nvidia-settings nvidia-smi nvidia-xconfig
sudo nvidia-xconfig
startx

It worked!

My autogenerated /etc/modprobe.d/nvidia-kernel-common.conf now looks like this again:
alias char-major-195* nvidia

options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=44 NVreg_DeviceFileMode=0660
# To enable FastWrites and Sidebus addressing, uncomment these lines
# options nvidia NVreg_EnableAGPSBA=1
# options nvidia NVreg_EnableAGPFW=1

# see #580894
blacklist nouveau

Remember to remove any mention of nouveau in /etc/modules.

You can change your /etc/default/grub back to the way it was again to make gdm start again every time.

Edit: Reading between the lines it seems that Squeeze may not have the proper drivers available for GT520 -- binary installation using smxi might be a good idea in that case: http://forums.debian.net/viewtopic.php?f=17&t=72876

Lengthy output follows:

Here's dmesg | grep nvidia

###############################
[    7.192358] nvidia: module license 'NVIDIA' taints kernel.
[    7.278115] nvidia 0000:02:00.0: PCI INT A -> Link[LNED] -> GSI 18 (level, low) -> IRQ 18
[    7.278122] nvidia 0000:02:00.0: setting latency timer to 64
###############################


Here's lspci -vvnn



###############################


02:00.0 VGA compatible controller [0300]: nVidia Corporation GF119 [GeForce GT 520] [10de:1040] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Giga-byte Technology Device [1458:3520]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 18
Region 0: Memory at df000000 (32-bit, non-prefetchable) [size=16M]
Region 1: Memory at d0000000 (64-bit, prefetchable) [size=128M]
Region 3: Memory at dc000000 (64-bit, prefetchable) [size=32M]
Region 5: I/O ports at ec00 [size=128]
[virtual] Expansion ROM at def80000 [disabled] [size=512K]
Capabilities: <access denied>
Kernel driver in use: nvidia

###############################


Here's lshw -C display (run as user)
###############################
WARNING: you should run this program as super-user.

  *-display            
       description: VGA compatible controller
       product: GF119 [GeForce GT 520]
       vendor: nVidia Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:18 memory:df000000-dfffffff memory:d0000000-d7ffffff memory:dc000000-ddffffff ioport:ec00(size=128) memory:def80000-deffffff
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
###############################


And here's the xorg.conf:


###############################


# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 290.10  (pbuilder@cake)  Wed Nov 23 11:33:47 UTC 2011

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubS


###############################



Links to this page:
http://community.linuxmint.com/tutorial/view/824

11 August 2011

16. Using onboard video card with acceleration on Optiplex 990 on Debian

NOTE: another issue debian users should be aware of is the failure to reboot on sudo shutdown -r now. The fix is easy though: change GRUB_CMDLINE_LINUX in /etc/default/grub to read GRUB_CMDLINE_LINUX="reboot=pci"

--Start Here ---
The videocard (nvidia quadro something or other) my work Optiplex 990 came with only has a 'displayport', and the supplied adapter for it only has DVI-D (no analogue signal, so a VGA converter won't work). Since my 24" monitor doesn't have DVI, and I hate HDMI, and at the same time appreciate graphics acceleration (can't live without my wobbly windows in compiz), I had to generate an /etc/X11/xorg.conf which would allow me to use the motherboard graphics capabilities. Here's that xorg.conf (ripped out the video card, used smxi to generate an xorg-driver dependent xorg.conf):


Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "Screen0" 0 0
Screen      1  "Screen1" RightOf "Screen0"
Screen      2  "Screen2" RightOf "Screen1"
InputDevice    "Mouse0" "CorePointer"
InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath   "/usr/lib/xorg/modules"
FontPath     "/usr/share/fonts/X11/misc"
FontPath     "/usr/share/fonts/X11/cyrillic"
FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath     "/usr/share/fonts/X11/Type1"
FontPath     "/usr/share/fonts/X11/100dpi"
FontPath     "/usr/share/fonts/X11/75dpi"
FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
FontPath     "built-ins"
EndSection

Section "Module"
Load  "dbe"
Load  "record"
Load "dri"
Load  "dri2"
Load "glx"
Load  "extmod"
EndSection

Section "InputDevice"
Identifier  "Keyboard0"
Driver      "kbd"
EndSection

Section "InputDevice"
Identifier  "Mouse0"
Driver      "mouse"
Option    "Protocol" "auto"
Option    "Device" "/dev/input/mice"
Option    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier   "Monitor0"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Monitor"
Identifier   "Monitor1"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Monitor"
Identifier   "Monitor2"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Device"
Identifier  "Card0"
Driver "intel"
BusID       "PCI:0:2:0"
EndSection

Section "Device"
Identifier  "Card1"
Driver "intel"
BusID       "PCI:0:2:0"
EndSection

Section "Device"
  Identifier  "Card2"
Driver "intel"
BusID       "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device     "Card0"
Monitor    "Monitor0"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device     "Card1"
Monitor    "Monitor1"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen2"
Device     "Card2"
Monitor    "Monitor2"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Extensions"
# Option      "Composite" "disable"
# Option      "RENDER" "disable"
EndSection