# New to FreeBSD. Startx fails with "Cannot run in framebuffer mode.". Help!



## GautamGoel (Dec 25, 2018)

Hi guys,

I'm new to FreeBSD. I recently installed FreeBSD 12 on my system with a Coffee Lake i5 9600k CPU and integrated Intel UHD 630 graphics. The install went smoothly, but when I try running startx I get the strange error message: "Cannot run in framebuffer mode. Please specify busIDs". I know from reading the forum that this is a common issue, usually caused by problems with the video drivers. I have tried installing/uninstalling/reinstalling various packages including xorg, xf86-video-intel, and drm-kmod. I know that it is finding the driver, since I see i915kms.ko listed via kldstat. I tried installing drm-kmod-next and writing kld_list = "/boot/modules/i915kms.ko" in /etc/rc.conf as some have suggested, but it made no difference. I also get a strange error when I try Xorg  -configure: "Number of created screens does not match number of detected devices. Configuration failed."

Questions: 

1. Any ideas for what I should try next?

2. Is the issue simply that processor is too new? I'm a bit skeptical that this is the problem, since the graphics engine was basically unchanged between Skylake and Coffee Lake.


----------



## k.jacker (Dec 25, 2018)

First, for future posts, it's called FreeBSD 12.0-RELEASE (FreeBSD 12 is not enough information).

The default i915kms.ko driver does not support CoffeeLake, you have to install one from ports.


GautamGoel said:


> I know that it is finding the driver, since I see i915kms.ko listed via kldstat.


That doesn't mean a lot. To se if the driver attached, something like the following should appear on the console/dmesg when the driver is loaded.

```
info: [drm] Connector eDP-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.eDP-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector VGA-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.VGA-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector HDMI-A-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.HDMI-A-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector DP-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.DP-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector HDMI-A-2: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.HDMI-A-2
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector DP-2: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.DP-2
info: [drm]   - kern.vt.fb.default_mode
```
(this is from the base driver in FreeBSD 11.2-RELEASE, it looks a bit different in the new newer drivers)

The meta-port graphics/drm-kmod is recommended, as it installs the most recent drm for your FreeBSD version (no additional drivers for Xorg are needed).
You need the sources for FreeBSD 12.0-RELEASE in /usr/src and then add _kld_list_"/boot/modules/i915kms.ko_" to /etc/rc.conf.
After the driver is installed, there is no need to reboot. Just unload the already loaded driver `# kldunload i915kms` and load the one from graphics/drm-kmod via `# kldload /boot/modules/i915kms.ko`

(don't run xorg -configure, remove any xorg.conf files you may have created)


----------



## tedbell (Dec 25, 2018)

Wozzeck.Live said:


> In legacy mode, it is required to use as a complement the xf86-video-intel driver in order to make XORG working.


No it's not. The modesetting driver works perfectly for me and even runs faster than the xorg intel driver.


----------



## k.jacker (Dec 25, 2018)

Wozzeck.Live  That must be a typo in the Handbook, the driver from the base system supports everything up to Haswell, mot Broadwell. You are making it far more complicated than it really is, and you are wrong at some points, too.


----------



## GautamGoel (Dec 26, 2018)

k.jacker said:


> First, for future posts, it's called FreeBSD 12.0-RELEASE (FreeBSD 12 is not enough information).
> 
> The default i915kms.ko driver does not support CoffeeLake, you have to install one from ports.
> 
> ...



Hi k.jacker, I will try what you said. Question: why does it matter if I have the FreeBSD 12.0 RELEASE sources at /usr/src? I'm pretty sure I didn't include them during install, so maybe that's the problem. Also, will it make any difference if I install the drivers via pkg, or compile the ports myself? On this other thread (https://forums.freebsd.org/threads/startx-fails.68074/) the poster said that he had better luck with ports compared to pkg.


----------



## Deleted member 30996 (Dec 26, 2018)

GautamGoel said:


> Also, will it make any difference if I install the drivers via pkg, or compile the ports myself?



It can make a difference if you mix ports and pkg in that you're more likely to run into problems than if you use one or the other exclusively. For new users, best advise tends toward using pkg and sticking with it unless you need to set a lot of non-default options in your build.

I prefer ports and rarely mix the two.


----------



## GautamGoel (Dec 26, 2018)

k.jacker said:


> First, for future posts, it's called FreeBSD 12.0-RELEASE (FreeBSD 12 is not enough information).
> 
> The default i915kms.ko driver does not support CoffeeLake, you have to install one from ports.
> 
> ...


Hey, I reinstalled, this time with /usr/src.

I also installed drm-kmod and put the kld_list item in /etc/rc.conf. Still no luck. I see in the dmesg that the drm stuff isn't there. What should I do now? Thanks for all your help.

EDIT: I also tried drm-kmod-next, still no go.


----------



## SirDice (Dec 27, 2018)

Use misc/pastebinit to post your /var/log/Xorg.0.log to Pastebin. Post the URL here.


----------



## GautamGoel (Dec 27, 2018)

SirDice said:


> Use misc/pastebinit to post your /var/log/Xorg.0.log to Pastebin. Post the URL here.



Good idea! Here is the link: https://pastebin.com/d6EK4Lve

I really appreciate all the time people are spending on this thread. What a friendly and welcoming community!


----------



## T-Daemon (Dec 28, 2018)

The log file doesn’t indicate that the i915kms driver is loaded at all. The reason could be there is a typo in k.jackers posting


k.jacker said:


> .... and then add _kld_list*_*"/boot/modules/i915kms.ko_" to /etc/rc.conf.


If you have took over the entry the same as suggested by k.jackers, clearly by mistake, it won’t load the driver. Incorrect syntax after kld_list, underscore ( _ ) istead of equal ( = ) . The correct syntax in /etc/rc.conf is:

```
kld_list="/boot/modules/i915kms.ko"
```


----------



## nebu (Dec 28, 2018)

Exactly the same here. FreeBSD 12-RELEASE, Intel Coffee Lake i5-8500. The Xorg.0.log looks basically the same. The driver is not loaded at all.

`dmesg | grep drm`

returns nothing whereas on a Haswell System with FreeBSD 12-RELEASE with working X11 and drm-legacy-kmod it returns something like


```
info: [drm] Connector HDMI-A-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.HDMI-A-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector DP-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.DP-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector HDMI-A-2: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.HDMI-A-2
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector DP-2: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.DP-2
info: [drm]   - kern.vt.fb.default_mode
```

So, either a problem with drm-kmod ond FreeBSD 12-RELEASE or a problem with Coffee Lake. I guess it's the latter. I'll plug the hard drive into a Kaby Lake System tomorrow and report if it's working.


----------



## GautamGoel (Dec 28, 2018)

T-Daemon said:


> The log file doesn’t indicate that the i915kms driver is loaded at all. The reason could be there is a typo in k.jackers posting
> 
> If you have took over the entry the same as suggested by k.jackers, clearly by mistake, it won’t load the driver. Incorrect syntax after kld_list, underscore ( _ ) istead of equal ( = ) . The correct syntax in /etc/rc.conf is:
> 
> ...


 That isn't the problem, I already noticed the typo and fixed it myself.


----------



## nebu (Dec 28, 2018)

I just switched from graphics/drm-kmod to graphics/drm-devel-kmod. Now it works. Maybe you could try that.


----------



## T-Daemon (Dec 28, 2018)

Good job nebu. One correction the graphics/drm-devel-kmod is now graphics/drm-current-kmod.


----------



## GautamGoel (Dec 31, 2018)

Ok, I tried this. I tried installing drm-devel-kmod using pkg (didn't work) and then tried ports (didn't work). Here is a paste of my Xorg log files: https://pastebin.com/sW5cmV5L

Regarding the naming: drm-current-kmod was not in my ports tree, and pkg couldn't find it either. Does the name change apply to FreeBSD 12.0 RELEASE? Or is it specific to packages for CURRENT?


----------



## SirDice (Dec 31, 2018)

GautamGoel said:


> Does the name change apply to FreeBSD 12.0 RELEASE? Or is it specific to packages for CURRENT?


Just use graphics/drm-kmod. It will automatically install the correct one. 


```
20181209:
  AFFECTS: users of DRM ports other than graphics/drm-kmod
  AUTHOR: jmd@FreeBSD.org

  In order to facilitate future porting efforts and help in supporting multiple
  FreeBSD versions, the DRM ports other than drm-kmod (graphics/drm-stable-kmod,
  graphics/drm-next-kmod, graphics/drm-devel-kmod) have been renamed to
  include the FreeBSD version they are designed for.

  drm-stable-kmod is drm-fbsd11.2-kmod
  drm-next-kmod is drm-fbsd12.0-kmod
  drm-devel-kmod is drm-current-kmod
```


----------



## GautamGoel (Jan 1, 2019)

Hey guys,

I'm having a lot of trouble getting Xorg to run on my FreeBSD 12.0 RELEASE system, running on a Coffeelake i5 9600K with integrated Intel 630 graphics. I originally posted about this a few days ago on the wrong subforum, I'm reposting it here in the hopes that someone will be able to help me. Here is the original post: https://forums.freebsd.org/threads/...th-cannot-run-in-framebuffer-mode-help.68882/

Sorry for the double posting. I'd really like to get this to work, otherwise I'm gonna have to go back to Linux.


----------



## T-Daemon (Jan 1, 2019)

Don't mix ports and packages.

Change your pkg repository from "quartaly" to "latest".

Create /usr/local/etc/pkg/repos/FreeBSD.conf file

```
FreeBSD: { enabled: no }     # Disables /etc/pkg/FreeBSD.conf “quarterly”. Info for you, no need to write this in the file.

FreeBSD1: {                                                      

  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",              

  mirror_type: "srv",                                            

  signature_type: "fingerprints",                                

  fingerprints: "/usr/share/keys/pkg",                          

  enabled: yes                                                  

}
```
`# pkg delete` any drm-*kmod package
`# pkg update`
`# pkg upgrade`
`# pkg install drm-kmod`

/etc/rc.conf

```
kld_list="/boot/modules/i915kms.ko"
```
If you haven’t done it yet, put the users in the “video” group.

`# pw usermod <username> -G video`

If you have any xorg related configuration files ( /etc/X11/xorg.conf , in subdirectory /usr/local/etc/X11/xorg.conf.d any files ) rename them.

`# shutdown -r now`

After boot examine dmesg for drm messages. If the driver has attached, there should appear quiet a a few. As user: `% startx /usr/local/bin/twm`

If you get a black screen, supposed the i915 driver works as expected, the twm window manager has started. Left click to open a menu. If you have a window manager set in .xinitrc just `% startx`.

If you get drm related messages in dmesg, but no x11, examine Xorg.0.log, possibly set the intel driver in /usr/local/etc/X11/xorg.conf.d/intel-driver.conf


```
Section "Device"
    Identifier "Card0"
    Driver     "intel"
    # BusID    "PCI:1:0:0"
EndSection
```
If Xorg is complaining about BusID, you can provide it with `pciconf -lv | grep -B 4 VGA`. Uncomment the line, change id accordingly.

If in dmesg doesn't appear drm related messages, the driver hasn't attached or you get drm messages but no x11, save a copy of dmesg and Xorg.0.log. User nebu claims getting the graphic card work with graphics/drm-devel-kmod, now graphics/drm-current-kmod. Try it with that package, rename /usr/local/X11/xorg.conf.de/intel-driver.conf, reboot, examine dmesg, etc.

When no result again, please provide the output of

`pciconf -lv | grep -B 4 VGA`
From drm-current-kmod and saved drm-kmod:
complete `dmesg` ( on pastebin or file, attached to the posting)
Xorg.0.log ( pastbin/attachment)


----------



## GautamGoel (Jan 2, 2019)

T-Daemon said:


> Don't mix ports and packages.
> 
> Change your pkg repository from "quartaly" to "latest".
> 
> ...



Hey man, thanks a ton for your detailed reply. I really appreciate your help!  I changed the package repo to 'latest' from 'quarterly', and installed drm-kmod. I know that changing the repo had some effect, since the packages now followed the new naming convention, i.e. drm-kmod pulled the fbsd12 driver. (Side note: why the heck isn't it set to 'latest' by default? Coming from Linux land, this is a bizarre choice). It didn't work, so I installed drm-current-kmod (previously known as drm-devel-kmod). This, unfortunately, still did not solve the problem. The drm stuff still isn't appearing in the dmesg (see https://pastebin.com/tcvtn9v6). Here is the Xorg log: https://pastebin.com/K2z48pXs and the results of pciconf: https://pastebin.com/APWHyXiC. 

I'm surprised this isn't working by now... seems to me that the drm-current-kmod package, which is based of the Linux 4.16 DRM code, should be recent enough to handle my system (see https://www.phoronix.com/scan.php?page=news_item&px=Linux-4.16-DRM-Pull). I'm getting pretty frustrated with this, so if we can't figure it out in the next few days I'll probably just switch back to Debian or Fedora.


----------



## grahamperrin@ (Jan 2, 2019)

From Add more PCI IDs to drm-v4.16 · Issue #122 · FreeBSDDesktop/kms-drm:



> … b0be0dc should help …


----------



## GautamGoel (Jan 3, 2019)

Dude, thanks! I bet this was the problem.


----------

