I am using (just updated) Nixos 18.09, but I can't get vaapi driver running.
I have added following packages:
glxinfo vaapiIntel libva-utils libva-full vaapi-intel-hybrid
final goal would be to get accelerated video in chromium or firefox but for now I can't get past the basics:
$ vainfo
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /run/opengl-driver/lib/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Trying to open /usr/lib32/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
In which package is this i965_drv_video.so hidden?
I have a 5. gen Intel gpu so should not that been the right driver:
https://github.com/intel/media-driver
is that missing in nixos at the moment?
Where did you add the packages you mention?
It is not enough to include them in environment.systemPackages, you have to add them in hardware.opengl.extraPackages, e.g.:
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
driSupport32Bit = true;
};
First is there a Wiki entry or something or could we make some? I was sure I miss something, but it's hard to find that lines. (or is it in the documentation dokument and I missed it there?)
Just tested it and works:
libva info: Trying to open /run/opengl-driver/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
my second question is, wouldn't that media-driver for HD Cards not be better? I don't know the difference but they seem to be recommend for > gen 5 ipgs.
Should I create a new bug for the browser site or go on with it here?
You have a point, there is no specific documentation for this. You may explore NixOS options, e.g. https://nixos.org/nixos/options.html#opengl has an example on hardware.opengl.extraPackages. There is also an unofficial user wiki here.
The best way is to contribute this piece of information at the NixOS manual, i.e. make a PR on https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/configuration/x-windows.xml. There is minimal information there for setting up AMD and nVidia cards.
Regarding media-driver, it seems that it not packaged yet in NixOS. I would recommend to create a new issue for that.
I tried to open now chromium with this vaapi or even only dri support I think I get very confusing errors:
export LIBGL_DEBUG=verbose
LD_LIBRARY_PATH=/run/opengl-driver/lib/dri/ chromium --ignore-gpu-blacklist --enable-vaapi
libGL: pci id for fd 137: 8086:1616, driver i965
libGL: OpenDriver: trying /run/opengl-driver/lib/dri/tls/i965_dri.so
libGL: OpenDriver: trying /run/opengl-driver/lib/dri/i965_dri.so
libGL: dlopen /run/opengl-driver/lib/dri/i965_dri.so failed (/nix/store/xzx1bv1d7z4mgg6sg6ly0jx609qvka4x-glibc-2.25-49/lib/libm.so.6: version `GLIBC_2.27' not found (required by /run/opengl-d
river/lib/dri/i965_dri.so))
is glibc not at the right version?
I am not 100% sure it's about that but youtube videos in fullscreen tear like hell and even without fullscreen sometimes.
I had no problem with a older intel 3. gen (thinkpad x220) and a Pentium G4560 both igp. I didn't use 18.09 before so I assume something broke with that release.
Somehow the mesa driver is not linked to glibc-2.27 but instead to 2.25?
Do I understand the problem right? Will tomorow boot with a livecd of fedora or something to compare it. But it's nearly not bearable to watch youtube on that pc.
ok I bootet into Fedora and there was no va-driver installed but it was still better:
Here the main differences:
(fedora)
Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
here nixos:
Canvas: Software only, hardware acceleration unavailable
CheckerImaging: Disabled
Flash: Software only, hardware acceleration unavailable
Flash Stage3D Baseline profile: Software only, hardware acceleration unavailable
Compositing: Software only, hardware acceleration unavailable
Multiple Raster Threads: Unavailable
WebGL: Unavailable
WebGL2: Unavailable
any Ideas what could be the problem here?
[1956:1956:1031/005151.439199:ERROR:gl_context_glx.cc(186)] : Failed to create GL context with glXCreateContextAttribsARB.
[1956:1956:1031/005151.439269:ERROR:gpu_info_collector.cc(51)] : gl::init::CreateGLContext failed
[1956:1956:1031/005151.439279:ERROR:gpu_info_collector.cc(119)] : Could not create context for info collection.
[1956:1956:1031/005151.439291:ERROR:gpu_init.cc(96)] : gpu::CollectGraphicsInfo failed (fatal).
GpuProcessHostUIShim: The GPU process exited with code 1024.
Fedora:
Sandboxed true
GPU0 VENDOR = 0x8086 [Intel Open Source Technology Center], DEVICE= 0x1616 [Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2) ] ACTIVE
vs Nixos:
Sandboxed false
GPU0 VENDOR = 0x0000, DEVICE= 0x0000
ok found the problem myself, just wondered which version I am using, or better said I looked up what the current version of chromium is and its 69 but I was using 61 despite having a current stable version.
Then because I had similar problems before with other programs I knew what's the problem I had a chromium version installed over nix-env and that shadowed the system version, and because it was not updated of course the gpu stuff got not started correctly.
So this bug can be closed except the "need documentation" part from the beginning.
I created a new wiki page: https://nixos.wiki/wiki/Accelerated_Video_Playback
This is still very much broken for me.
The only meaningful combination i could manage to make work is using the iHD driver:
$ LIBVA_DRIVER_NAME=iHD vainfo
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns -1
libva info: User requested driver 'iHD'
libva info: Trying to open /run/opengl-driver/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.4 (libva 2.4.0)
vainfo: Driver version: Intel iHD driver - 1.0.0
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointFEI
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointFEI
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileVP8Version0_3 : VAEntrypointVLD
My original problem was that it's currently impossible to play UHD/4K video without hardware acceleration.
The iHD driver does not properly work with mpv either:
$ LIBVA_DRIVER_NAME=iHD mpv -hwdec=vaapi -hwdec-codecs=all -vo=vaapi 'mymovie'
Currently causes a segfault for me.
@colemickens I used the same configuration you suggested but to no avail :/
I don't think that is related to my bug maybe create a new bug with that and close this one?
@spiderbit Can I recommend closing this issue?
yes
Most helpful comment
I created a new wiki page: https://nixos.wiki/wiki/Accelerated_Video_Playback