Bug 107240 - [FreeBSD][Braswell] - GPU HANG error at boot using drm-next-kmod under FreeBSD 11.2
Summary: [FreeBSD][Braswell] - GPU HANG error at boot using drm-next-kmod under FreeBS...
Status: CLOSED MOVED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: x86-64 (AMD64) FreeBSD
: lowest critical
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-15 19:15 UTC by Dan MacDonald
Modified: 2018-08-21 00:54 UTC (History)
4 users (show)

See Also:
i915 platform: BSW/CHT
i915 features:


Attachments
screenshot of FreeBSD 11.2 braswell GPU HANG error (519.76 KB, image/jpeg)
2018-07-15 19:15 UTC, Dan MacDonald
no flags Details
tarball of various ubuntu 18.04 log files - xorg, dmidecode, mpv, dmesg etc (23.22 KB, application/x-xz)
2018-08-06 22:56 UTC, Dan MacDonald
no flags Details

Description Dan MacDonald 2018-07-15 19:15:27 UTC
Created attachment 140644 [details]
screenshot of FreeBSD 11.2 braswell GPU HANG error

I upgraded my FreeBSD server from 11.1 to 11.2 a couple of days ago. The main reason I did so was in the hope that I would finally get accelerated graphics working but I've had no such luck. The mobo is a Gigabyte N3150-N D3V which I think uses a Braswell GPU, which is supposed to be supported by drm-next-kmod in ports.

I installed xorg-video-intel, the kernel source for FreeBSD 11.2 and I installed drm-next-kmod from ports then loaded the kernel module in rc.conf with: 

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

When I try booting with the kernel module I get the error in the attached screenshot. I have provided some more logs here:

https://forums.freebsd.org/threads/braswell-gpu-support.66678/

Thanks
Comment 1 James Ausmus 2018-07-18 00:36:11 UTC
Note - this is also filed in the FreeBSD bug tracker at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229794
Comment 2 Martin Peres 2018-07-24 14:36:06 UTC
Ben,

Not sure what we can do about this bug, given that FreeBSD has a sufficiently-different codebase... Any recommendation?

In the mean time, I lowered the priority as FreeBSD is not a supported platform, but we can still share some expertise to help whoever will debug this issue.
Comment 3 Ben Widawsky 2018-07-24 19:02:42 UTC
@Martin, the codebase shouldn't be that different. The biggest issue is that FreeBSD is currently on a 4.11 based driver (4.15 work is in progress). The diff between FreeBSD's 4.11 and upstream 4.11 is relatively small, but the magic is in a linuxkpi compatibility layer.

I think it's more likely, the issue is in linuxkpi.
Comment 4 Martin Peres 2018-07-27 13:29:58 UTC
@Dan, maybe you could consider testing the same configuration on Linux to verify if this issue would be FreeBSD-specific? I think this would help the FreeBSD devs.

(In reply to Ben Widawsky from comment #3)
> @Martin, the codebase shouldn't be that different. The biggest issue is that
> FreeBSD is currently on a 4.11 based driver (4.15 work is in progress). The
> diff between FreeBSD's 4.11 and upstream 4.11 is relatively small, but the
> magic is in a linuxkpi compatibility layer.
> 
> I think it's more likely, the issue is in linuxkpi.

Thanks for the information. Are you taking over this bug for now then?
Comment 5 Dan MacDonald 2018-08-06 22:56:51 UTC
Created attachment 140987 [details]
tarball of various ubuntu 18.04 log files - xorg, dmidecode, mpv, dmesg etc

tarball of various ubuntu 18.04 log files - xorg, dmidecode, mpv, dmesg etc

With the hardware detailed in the attached logs, I can play the UHD MP4 file smoothly at full UHD res on my UHD display with in-sync audio (both being sent over the DVI to HDMI cable) under the Ubuntu 18.04.1 build of mpv. I would like to be able to do the same under FreeBSD with the same hardware, sound optional. I would be happy just to get the vaapi hardware decoding working under FreeBSD, I'm not as concerned about HDMI audio right now.
Comment 6 Johannes Lundberg 2018-08-07 08:34:34 UTC
(In reply to Dan MacDonald from comment #5)
> Created attachment 140987 [details]
> tarball of various ubuntu 18.04 log files - xorg, dmidecode, mpv, dmesg etc
> 
> tarball of various ubuntu 18.04 log files - xorg, dmidecode, mpv, dmesg etc
> 
> With the hardware detailed in the attached logs, I can play the UHD MP4 file
> smoothly at full UHD res on my UHD display with in-sync audio (both being
> sent over the DVI to HDMI cable) under the Ubuntu 18.04.1 build of mpv. I
> would like to be able to do the same under FreeBSD with the same hardware,
> sound optional. I would be happy just to get the vaapi hardware decoding
> working under FreeBSD, I'm not as concerned about HDMI audio right now.

Hi

I'm the guy doing most work currently on drm drivers for FreeBSD. For any bugs that are not obviously also occurring on Linux, please report an issue at https://github.com/FreeBSDDesktop/kms-drm . You can also reach the FreeBSD graphics team on our mailing list freebsd-x11@freebsd.org or gitter https://gitter.im/FreeBSDDesktop/Lobby .

With our drm-stable-kmod package (which is Linux 4.9) rendering with VAAPI works fine. In later version however, it does not. It's been very hard to track down what is causing this. 

As for the crash I have no idea.. I recommend drm-stable-kmod with modesetting ddx (uninstall xf86-video-intel). However, if the tearing is too bad for your use case, you might have to use the Intel ddx with tearfree option...
Comment 7 Dan MacDonald 2018-08-12 14:25:56 UTC
Hi Johannes

Since my last post I have now completely re-installed my FreeBSD 11.2 server. I have:

* Installed drm-stable-kmod from ports
* Uninstalled xf86-video-intel
* Installed libva-intel-driver, xorg, mate and mpv

At least drm-stable-kmod doesn't crash like drm-next-kmod but vaapi video playback under mpv isn't working. mpv shows the first frame of the video and then pauses.

Under Linux mpv, vaapi gets auto-enabled where it is available but just in case that isn't so under FreeBSD I have also tried forcing vaapi by adding:

vo=vaapi
hwdec=vaapi

to ~/.config/mpv/mpv.conf but it hasn't made any difference.

vainfo acknowledges I have the i965 vaapi driver installed.

Has anyone else ever tested vaapi under 11.2 with drm-stable-kmod and a Braswell GPU and had success?

I was hoping there wasn't going to be any need to build kernel modules to get recent(ish) Intel GPUs to work under 11.2. When might we see the changes from drm-stable-kmod get upstreamed? Any chance that could happen for FreeBSD 12?
Comment 8 Dan MacDonald 2018-08-12 23:23:03 UTC
I've just tried again but with xf86-video-intel installed and it acts very much the same. When I play a video with mpv, it displays the first frame and then stops. Pushing space to play/(un)pause does nothing nor do the frame advance/reverse keys (, and .) function but I can use the left and right arrow keys to skip between stationary 'keyframes' or push q to quit.

Also, I suspect the kernel module is crashing when I boot up with DVI attached. It doesn't boot that way but it boots fine with VGA attached or no display.
Comment 9 Dan MacDonald 2018-08-13 00:07:18 UTC
I'm going to close this now as I've opened a matching bug report where Johannes requested:

https://github.com/FreeBSDDesktop/kms-drm/issues/86


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.