Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== I just want to fix that black screen when I start an X session ====== //And much much more...// The handbook is great but sometimes it just isn't as friendly as descriptive as you would like it to be. This is a Wiki page to share our hacks, arcane knowledge, workarounds and diagnosis tricks. ===== Resources ===== * People tend to put hardware-specific solutions on the [[/Laptops]] wiki pages. You might want to check them out. * [[Laptops/Lenovo_Yoga_3_14/X]] ---- ===== FAQ ===== * [[https://www.freebsd.org/doc/handbook/x11.html|Chapter 5. The X Window System (FreeBSD Handbook)]] ---- ==== Choosing the right driver ==== ---- === How can I check what driver I need? === You can list your graphics hardware with: <code> pciconf -lv | grep display -B 3 -A 1 </code> ---- === Is my graphics card supported? === Check out [[/Graphics]]. If it is not supported then you might want to check out: * [[Graphics/SCFB|Graphics/SCFB]] ---- === I'm still not sure what I should install... === :!: This subsection is a work in progress. Ping us on an IRC channel or a mailing list if you spot an error or you know how to fill in the missing information. == Intel Graphics == * You need a kernel driver and an Xorg driver. * Example: * An example of an Xorg driver would be [[https://www.freshports.org/x11-drivers/xf86-video-intel/|xf86-video-intel]]. It does not bring support for any new hardware. That's what the kernel driver is for. * An example of a kernel driver would be [[https://www.freshports.org/graphics/drm-next-kmod/|drm-next-kmod]]. * ''%%drm-next-kmod%%'' specifically is meant to replace an older kernel driver that comes in the %%FreeBSD%% 11 release. * You would use ''%%xf86-video-intel%%'' on both ''%%drm-next-kmod%%'' and without it as ''%%xf86-video-intel%%'' is a userspace driver to drive the X server. * You might not need to install ''%%xf86-video-intel%%'' and still have graphics running as there is a generic KMS driver called ''%%modesetting%%'' already included in the [[https://www.freshports.org/x11/xorg|xorg]] package. Installing ''%%xf86-video-intel%%'' might not be necessary but would give you more control over how your graphics is rendered (see [[https://www.freebsd.org/cgi/man.cgi?query=intel&sektion=4|intel(4)]] for more details). //The table is based on the one from [[/Graphics]], which is updated much more often.// ^ Video card family ^^ Status ^ Min. %%FreeBSD%% version ^ Kernel driver ^ Xorg driver ^ Comments ^ | GMA 950 | Calistoga | Works | 9.1 | i915kms | [[https://www.freebsd.org/cgi/man.cgi?query=modesetting&sektion=4|modesetting(4)]] or [[https://www.freebsd.org/cgi/man.cgi?query=intel&sektion=4|intel(4)]] | | | GMA 4500 / 4500MHD | Eaglelake / Cantiga | Works | 9.1 | | | i[357]-xxx processors | Ironlake | Works | 9.1 | | | i[357]-2xxx processors | Sandy Bridge | Works | 9.1 | | | i[357]-3xxx processors | Ivy Bridge | Works | 9.1 | | | Xeon E3 V2 processors | Ivy Bridge | Works | 9.1 | | | i[357]-4xxx processors | Haswell | Works | 11.0 | | | Xeon E3 V3 processors | Haswell | Works | 11.0 | | | Intel i915 HD Graphics | Broadwell | Works | 11-STABLE | [[https://www.freshports.org/graphics/drm-next-kmod/|drm-next-kmod]] | | | Intel i915 HD Graphics | Skylake | Works | 11-STABLE | | | Intel i915 HD Graphics | Kabylake | Works | 11-STABLE | | * The ''%%i915kms%%'' kernel-side driver is shipped with the generic %%FreeBSD%% kernel and is available as a module. No need to install anything. * :!: TODO: Add a reference to a manual page describing i915kms. * [[https://www.freebsd.org/cgi/man.cgi?query=modesetting&sektion=4|modesetting(4)]] can be installed with [[https://www.freshports.org/x11-servers/xorg-server/|xorg-server]] so you get it when you install [[https://www.freshports.org/x11/xorg|xorg]] * [[https://www.freebsd.org/cgi/man.cgi?query=intel&sektion=4|intel(4)]] can be installed with [[https://www.freshports.org/x11-drivers/xf86-video-intel/|xf86-video-intel]] * [[https://www.freebsd.org/cgi/man.cgi?query=intel&sektion=4|intel(4)]] has little to no advantage over the generic [[https://www.freebsd.org/cgi/man.cgi?query=modesetting&sektion=4|modesetting(4)]] driver. Unless you need extra control over your graphics hardware and rendering options, you don't need [[https://www.freebsd.org/cgi/man.cgi?query=intel&sektion=4|intel(4)]]. In fact, as of 2018.04.15 the [[https://github.com/FreeBSDDesktop/freebsd-base-graphics/wiki|FreeBSD Graphics Wiki]] discourages the installation of [[https://www.freebsd.org/cgi/man.cgi?query=intel&sektion=4|intel(4)]] as most likely any bugs encountered in Xorg will be patched first in the [[https://www.freebsd.org/cgi/man.cgi?query=modesetting&sektion=4|modesetting(4)]] codebase. == Nvidia == nvidia-modeset: debdrup, Freenode, #freebsd-wiki, 2018.05.11 * nvidia-modeset is supplied by the [[https://www.freshports.org/x11/nvidia-driver/|nvidia-driver]], as a way of using the kernel modesetting option to change resolution, instead of doing it in userspace. * [[https://svnweb.freebsd.org/ports/head/UPDATING?revision=469350&view=markup#l2394|What is this nvidia-modeset all about? (svnweb.freebsd.org/ports/head/UPDATING)]] ---- ==== Drivers ==== ---- === Kernel drivers === == i915 / drm-next-kmod == * [[https://github.com/FreeBSDDesktop/freebsd-base-graphics/wiki|Wiki of the project bringing the driver to FreeBSD (github.com/FreeBSDDesktop/freebsd-base-graphics)]] ---- === Xorg drivers === == modesetting == * It can be used with both i915kms and [[https://www.freshports.org/graphics/drm-next-kmod/|drm-next-kmod]]. * ''%%modesetting%%'' doesn't yet allow ''%%Option "TearFree" "True"%%'' in ''%%/usr/local/etc/X11/xorg.conf.d/98-tearfree.conf%%''. (14.4.2018) ---- ==== Specific hardware tricks ==== ---- === AMD GPU === == I get significant screen tearing with my AMD GPU == In order to solve this you can add the following to ''%%/usr/local/etc/X11/xorg.conf.d/20-amdgpu.conf%%'' (the file does not exist by default): <code> Section "Device" Identifier "AMD" Driver "amdgpu" Option "DRI" "3" Option "TearFree" "true" EndSection </code> ---- === Nvidia Optimus (Nvidia and Intel GPUs at the same time) === See [[Graphics/OptimusVideoSupport|Graphics/OptimusVideoSupport]]. == Using only the Intel card == In this section assumes that: * You are configuring Xorg manually via [[https://man.freebsd.org/xorg.conf|xorg.conf]] (which is not recommended). * You are using the [[https://www.freebsd.org/cgi/man.cgi?query=intel&sektion=4|intel(4)]] driver ([[https://www.freshports.org/x11-drivers/xf86-video-intel/|xf86-video-intel]]) instead of [[https://www.freebsd.org/cgi/man.cgi?query=modesetting&sektion=4|modesetting(4)]] (although [[https://www.freebsd.org/cgi/man.cgi?query=modesetting&sektion=4|modesetting(4)]] is the recommended driver you should probably use). Comment out Nvidia-related parts from your [[https://www.freebsd.org/cgi/man.cgi?xorg.conf|xorg.conf]]: <code> ... Section "Device" Identifier "Card0" Driver "intel" BusID "PCI:0:2:0" EndSection #Section "Device" # Identifier "Card1" # Driver "nvidia" # BusID "PCI:1:0:0" #EndSection ... </code> Then add the following bits to [[https://www.freebsd.org/cgi/man.cgi?rc.conf|rc.conf(5)]]: <code> kld_list='i915kms' </code> ---- ==== Xorg configuration ==== ---- === How should I configure the X server? Should I generate any xorg.conf files? === **No!** These days Xorg relies entirely on autoconfiguration. Most of the time it is unnecessary to configure anything manually. In fact, you should only configure Xorg manually if you know what you are doing. Copy-pasting random code from ancient tutorials is rarely a good idea. ---- === Do I need to enable the HAL daemon (hald) in rc.conf? === Not really, no. It is no longer needed to put ''%%enable_hald="YES"%%'' into [[http://man.freebsd.org/rc.conf|rc.conf(5)]]. ---- ===== Troubleshooting ===== ---- ==== Black screens ==== ---- === The screen is going black with drm-next-kmod and amdgpu right after the module loads === * Are you running 12-CURRENT? If so then you should probably install your graphics drivers from ports. Things are changing really fast on the development branch hence the precompiled packages you install using ''%%pkg%%'' might be already outdated. ---- === After resuming from S3 standby, the screen is black === * Possibly fixed by switching to TTY0 (''%%Ctrl%%''+''%%Alt%%''+''%%F1%%'') and back to TTY8 (''%%Alt%%''+''%%F8%%''). * Another way of fixing it is to include ''%%compton --daemon%%'' in ''%%.xinitrc%%''. [[https://www.freshports.org/x11-wm/compton|Compton]] is not a part of the base system so it has to be installed first. * Alternatively fixed by setting ''%%hw.acpi.reset_video%%'' to ''%%1%%''. See [[https://www.freebsd.org/cgi/man.cgi?query=sysctl.conf&sektion=5|sysctl.conf(5)]]. ---- ==== Brightness ==== There is a dedicated wiki page: [[Graphics/Brightness|Graphics/Brightness]]. ---- ==== OpenGL ==== ---- === OpenGL works while accelerated OpenGL doesn't work with my AMD GPU === //As of 2018.04.03.// Xorg doesn't even put amdgpu into the autodetection list, it goes: - modesetting - scfb - vesa regardless of whether amdgpu is installed or not. Apparently, you get a modesetting DDX by default (even with [[https://www.freshports.org/x11-drivers/xf86-video-amdgpu/|xf86-video-amdgpu]] installed) on which for some reason radeonsi doesn't work and it falls back to LLVMpipe. In order to solve this you can add the following to ''%%/usr/local/etc/X11/xorg.conf.d/20-amdgpu.conf%%'' (the file does not exist by default): <code> Section "Device" Identifier "AMD" Driver "amdgpu" EndSection </code> Now you should get something along the following output when running ''%%glxinfo%%'' (from the [[https://www.freshports.org/graphics/mesa-demos/|graphics/mesa-demos]] port): * ''%%glxinfo|grep "renderer string"%%'': %%OpenGL%% renderer string: AMD Radeon (TM) Pro WX 5100 Graphics (POLARIS10 / DRM 3.10.0 / 12.0-CURRENT, LLVM 5.0.1) * ''%%glxinfo|grep "core profile version string"%%'' %%OpenGL%% core profile version string: 4.5 (Core Profile) Mesa 17.3.1 Now %%OpenGL%% should work. ---- ==== Tearing ==== What's tearing anyway? See [[https://launchpadlibrarian.net/274755154/kenjo_vidtest_60fps.mp4|this test video]]. ---- ==== Transparency ==== In order to get transparency you'll need a compositor. It has to be installed manually unless your desktop environment comes with one. Notable compositors: * [[https://www.freshports.org/x11-wm/compton|x11-wm/compton]] * It is used by the [[https://www.freshports.org/x11/lumina|Lumina Desktop Environment]]. ---- ==== Xorg error messages ==== ---- === "Cannot run in framebuffer mode. Please specify busIDs" === * Make sure that you've got your drivers installed. :!: TODO ---- === "(EE) open /dev/dri/card0: No such file or directory" === :!: TODO ---- === "(EE) No devices detected.", "(EE) no screens found(EE)" === :!: TODO == Related reported issues == * [[https://unix.stackexchange.com/q/440737/128489|Xorg error No devices detected (unix.stackexchange.com)]] ---- === ".Xauthority does not exist" === debdrup Freenode, #freebsd-wiki, 2018.05.11 This error message isn't very informative. It just means that you won't be able to access the X server via X11 Forwarding over SSH If you ever need to create the file, all you need to do is ''%%touch ~/.Xauthority%%'' - at which point you can use [[https://www.freebsd.org/cgi/man.cgi?xauth|xauth(1)]] to modify ''%%~/.Xauthority%%''. ---- === "D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/etc/machine-id": No such file or directory" === Based on [[https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228001]]. First of all, you probably forgot to add ''%%dbus_enable=YES%%'' to [[https://www.freebsd.org/cgi/man.cgi?rc.conf|rc.conf(5)]]. You can do it using either an editor or by running <code bash> sysrc dbus_enable=YES </code> If it still does solve the issue then you've got to create the machine-id file by yourself. The the following command: <code bash> dbus-uuidgen --ensure </code> ---- ===== Community ===== ---- ==== Mailing lists ==== * [[https://lists.freebsd.org/mailman/listinfo/freebsd-desktop|freebsd-desktop@freebsd.org (lists.freebsd.org)]] * [[https://lists.freebsd.org/mailman/listinfo/freebsd-x11|freebsd-x11@freebsd.org (lists.freebsd.org)]] ---- ==== IRC ==== * [[http://freenode.net/|freenode]]: * [[https://webchat.freenode.net/?channels=%23freebsd|#freebsd]] * [[http://www.erisnet.org/|EFNet]]: * [[https://client00.chat.mibbit.com/?url=ircs%3A%2F%2Firc.efnet.org%2Ffreebsd-xorg|#freebsd-xorg]] See [[IRC/Channels]] for a list of all the %%FreeBSD%% IRC channels. ---- {{tag>HowTo}} graphicsold/faq.txt Last modified: 2018/11/26 01:31by PeteWright