Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oneVPL for intel gpus #264621

Merged
merged 2 commits into from
Mar 14, 2024
Merged

oneVPL for intel gpus #264621

merged 2 commits into from
Mar 14, 2024

Conversation

evanrichter
Copy link
Contributor

Description of changes

fresh PR continuing from #242359, sorry for the mass-ping over there :(

ping for the people who seem interested: @Atemu @PJungkamp @J-Swift

outstanding question for @midchildan: should intel-media-sdk be marked deprecated? The upstream repo is archived and suggests transitioning to onevpl

also todo: Atemu says ofborg build failed for onevpl-intel-gpu on aarch-linux, but I can't find the CI run for it. marking as draft until that's re-run and I can debug it

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@evanrichter
Copy link
Contributor Author

currently building/running the passthru tests for ffmpeg-full which is taking a long time on my machine (x86_64-linux), but trying to be as thorough as I can. I'll run nixpkgs-review next

@midchildan
Copy link
Member

midchildan commented Oct 31, 2023

I think it's problematic to completely remove Media SDK because that means dropping support for CPUs older than 3 years.

My preference would be to have oneVPL dispatch to Media SDK and make the Media SDK derivation private to oneVPL. Intel mentions an unspecified security issue with Media SDK in their deprecation notice, so we could make an option that allows security conscious users to disable Media SDK dispatch.

@midchildan
Copy link
Member

ffmpeg is the only package in Nixpkgs that uses Media SDK, so I'm assuming that removing Media SDK from the top level package set would largely go unnoticed as long as ffmpeg could dispatch to it.

@PJungkamp
Copy link
Contributor

Here's a log for the build failure of intel-media-sdk: log.txt

As media SDK is only needed to support x86 CPUs we should only have oneVPL depend on it on x86_64. oneVPL itself should also be packaged for aarch64 as it may be used with intel dedicated graphics.

@evanrichter
Copy link
Contributor Author

the cause of onevpl-intel-gpu being broken on aarch64-linux is this part of upstream's cmake:

add_library(mfx_require_sse4_properties INTERFACE)

if (CMAKE_C_COMPILER_ID MATCHES Intel)
  target_compile_options(mfx_require_sse4_properties
    INTERFACE
      $<$<PLATFORM_ID:Windows>: /arch:sse4.2>
      $<$<PLATFORM_ID:Linux>:   -xsse4.2>
    )
else()
  target_compile_options(mfx_require_sse4_properties
    INTERFACE
      # on Windows MSVC SSE4.2 supported by default
      $<$<PLATFORM_ID:Linux>:   -msse4.2>
    )
endif()

which goes beyond my cmake ability to patch. I agree that aarch64-linux hosts should be able to use this intel gpu driver, but obviously intel has been narrow-minded in their implementation as of now :)

I marked this driver as broken for aarch64 for now

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ffmpeg part LGTM

pkgs/development/libraries/oneVPL-intel-gpu/default.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/ffmpeg/generic.nix Outdated Show resolved Hide resolved
@evanrichter
Copy link
Contributor Author

My preference would be to have oneVPL dispatch to Media SDK and make the Media SDK derivation private to oneVPL. Intel mentions an unspecified security issue with Media SDK in their deprecation notice, so we could make an option that allows security conscious users to disable Media SDK dispatch.

I think that's a great next step but this PR is "big" enough to me (not in lines changed, just in stepping out of my comfort zone with packages that affect lots of users). I can try a draft of that change after if that's alright

@evanrichter evanrichter marked this pull request as ready for review November 1, 2023 16:52
@ofborg ofborg bot requested a review from Atemu November 1, 2023 17:33
@Atemu
Copy link
Member

Atemu commented Nov 1, 2023

Note that, while you are expected to do reasonable QA on your own, your PR does not have to be perfect. If we find out later that this breaks something unforseen, we can always revert it again (or otherwise fix it). That's one of the purposes of the unstable channel.

Obviously we'd prefer not to have to do that but it wouldn't be the end of the world either.

@evanrichter

This comment was marked as off-topic.

@Atemu

This comment was marked as off-topic.

@evanrichter

This comment was marked as off-topic.

@Atemu

This comment was marked as off-topic.

@evanrichter

This comment was marked as off-topic.

@Atemu

This comment was marked as off-topic.

@RaHoni
Copy link
Contributor

RaHoni commented Dec 4, 2023

Are there any updates on this? I would love to switch my desktop to NixOS but need to encode av1 with my GPU. Or can I contribute something?

@stereomato
Copy link

yeah, it seems this died after a month..

@evanrichter
Copy link
Contributor Author

Feel free to use this as it is, it is working for me :)

You can take this branch as an extra flake input and apply an overlay for just the packages I added or changed.

If they need to be updated just let me know

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a rebase for ffmpeg 6.1.

pkgs/development/libraries/ffmpeg/generic.nix Outdated Show resolved Hide resolved
Comment on lines 21 to 38
# For forward compatibility with oneVPL.
# To ensure the VPL backend is dispatched at runtime, export INTEL_MEDIA_RUNTIME=ONEVPL
# See https://github.com/Intel-Media-SDK/MediaSDK#media-sdk-support-matrix
runtimeInputs = [ oneVPL ];

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means it still works on older GPUs but it uses oneVPL on newer ones, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it only uses oneVPL at runtime if the environment variable INTEL_MEDIA_RUNTIME is ONEVPL

@leoluk leoluk mentioned this pull request Dec 5, 2023
13 tasks
@ofborg ofborg bot requested a review from Atemu December 5, 2023 21:08
@RyanGibb
Copy link
Contributor

I've made a PR to upstream the libvpl patch here: #291559

evanrichter and others added 2 commits March 7, 2024 10:24
Co-authored-by: Evan Richter <evanjrichter@gmail.com>
@evanrichter evanrichter force-pushed the libvpl-for-intel-gpu branch 2 times, most recently from 030a8a4 to 88add7e Compare March 13, 2024 16:23
@@ -92,6 +92,7 @@
, withVmaf ? withFullDeps && !stdenv.isAarch64 && lib.versionAtLeast version "5" # Netflix's VMAF (Video Multi-Method Assessment Fusion)
, withVoAmrwbenc ? withFullDeps && withVersion3 # AMR-WB encoder
, withVorbis ? withHeadlessDeps # Vorbis de/encoding, native encoder exists
, withVpl ? false # Hardware acceleration via intel libvpl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much extra closure size would this be if you enabled it now that the driver bit is impure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showing just the different lines:

# withMfx
/nix/store/556zw392nqnc0r8fg9n7yid1w920zd80-intel-media-sdk-23.2.2                 	  28.8M	  85.8M
/nix/store/mjndrx4agd3l69z4l0b98vv18dfsn9kb-ffmpeg-full-6.1-data                   	 264.9K	 264.9K
/nix/store/ndwfmpylljb6hjcpy6iz4557akc9ffmp-ffmpeg-full-6.1-lib                    	  27.7M	   1.3G
/nix/store/9ryljr6yh38sssfg4ajy3pv1c089xwzf-ffmpeg-full-6.1-bin                    	 727.2K	   1.3G

# withVpl
/nix/store/d8w5qfswmgxcjqwnmqw2v9r8amrvdlpb-xgcc-13.2.0-libgcc                     	 155.8K	 155.8K
/nix/store/vqvbn2z8wyrjwvayjb2vy5krhh1kis9b-libunistring-1.1                       	   1.7M	   1.7M
/nix/store/krqp9wj3rgalmqv04y0sqw987mxsnddn-libidn2-2.3.7                          	 352.7K	   2.1M
/nix/store/ksk3rnb0ljx8gngzk19jlmbjyvac4hw6-glibc-2.38-44                          	  28.9M	  31.1M
/nix/store/4vzal97iq3dmrgycj8r0gflrh51p8w1s-bash-5.2p26                            	   1.5M	  32.6M
/nix/store/alxp4kb0dgfczqwd7xfrpflhq50w0wck-gcc-13.2.0-libgcc                      	 155.8K	 155.8K
/nix/store/pp0jsd045xvfsz60kpbkfxbs9pbpk8z5-gcc-13.2.0-lib                         	   8.7M	  39.9M
/nix/store/b7gaf7alc4qjymv1mz79cshsayf1w20s-libvpl-2.10.1                          	   1.1M	  42.5M
/nix/store/vcyijj6xrw3acjphyb0sji1klz4xyslf-ffmpeg-full-6.1-data                   	 264.9K	 264.9K
/nix/store/smhwvfrq7j5khsk8761qiyryn5lvp7qw-ffmpeg-full-6.1-lib                    	  27.8M	   1.3G
/nix/store/rhmmr863zwlrxf8pvgfixml63zl87iwd-ffmpeg-full-6.1-bin                    	 727.2K	   1.3G

and when I change to withVpl for my full system closure it's a 26 M improvement:

<<< /run/current-system
>>> /nix/store/r0frim4jr544rkh0fxyk7rsbd1hmqr5z-nixos-system-coffee-23.11.20240308.2be119a
Version changes:
[C.]  #1  bash  5.2-p15 x2, 5.2-p21 x2, 5.2p26 -> 5.2-p15 x2, 5.2-p21 x2, 5.2p26 x2
Added packages:
[A.]  #1  libvpl  2.10.1
Removed packages:
[R.]  #1  intel-media-sdk  23.2.2
Closure size: 2763 -> 2764 (24 paths added, 23 paths removed, delta +1, disk usage -26.2MiB).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! Once GPUs only supported by MFX are sufficiently legacy (or if ffmpeg were to support both), I see nothing blocking its enablement then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for all your help getting this PR merged! 😄

@Atemu Atemu merged commit cd48c48 into NixOS:staging Mar 14, 2024
23 checks passed
@huantianad
Copy link
Contributor

In order to have the most optimal setup for hardware acceleration with a recent Intel CPU then, is intel-media-driver the only package I should be adding to my open gl package list?

@evanrichter
Copy link
Contributor Author

evanrichter commented Mar 15, 2024

In order to have the most optimal setup for hardware acceleration with a recent Intel CPU then, is intel-media-driver the only package I should be adding to my open gl package list?

You actually just want onevpl-intel-gpu instead:

  hardware.opengl = {
    enable = true;
    extraPackages = with pkgs; [
      onevpl-intel-gpu
    ];
  };

and you want to override your ffmpeg to use vpl:

        ffmpeg-full = prev.ffmpeg-full.override {
          withVpl = true; withMfx = false;
        };

and that should be it, just check that this pr is included in your nixpkgs too: #291559 since this is upstream now, that's covered :)

@huantianad
Copy link
Contributor

Ah OK, should this work for any programs that are dependent on intel media driver or media sdk as well? I did see that there was mention of it having backwards compat so it would.

@programotuojes
Copy link

This probably depends on the use case, but for transcoding in Jellyfin, intel-media-driver was still required for me. Without it, ffmpeg errored out:

[AVHWDeviceContext @ 0x1ca9ac0] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value 'vaapi=va:,kernel_driver=i915,driver=iHD' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error

Additionally, since I wanted to enable regular tone mapping in Jellyfin (the VPP tone mapping was too dark for me), I had to add both intel-compute-runtime and intel-ocl. Only adding intel-ocl resulted in this error:

[AVHWDeviceContext @ 0x1678d00] Failed to get number of OpenCL platforms: -1001.
Device creation failed: -19.
Failed to set value 'opencl=ocl@va' for option 'init_hw_device': No such device
Error parsing global options: No such device

This is the config I use while this PR is still underway. Mostly copied from here.

boot.kernelParams = [ "i915.enable_guc=3" ];

nixpkgs.config.packageOverrides = prev: {
  ffmpeg_6 = prev.ffmpeg_6.overrideAttrs (old: rec {
    configureFlags =
      # Remove deprecated Intel Media SDK support
      (builtins.filter (e: e != "--enable-libmfx") old.configureFlags)
      # Add Intel VPL support
      ++ [ "--enable-libvpl" ];
    buildInputs = old.buildInputs ++ [
      # VPL dispatcher
      pkgs-unstable.libvpl
    ];
  });
};

hardware.opengl = {
  enable = true;
  extraPackages = with pkgs; [
    (pkgs.callPackage ../../pkgs/onevpl-intel-gpu.nix { })
    intel-media-driver
    intel-compute-runtime
    intel-ocl
  ];
};

@evanrichter evanrichter deleted the libvpl-for-intel-gpu branch March 15, 2024 21:16
@Atemu
Copy link
Member

Atemu commented Mar 16, 2024

@programotuojes jellyfin-ffmpeg is separate from ffmpeg. It's a variant of ffmpeg_6-full. If you need VPL in jellyfin, you need to override jellyfin-ffmpeg. Please also note that you should also use overlays rather than packageOverrides.

@huantianad
Copy link
Contributor

Ah OK, should this work for any programs that are dependent on intel media driver or media sdk as well? I did see that there was mention of it having backwards compat so it would.

In addition, I assume that it will use the same entry point as the older intel media driver and sdk, so LIBVA_DRIVER_NAME = "iHD" should still be used?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/jellyfin-docker-container-on-intel-gpu-opencl-devices-not-found/42119/1

@TimoVerbrugghe
Copy link

This probably depends on the use case, but for transcoding in Jellyfin, intel-media-driver was still required for me. Without it, ffmpeg errored out:

[AVHWDeviceContext @ 0x1ca9ac0] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value 'vaapi=va:,kernel_driver=i915,driver=iHD' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error

Additionally, since I wanted to enable regular tone mapping in Jellyfin (the VPP tone mapping was too dark for me), I had to add both intel-compute-runtime and intel-ocl. Only adding intel-ocl resulted in this error:

[AVHWDeviceContext @ 0x1678d00] Failed to get number of OpenCL platforms: -1001.
Device creation failed: -19.
Failed to set value 'opencl=ocl@va' for option 'init_hw_device': No such device
Error parsing global options: No such device

This is the config I use while this PR is still underway. Mostly copied from here.

boot.kernelParams = [ "i915.enable_guc=3" ];

nixpkgs.config.packageOverrides = prev: {
  ffmpeg_6 = prev.ffmpeg_6.overrideAttrs (old: rec {
    configureFlags =
      # Remove deprecated Intel Media SDK support
      (builtins.filter (e: e != "--enable-libmfx") old.configureFlags)
      # Add Intel VPL support
      ++ [ "--enable-libvpl" ];
    buildInputs = old.buildInputs ++ [
      # VPL dispatcher
      pkgs-unstable.libvpl
    ];
  });
};

hardware.opengl = {
  enable = true;
  extraPackages = with pkgs; [
    (pkgs.callPackage ../../pkgs/onevpl-intel-gpu.nix { })
    intel-media-driver
    intel-compute-runtime
    intel-ocl
  ];
};

@programotuojes: it's interesting that you say that you had to both add intel-ocl and intel-compute-runtime as opengl extra packages. I tried this as well because I'm trying to run jellyfin opencl tone mapping as well (however inside of a docker container, not as a nixos service defined in configuration.nix). Added your PR, intel-ocl and intel-compute-runtime but jellyfin tone mapping still failing for me with the same error.

Additionally, if I do clinfo on the nixos machine, it seems to detect openCL for the CPU, but not on the GPU (instead of f.e. on my N5105 machine where it detects 2 opencl platforms, 1 CPU and GPU).

When you do clinfo, your machine with the PR applied shows 2 opencl platforms?

N100 clinfo output:

[nix-shell:/home/odd]# clinfo
Number of platforms                               1
  Platform Name                                   Intel(R) OpenCL
  Platform Vendor                                 Intel(R) Corporation
  Platform Version                                OpenCL 1.2 LINUX
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_fp64
  Platform Extensions function suffix             INTEL

  Platform Name                                   Intel(R) OpenCL
Number of devices                                 1
  Device Name                                     Intel(R) N100
  Device Vendor                                   Intel(R) Corporation
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 1.2 (Build 475)
  Driver Version                                  1.2.0.475
  Device OpenCL C Version                         OpenCL C 1.2
  Device Type                                     CPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               4
  Max clock frequency                             0MHz
  Device Partition                                (core)
    Max number of sub-devices                     4
    Supported partition types                     by counts, equally, by names (Intel)
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             8192x8192x8192
  Max work group size                             8192
  Preferred work group size multiple (kernel)     128
  Preferred / native vector sizes
    char                                                 1 / 32
    short                                                1 / 16
    int                                                  1 / 8
    long                                                 1 / 4
    half                                                 0 / 0        (n/a)
    float                                                1 / 8
    double                                               1 / 4        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              12512915456 (11.65GiB)
  Error Correction support                        No
  Max memory allocation                           3128228864 (2.913GiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        524288 (512KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             480
    Max size for 1D images from buffer            195514304 pixels
    Max 1D or 2D image array size                 2048 images
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 480
    Max number of write image args                480
  Local memory type                               Global
  Local memory size                               32768 (32KiB)
  Max number of constant args                     480
  Max constant buffer size                        131072 (128KiB)
  Max size of kernel argument                     3840 (3.75KiB)
  Queue properties
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Local thread execution (Intel)                Yes
  Prefer user sync for interop                    No
  Profiling timer resolution                      1ns
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
    SPIR versions                                 1.2
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_fp64

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Intel(R) OpenCL
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [INTEL]
  clCreateContext(NULL, ...) [default]            Success [INTEL]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 Intel(R) OpenCL
    Device Name                                   Intel(R) N100
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  Success (1)
    Platform Name                                 Intel(R) OpenCL
    Device Name                                   Intel(R) N100
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 Intel(R) OpenCL
    Device Name                                   Intel(R) N100

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.2
  ICD loader Profile                              OpenCL 3.0

@TimoVerbrugghe
Copy link

Nevermind, found the problem.

Apparently there is an issue with intel-compute-runtime (which provides opencl libraries for intel GPU) on the latest 6.8 linux kernel: intel/compute-runtime#710

I was running that kernel and that’s why the GPU did not show up under clinfo and opencl didn’t work in the jellyfin container.

Temporarily downgrading to the 6.7 kernel fixed the issue.

@RyanGibb
Copy link
Contributor

RyanGibb commented Jun 7, 2024

Upgrading to 24.05 has caused hardware transcoding to break for me.

/nix/store/ilsa2b1fgfsdhamg3ga0a5x5jljb5841-jellyfin-ffmpeg-6.0.1-6-bin/bin/ffmpeg -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device qsv=qs@va -hwaccel qsv -hwaccel_output_format qsv -i input.mp4 -c:v h264_qsv output.mp4#
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.2.0 (GCC)
  configuration: --disable-static --prefix=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-jellyfin-ffmpeg-6.0.1-6 --target_os=linux --arch=x86_64 --pkg-config=pkg-config --enable-gpl --enable-version3 --disable-nonfree --disable-static --enable-shared --enable-pic --disable-thumb --disable-small --enable-runtime-cpudetect --enable-gray --enable-swscale-alpha --enable-hardcoded-tables --enable-safe-bitstream-reader --enable-pthreads --disable-w32threads --disable-os2threads --enable-network --enable-pixelutils --datadir=/nix/store/p6cyy4la6n66d134z25n1d4g0q4dc91x-jellyfin-ffmpeg-6.0.1-6-data/share/ffmpeg --enable-ffmpeg --enable-ffplay --enable-ffprobe --bindir=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-jellyfin-ffmpeg-6.0.1-6-bin/bin --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avutil --enable-postproc --enable-swresample --enable-swscale --libdir=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-jellyfin-ffmpeg-6.0.1-6-lib/lib --incdir=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-jellyfin-ffmpeg-6.0.1-6-dev/include --enable-doc --enable-htmlpages --enable-manpages --mandir=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-jellyfin-ffmpeg-6.0.1-6-man/share/man --enable-podpages --enable-txtpages --docdir=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-jellyfin-ffmpeg-6.0.1-6-doc/share/doc/ffmpeg --enable-alsa --enable-libaom --disable-appkit --enable-libass --disable-audiotoolbox --disable-avfoundation --enable-avisynth --enable-libbluray --enable-libbs2b --enable-bzlib --enable-libcaca --enable-libcelt --enable-chromaprint --enable-libcodec2 --disable-coreimage --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-libdav1d --enable-libdc1394 --enable-libdrm --disable-libfdk-aac --enable-ffnvcodec --enable-libflite --enable-fontconfig --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libfribidi --enable-libgme --enable-gnutls --enable-libgsm --enable-iconv --enable-libjack --enable-libjxl --enable-ladspa --enable-lzma --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-nvdec --enable-nvenc --enable-openal --enable-opencl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-opengl --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librtmp --enable-libsmbclient --enable-sdl2 --enable-libshaderc --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-librsvg --enable-libsvtav1 --disable-libtensorflow --enable-libtheora --enable-libv4l2 --enable-v4l2-m2m --enable-vaapi --enable-vdpau --disable-libvpl --disable-videotoolbox --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-vulkan --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxcb --enable-libxcb-shape --enable-libxcb-shm --enable-libxcb-xfixes --enable-xlib --enable-libxml2 --enable-libxvid --enable-libzimg --enable-zlib --enable-libzmq --disable-debug --enable-optimizations --disable-extra-warnings --disable-stripping --extra-version=Jellyfin --disable-ptx-compression
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[AVHWDeviceContext @ 0xbff280] Error initializing an MFX session: -3.
Device creation failed: -1313558101.
Failed to set value 'qsv=qs@va' for option 'init_hw_device': Unknown error occurred
Error parsing global options: Unknown error occurred

Has anyone else experienced this?

@eclairevoyant
Copy link
Member

@RyanGibb please create a new issue with config details

@RyanGibb
Copy link
Contributor

RyanGibb commented Jun 8, 2024

Ah, looks like this commit changed ffmpeg_6-full to not override

This is the config I use while this PR is still underway. Mostly copied from here.

Changing overlay to:

  nixpkgs.config.packageOverrides = prev: {
    jellyfin-ffmpeg = prev.jellyfin-ffmpeg.overrideAttrs (_: {
      withVpl = true;
    });
  };

Fixes this. But with #315425 we can remove the overlay and use VA-API as a hardware transcoding method (e.g. in jellfin's settings), which will use oneVPL under the hood.

RyanGibb added a commit to RyanGibb/nixos that referenced this pull request Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet