SDB:Configuring graphics cards

Jump to: navigation, search

Version: 12.2+ As this guide assumes the use of systemd and GRUB 2, this guide may not work for very old versions below 12.2.


Symptom

Upon installing openSUSE, the X system's automatic configuration may have failed to properly configure the graphics correctly. Typically this results in either a black screen upon reboot, or the wrong resolution being used in the graphical login manager and in X sessions.

This guide is for all supported openSUSE versions up to and including openSUSE Tumbleweed.


Cause

Typically the cause is your graphics are not configured properly. The reason for the misconfiguration can vary, dependent upon your openSUSE version. With most modern hardware using a single display, configuration is automagic on-the-fly at each session start - no permanent display configuration files are needed.


Solution

This section provides some guidance on how to sort out your graphic problem. It is recommended one determine their openSUSE version and read up on some practical graphic theory before proceeding to solve their problem.

After a kernel upgrade

If after a kernel upgrade in SLED 12 or openSUSE Leap your display defaults to basic display (or no graphic display) your display drivers may not have updated cleanly. This issue has been reported in bug reports where the NVIDIA kernel module was not activated and there were KMP abnormalities in more than one type of NVIDIA driver so may be a general issue. You may well be able to reboot into the previous kernel without the problem (usually after an upgrade the last kernel is offered via a boot menu option). A fix is a forced reinstall of all the display drivers (such as NVIDIA - see below if you need to identify your display) via YAST. (see for example openSUSE bug 925437)

Determine openSUSE version

It is very important you know what openSUSE version you are using. This is simple to do. Either this can be read from clicking on the "My Computer" icon on one's desktop, and reviewing the section under "OS Information" next to "System", or instead simply open a terminal and type:

cat /etc/os-release

You need to know which openSUSE version in order to select the optimal solution to solve your problem.

Determine your graphic card version

It is also important to determine what graphic hardware one has on their PC, and what graphic driver one is using on their PC. Try to get access to a terminal/Konsole, either by opening a bash shell (terminal/Konsole) if you have a GUI, or if you only have a full screen black screen, try pressing Ctrl + Alt + F2 which may take you to a full screen text mode with a log in prompt (in which case login as a regular user). Then in both cases (bash shell or full screen) type the following as a regular user:

sudo lspci -nnk | grep -A3 VGA

Note what you type in GNU/Linux is 'case sensitive'. That command should tell you what graphics hardware you have on your PC. For example on a PC with NVIDIA proprietary graphic driver, one can get:

 02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT200 [GeForce GTX 260] [10de:05e2] (rev a1)
         Subsystem: ASUSTeK Computer Inc. Device [1043:82cf]
         Kernel driver in use: nvidia

With Intel graphics using the integrated modesetting driver, one might see:

 00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [8086:0402] (rev 06)
         Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:7850]
         Kernel driver in use: i915
         Kernel modules: i915

Given you likely have a graphic problem, your PC may only show the 1st two lines and not the kernel driver. If you have a hybrid graphics device, you may even see evidence of two graphics cards.

Once you have determined

  • your openSUSE version,
  • your graphic hardware, and
  • your in use graphic driver [whether it works or not],

please proceed to the next steps in this guide.

Experienced Linux users should note that in the vast majority of cases /etc/X11/xorg.conf and /etc/X11/xorg.conf.d/50-[device,monitor,screen].conf files are not needed for any openSUSE version AFTER 11.1.

Troubleshooting things to try

1st thing to try (cmdline options)

  • The first thing to try is to boot from GRUB 2 with boot code "nomodeset".
In openSUSE 13.2 or newer if you have a GeForce 61XX gfxchip, try first: nouveau.config=NvMSI=0.
F3: Select No KMS (Leap 42.2 and earlier)

If you have already installed openSUSE, follow the steps here to boot with "nomodeset".

If you are installing openSUSE on a regular BIOS fitted PC, select the "No KMS" menu under F3, which does the same thing as "nomodeset".

Note that nomodeset on GRUB 2's kernel cmdline prevents the AMDGPU, Intel, Modesetting, Nouveau and Radeon FOSS DDX drivers from functioning. Non-availability of kernel modesetting (KMS) will either prevent Xorg from starting entirely, or cause it to run in a crippled low resolution (fallback) VESA or FBDEV mode suitable in most cases only for simple troubleshooting, or for servers with little or no need for graphical apps. This option is intended primarily to ensure access to a login prompt on vttys[1-6], and allow editing of configuration files. See SDB:Nomodeset:_Work_Around_Graphic_Upgrade_&_Installation_Obstacles for additional nomodeset detail.


2nd thing to try (failsafe/safe-settings boot)

  • The 2nd thing to try (if the above did not work) is to try booting from GRUB with a more safe setting.
F5 - Safe Settings selection

If installation failed, try using the Safe Settings option (press F5 to load the GRUB "Kernel Default" menu).

If you have already installed openSUSE, choose in the GRUB 2 boot menu Advanced options for openSUSE Leap (or what ever your openSUSE version may be)..

If this works, you may wish to stop here. But for users with installed systems, whether that succeeds or not, you may wish to read on to see if you can better optimize your system.


3rd thing to try (use installation config file)

  • The 3rd thing to try is boot to multi-user.target (a full screen text mode) and try to use the installation graphic configuration file xorg.conf.install as a temporary measure.

Follow the guidance in this blog article to boot to runlevel 3: https://forums.opensuse.org/blogs/jdmcdaniel3/how-start-opensuse-12-2-grub-2-into-run-level-3-112/

Your PC should boot to a full screen text mode with a login prompt. You are now in multi-user.target. Login as a regular user and then type:

sudo cp /etc/X11/xorg.conf.install /etc/X11/xorg.conf

and enter the root/administrator user password when prompted for a password.

New users note that Linux is case-sensitive and so be accurate when typing uppercase and lower case characters, as they are treated differently. X11 is NOT the same as x11.

Typically the installation configuration file will use the FBDEV graphic driver. In some cases the xorg.conf.install file will NOT exist, and of course if that is the case, then this step will not work. After doing the preceding, to test if this works, you can reboot your system by typing:

systemctl reboot

Hopefully that will allow a boot to a graphical X window with the FBDEV driver. If this works, you "may" wish to stop here. However that driver is VERY low quality and you may wish to continue to the next step, even IF you have that functioning.

4th thing to try (edit /etc/X11/xorg.conf.d/ directory)

  • The 4th thing to try is to edit the configuration file for X window graphics to attempt to force a boot to a specific graphic driver. If you have not read the practical theory guide referenced above, PLEASE do so now, else this step will be difficult to understand.

Again, boot to multi-user.target (3 added to boot cmdline) like the 3rd step above. Check if there is an /etc/X11/xorg.conf file, and if there is you need to move that file so it does not interfere with the configuration you are to setup. Hence if there there is such an xorg.conf file, then change the name of that file to something different, such as:

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.myoldbackup
New users - again note that Linux is case-sensitive and so be accurate when typing uppercase and lower case characters, as they are treated differently. X11 is NOT the same as x11.

Then edit the /etc/X11/xorg.conf.d/50-device.conf file, adding an entry for your chosen graphic driver. You will need to do this from a text editor with root permissions.

For example, if you using Vim (included out of the box), type:

sudo vim /etc/X11/xorg.conf.d/50-device.conf

Enter root password when prompted.

To edit the file, press I to enter insert mode. Once in insert mode, use the arrow keys to move the cursor and type as normal.

After making the necessary edits, to exit Vim press Esc, then type ":wq" (without the quotes), then press Enter. Be very careful as one is using this editor with root permissions.

Tip: Prior to doing the above, check the openSUSE Video Hardware Compatibility List (HCL) for guidance on what graphics drivers are available for use on openSUSE Leap.

For example, you could change that file to:

 Section "Device"
   Identifier "Default Device"
    
   #Driver "radeon"
   Driver "amdgpu"
  
   ## Required magic for radeon/radeonhd drivers; output name
   ## (here: "DVI-0") can be figured out via 'xrandr -q'
   #Option "monitor-DVI-0" "Default Monitor"
    
 EndSection

where in the example above the line Driver amdgpu was added to try force the load of the open source "amdgpu" graphic driver for recent AMD cards. It is important one read the practical theory guide referenced above to understand what graphic drivers may be available.

Icon-warning.png
Warning: NVIDIA graphic card users who discovered that neither the "nouveau" nor the "modesetting" driver worked for them, should pay attention to the [obsolete]openSUSE 12.1 release notes (obsolete) and as appropriate blacklist the "nouveau" driver in the /etc/modprobe.d/50-blacklist.conf file. This can be done with root permissions by typing:

echo "blacklist nouveau" >> /etc/modprobe.d/50-blacklist.conf

It may also be necessary to run "yast" (you can run yast in text mode with root permissions if X window not available) and navigate to yast > System > /etc/sysconfig Editor > System > Kernel > NO_KMS_IN_INITRD and change it to "yes". This takes a minute or two to save once changed is submitted. (see below image examples).

For users trying to blacklist "nouveau" driver, examples of how to specify NO_KMS_IN_INITRD from a text yast are here, illustrated sequentially below (note one must also blacklist nouveau as described above). So to edit the /etc/sysconfig start yast from a text login by typing:

sudo yast

Use the spacebar, tab key, enter key, and arrows to navigate yast in text mode, and then follow the example screens.

Enter /etc/sysconfig Editor
Locate system in sysconfig Editor
set NO_KMS_IN_INITRD to YES

In case a more complex edit is needed (hopefully not needed), then another example of an edit in the /etc/X11/xorg.conf.d/ directory (but this time to configure a monitor instead of specifying a graphic driver) is an openSUSE forum example of customizing the 50-monitor.conf file. Note one might have to click on that link twice to connect to the proper page.

And then after making any such edit(s)/change(s), as a regular user again reboot as before with the

systemctl reboot

Hopefully your PC will boot to X window graphical desktop and if this works, you may wish to stop here.

5th thing to try (Xorg -configure creation of a legacy xorg.conf file)

Icon-warning.png
Warning: The following almost never works any more absent extensive customization. It's far more likely to generate a segfault than a usable file, and even if it does create a file, it will contain far more useless non-display-related parts than display-related parts, obfuscating parts with the potential to be useful. The parts with potential to be useful would need customization to be able to do any better than Xorg's automagic does by default.
  • The 5th thing to try is to try to create your own version of the "classic/legacy" xorg.conf custom configuration file for the graphics. This is more precisely known as the /etc/X11/xorg.conf file. In fact this step does in part what the old sax2 configuration wizard (removed in 11.3) used to do for openSUSE (but this is less capable). Some users may even have a copy of their old xorg.conf from a previous Linux install that they might try (although it may not work with openSUSE Leap). Again, if you have not read the practical theory guide referenced above, PLEASE do so now, else this step will be difficult to understand.

For this step, boot to multi-user.target (3 added to boot cmdline) like the 3rd step above. But this time, create a draft xorg.conf file by typing:

sudo Xorg -configure

If it doesn't segfault it will create the file /root/xorg.conf.new.

New users note that Linux is case-sensitive and so be accurate when typing uppercase and lower case characters, as they are treated differently. Xorg in the command is NOT the same as xorg in the subsequent xorg.conf.new file name.

You now need to move that file to the proper location so it is used by X when starting, and you need to rename that file. You can do so by typing:

sudo mv /root/xorg.conf.new /etc/X11/xorg.conf

If you are lucky, you will then be able to reboot (as described above) by typing systemctl reboot and you might successfully boot to an X window desktop. However, it is also possible you may need to change the driver in that /etc/X11/xorg.conf file, and to do so you need to open it with a text editor (see Step 4 for example of using Vim) with root permissions and then change the driver. For example you may need to change "nouveau" to "modesetting" in the device section of that file, such that the "modesetting" driver is used instead of the "nouveau" driver.

Again, per step#4 above, NVIDIA graphic card users may need to black list the "nouveau" driver and change NO_KMS_IN_INITRD to "yes" with the sysconfig editor (see step#4 above).

And then after making such an edit/change, as a regular user again reboot as before with:

systemctl reboot

Hopefully your PC will boot to X window graphical desktop and if this works, you may wish to stop here.

6th thing to try (proprietary graphic driver)

Again, per step#4 above, NVIDIA graphic card users may need to black list the "nouveau" driver in the /etc/modprobe.d/50-blacklist.conf file, for example with root permissions by typing: echo "blacklist nouveau" >> /etc/modprobe.d/50-blacklist.conf and also change NO_KMS_IN_INITRD to "yes" with the sysconfig editor (see step#4 above).

If instead your PC has Intel integrated graphics or a VIA graphic card or other graphic card, then you need to again consult with the practical theory guide to determine what your options are for the VIA and Intel graphics devices.

7th thing to try (experts only - udev edits)

  • The 7th thing to try - Try Udev edits as last resort.
Icon-warning.png
Warning: This UDEV section is under development and not in a state yet where it should be followed. Due to complexity only some references have been provided here for the time being (until this section can be written properly). In addition, this section will ultimately be written for Linux experts only, and not for new nor average users
sudo udevd -V
udevadm test /class/input/eventX
udevadm info -e | grep ID_INPUT (KEYBOARD, MOUSE, KEY, TOUCHPAD, ...)

Does re-plugging the input devices makes them appear? If they can't be removed/connected, try:

udevadm trigger -v --subsystem-match=input


THE ABOVE UDEV SECTION NEEDS LOTS MORE WORK ....

See also

This wiki was created to address an action associated with openSUSE bug report 608237. An related issue is also in openSUSE feature tracking: openFATE #308357: Replacement for Sax2 in 11.3.


References

Below are some references to other wiki, which provide useful information on configuring one's graphics in openSUSE.

  • Configuring graphics in Dual Head mode for openSUSE 11.2 and earlier, although likely applicable to openSUSE Leap (link to this reference wiki location to be updated eventually as part of wiki transistion process)
  • Multiple Screens Using XRandR for openSUSE 11.3 and earlier, although likely applicable to openSUSE Leap (link to this reference wiki location to be updated eventually as part of wiki transistion process)
  • Configuring openSUSE graphic cards is an older wiki on the same subject, but with less technical content (as to different options/steps available).
  • Configuring graphic cards through the command line interface is an older wiki for openSUSE 11.3 and earlier (possibly applicable in part to Leap) (link to this reference wiki location to be updated eventually as part of wiki transistion process)
  • Monitor Settings is a general write up (with minimal specifics) on applying custom monitor settings (link to this reference wiki location to be updated eventually as part of wiki transistion process)
  • 3D Acceleration is a simple guide on how to enable 3D acceleration on Gnome and KDE4 (link to this reference wiki location to be updated eventually as part of wiki transistion process)
  • Graphic card troubleshooting was written with openSUSE 11.1 and 11.2 in mind and has not been updated to reflect changes as of openSUSE 11.3 (especially wrt the nouveau driver requiring blacklisting). Hence care must be applied when following that guide (link to this reference wiki location to be updated eventually as part of wiki transistion process)
  • openSUSE Hardware Compatibility List (HCL) for Video cards provides a link to data provided by users on the compatibility of their video cards with openSUSE Linux.