Is accelerated graphics possible with i915kms on FreeBSD 13 and 14 [32-bit]?

Hardware Graphics acceleration for decoding and watching video will not work as your video card doesn't have hardware capabilities to decode VC,1VP9,AV1 codecs. It's all done on your CPU which can't keep up with 720p or 1080p.
I'm testing with ~360p/480p videos, below 720p for sure.

I accept the limitations of the integrated graphics. I know it might not support latest codecs. But even with software renderer it should not be that bad. (It didn't even play the video, except when I installed my modded mesa-classic ports. Even then it struggles on fullscreen.) On 12.4 32-bit it used to play videos on fullscreen just fine. So the slowdowns does not seem to be due to hardware limitations.

xdriinfo, xvinfo, glxinfo outputs indicate that graphics drivers are not being used on 14 32-bit and is using software renderer. Drivers are working as expected on 14 64-bit with video playing without issues on fullscreen.

If you want to see it by yourself install multimedia/vdpauinfo pkg install vdpauinfo and run it. in terminal then post back here the output of "Decoder capabilities:" section for all video codecs.
As far as I know vdpau is for nvidia/amd cards. I don't have any separate graphics card except Intel integrated graphics. But still here is the output (on 14 64-bit):

Code:
$ vdpauinfo
display: :0   screen: 0
Failed to open VDPAU backend Shared object "libvdpau_va_gl.so" not found, required by "vdpauinfo"
Error creating VDPAU device: 1

The only think that you can use on it is OpenGL for GL_Renderer you can check the capabilities via glinfo or glxinfo and drm_info
I'm attaching the outputs from 14 64-bit in case it is useful in future.

Let me know if I can check anything else on 64-bit. I'll soon be replacing it with 32-bit again to continue troubleshooting.
 

Attachments

  • gl-drm_outputs-14-64bit-thinkpadx201i.txt
    63.5 KB · Views: 71
It's for Intel,NV and AMD. You are missing libvdpau_va_gl

Install those:

graphics/drm-510-kmod
graphics/drm_info
multimedia/gstreamer1-libav
multimedia/gstreamer1-plugins-core
multimedia/gstreamer1-plugins-msdk
audio/gstreamer1-plugins-pulse
multimedia/gstreamer1-plugins-svt-av1
multimedia/gstreamer1-vaapi
multimedia/libgav1
multimedia/libva-glx
multimedia/libva-intel-driver
multimedia/libva-utils
multimedia/libvdpau-va-gl
multimedia/mpv
multimedia/vdpauinfo
audio/virtual_oss
audio/virtual_oss_ctl
 
Install those:
I'm still on 14 64-bit. Will have to test later on 32-bit if it does any good. I did a:

Code:
pkg install -y drm-510-kmod drm_info gstreamer1-libav gstreamer1-plugins-core gstreamer1-plugins-msdk gstreamer1-plugins-pulse gstreamer1-plugins-svt-av1 gstreamer1-vaapi libgav1 libva-glx libva-intel-driver libva-utils libvdpau-va-gl mpv vdpauinfo virtual_oss virtual_oss_ctl

Then did a reboot to be sure. Here is the output now:

Code:
$ uname -rmo
FreeBSD 14.0-RELEASE amd64
$ vdpauinfo 
display: :0   screen: 0
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_20
/usr/local/lib/dri/hybrid_drv_video.so init failed
Not using hybrid_drv_video.so
libva info: va_openDriver() returns 0
API version: 1
Information string: OpenGL/VAAPI backend for VDPAU

Video surface:

name   width height types
-------------------------------------------
420     4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16 
422     4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16 
444     4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16 
420_16  4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16 
422_16  4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16 
444_16  4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16 

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                   --- not supported ---
MPEG2_MAIN                     --- not supported ---
H264_BASELINE                  51 16384  2048  2048
H264_MAIN                      51 16384  2048  2048
H264_HIGH                      51 16384  2048  2048
VC1_SIMPLE                     --- not supported ---
VC1_MAIN                       --- not supported ---
VC1_ADVANCED                   --- not supported ---
MPEG4_PART2_SP                 --- not supported ---
MPEG4_PART2_ASP                --- not supported ---
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE      51 16384  2048  2048
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
VP9_PROFILE_0                  --- not supported ---
VP9_PROFILE_1                  --- not supported ---
VP9_PROFILE_2                  --- not supported ---
VP9_PROFILE_3                  --- not supported ---
HEVC_MAIN                      --- not supported ---
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---
HEVC_MAIN_444_10               --- not supported ---
HEVC_MAIN_444_12               --- not supported ---
AV1_MAIN                       --- not supported ---
AV1_HIGH                       --- not supported ---
AV1_PROFESSIONAL               --- not supported ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8          8192  8192    -  
R8G8B8A8          8192  8192    -  
R10G10B10A2       8192  8192    -  
B10G10R10A2       8192  8192    -  
A8                8192  8192    -  

Bitmap surface:

name              width height
------------------------------
B8G8R8A8          8192  8192
R8G8B8A8          8192  8192
R10G10B10A2       8192  8192
B10G10R10A2       8192  8192
A8                8192  8192

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             -
DEINTERLACE_TEMPORAL_SPATIAL     -
INVERSE_TELECINE                 -
NOISE_REDUCTION                  -
SHARPNESS                        -
LUMA_KEY                         -
HIGH QUALITY SCALING - L1        -
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              -  
VIDEO_SURFACE_HEIGHT             -  
CHROMA_TYPE                      -  
LAYERS                           -  

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 -  
CSC_MATRIX                       -  
NOISE_REDUCTION_LEVEL            -  
SHARPNESS_LEVEL                  -  
LUMA_KEY_MIN_LUMA                -  
LUMA_KEY_MAX_LUMA                -  


libvdpau-va-gl: Device::Resource::~Resource(): caught exception
Abort trap
 
Ok so your Video card have hardware decoding of H264.

You can test it via mpv. Here's a sample trailer in H264 link

You can try it via
mpv --hwdec=auto video.mp4
 
You can test it via mpv. Here's a sample trailer in H264 link

You can try it via
mpv --hwdec=auto video.mp4
Is the specific video important? If not, earlier I converted the 360p video I was testing with to h264 by:
Code:
ffmpeg -i video.mkv -c:v libx264 -c:a copy -vf format=yuv420p -profile:v baseline video-h264.mkv

Running it on terminal (and closing mpv after a while) showed this:
Code:
$ mpv --hwdec=auto video-h264.mkv
 (+) Video --vid=1 (*) (h264 640x360 30.000fps)
 (+) Audio --aid=1 (*) (aac 6ch 48000Hz)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
[vo/gpu] Disabling scaler #0 lanczos (GLSL version too old).
[vo/gpu] Disabling scaler #1 hermite (GLSL version too old).
[vo/gpu] Disabling linear/sigmoid scaling (GLSL version too old).
[vo/gpu] correct-downscaling requires non-bilinear scaler.
Cannot load libcuda.so.1
/usr/local/lib/dri/hybrid_drv_video.so init failed
Not using hybrid_drv_video.so
[ffmpeg] AVHWFramesContext: Failed to create surface: 14 (the requested RT Format is not supported).
[ffmpeg] AVHWFramesContext: Unable to allocate a surface from internal buffer pool.
Using hardware decoding (vaapi).
AO: [oss] 48000Hz 5.1(alsa) (5.1) 6ch s32
VO: [gpu] 640x360 vaapi[nv12]
Exiting... (Quit)
$ uname -rmo
FreeBSD 14.0-RELEASE amd64
 
A good way to demonstrate that graphics even works is with a screenshot... and I haven't seen one in this thread.

If a screenshot taken straight on the machine is difficult to move to the Forums, you can use MobaXterm to SSH into the machine, start, say, XTerm, and take a screenshot of that.
 
A good way to demonstrate that graphics even works is with a screenshot... and I haven't seen one in this thread.
Commands I showed output to can't be run without X. Running glxinfo on tty would show an error like> "unable to open display". Utilities like xdriinfo would show something similar. So it should mean that a graphical desktop is already running.

I'm still on 14 64-bit and would soon replace it with 32-bit to troubleshoot the issue. I don't know if there is any point in sharing a screenshot from this install since graphics acceleration under 64-bit is working. Maybe for documentation purpose. I attached one.
 

Attachments

  • twm-xterm-freebsd-14-thinkpad-x201i-64bit_.png
    twm-xterm-freebsd-14-thinkpad-x201i-64bit_.png
    8.5 KB · Views: 75
Commands I showed output to can't be run without X. Running glxinfo on tty would show an error like> "unable to open display". Utilities like xdriinfo would show something similar. So it should mean that a graphical desktop is already running.
yeah, true. Brain fart on my part, at least in part because I'm on recent AMD graphics, and they never gave me any trouble, I just follow the graphics wiki (by now in the Handbook), and it worked so well, I never had to troubleshoot any kind of GPU errors since 2017, at least. So I just run a KDE desktop, and don't worry about a thing... I ended up forgetting how to troubleshoot Xorg and extract useful info from that.

Xorg may be getting long in the tooth, and on its way out in favor of Wayland, but even with that backdrop, it's still something that works...

😅

But yeah, piping text with netcat and termbin is easier than piping images... :p
 
because I'm on recent AMD graphics, and they never gave me any trouble, I just follow the graphics wiki (by now in the Handbook), and it worked so well, I never had to troubleshoot any kind of GPU errors since 2017, at least.
Similar on my end. I usually install some package and it just works. Don't even have to touch xorg.conf. This is a first that I had that much trouble with an Intel graphics. With Intel graphics!! Unbelievable!! The most supported card on *nix platforms and this is what I get? Totally unexpected.

And more unexpected is that people started saying to me to replace the machine with something new, without fixing the issue. In my life of browsing all the community/forums of other FOSS projects when troubleshooting various other issues I rarely came across such a weird request.

Xorg may be getting long in the tooth, and on its way out in favor of Wayland, but even with that backdrop, it's still something that works...

😅
Interested in that too. I like wayland for the most part. Would like to run sway if I get acceleration on 32-bit. In my experience, without acceleration only Weston can run, not any other wayland wm.

So I just run a KDE desktop, and don't worry about a thing...
How is KDE on wayland? I tried it years ago on Arch and it was not pretty back then. It started glitching so bad I installed lxqt and went with it! I hope it has gotten better.
 
And more unexpected is that people started saying to me to replace the machine with something new, without fixing the issue. In my life of browsing all the community/forums of other FOSS projects when troubleshooting various other issues I rarely came across such a weird request.
Why are you calling it a request when it's actually a suggested solution to your problem?

I did notice that there's fewer and fewer mentions of older hardware. Yeah, FOSS did look like it's something that works on generally older hardware, but now it looks like it caught up and started running on newer hardware. Heck, I pulled off running KDE on RX 6900 XT back in 2021, when the card was still on top of the market.


How is KDE on wayland? I tried it years ago on Arch and it was not pretty back then. It started glitching so bad I installed lxqt and went with it! I hope it has gotten better.
I pulled it off a few years ago, when there were still a lot of details to line up. It was a glitchy house of cards that was difficult to reproduce. I expect Wayland did get better, but I still have to get my act together and play with it sometime 😅
 
I did notice that there's fewer and fewer mentions of older hardware. Yeah, FOSS did look like it's something that works on generally older hardware, but now it looks like it caught up and started running on newer hardware. Heck, I pulled off running KDE on RX 6900 XT back in 2021, when the card was still on top of the market.
I understand that there are limitations on older hardware introduced by other projects, but this is not the case here.

The problem is that the issues are only on FreeBSD (32bit). Linux 32-bit has no problems with acceleration on this ThinkPad. Since FreeBSD uses the Linux drivers through LinuxKPI and nobody can tell me if Intel implemented some limitations so that it can't be run on FreeBSD, it seems FreeBSD has made changes which broke things. Acceleration used to work on 12.4 32-bit on this machine.

In which case it is not my fault. It is not my hardware's fault either.

Instead of saying that "someone did something which broke it", telling me to change hardware, to use windoz (happened on another thread) makes me feel weird. Why not admit that there's a bug? Is this the FOSS spirit? And if this is expected from FreeBSD why not mention this in the Handbook? Why not deprecate old hardware similar to how they deprecated 32-bit support?

All this is even before 14 EOL, in the time when i386 is still supported. I wonder what would happen if I posted this after November 30, 2028.
 
qurier your behavior certainly is not FOSS spirit. You are impolite and inappropriately demanding.
Do you think your behavior encourages others to fix thing for you for free in their spare time?
 
All this is even before 14 EOL, in the time when i386 is still supported.
i386 was Tier 1 for 12.x, but Tier 2 for 13.x and 14.x.
committers-guide
Code:
Tier 2 platforms are functional, but less mature FreeBSD platforms. They are not supported
by the security officer, release engineering, and Ports Management Team.

 ・ The ports infrastructure should include basic support for Tier 2
    architectures sufficient to support building ports and packages. This
    includes support for basic packages such as ports-mgmt/pkg, but there is no
    guarantee that arbitrary ports will be buildable or functional.
Support for i386 has been reduced.
freebsd-arch/2023-April/000366.html
 
Last edited:
As a user, I think that it's on me to do my homework and match hardware with the software.

The problem is that the issues are only on FreeBSD (32bit). Linux 32-bit has no problems with acceleration on this ThinkPad. Since FreeBSD uses the Linux drivers through LinuxKPI and nobody can tell me if Intel implemented some limitations so that it can't be run on FreeBSD, it seems FreeBSD has made changes which broke things. Acceleration used to work on 12.4 32-bit on this machine.
Intel doesn't exactly develop its chips with FreeBSD in mind... :rolleyes:

Cheaper Celerons do have certain features disabled that are available in say, an i5. For example, virtualization and multi-core hyperthreading. But - these features are developed by Intel with Windows in mind, frankly.

If graphical acceleration used to work under 12.4-RELEASE i386 on your machine, that is a good starting point.

Deprecating 32-bit support is the same thing as deprecating a whole class of older hardware. Heck, IA64 (which is 64-bit, BTW) is deprecated... :p
 
Back
Top