mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 13:57:14 -04:00
Update workaround for the i915 hang
The issue has been fixed in linux 6.2: https://github.com/torvalds/linux/commit/3f882f2 And the fix was cherry picked into 6.0.18 and 6.1.4 (may be used by debian bookworm). Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
parent
f0faddcc44
commit
f8b8fdace6
@ -35,7 +35,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
private readonly IMediaEncoder _mediaEncoder;
|
private readonly IMediaEncoder _mediaEncoder;
|
||||||
private readonly ISubtitleEncoder _subtitleEncoder;
|
private readonly ISubtitleEncoder _subtitleEncoder;
|
||||||
private readonly IConfiguration _config;
|
private readonly IConfiguration _config;
|
||||||
private readonly Version _minKernelVersioni915Hang = new Version(5, 18);
|
|
||||||
|
// i915 hang was fixed by linux 6.2 (3f882f2)
|
||||||
|
private readonly Version _minKerneli915Hang = new Version(5, 18);
|
||||||
|
private readonly Version _maxKerneli915Hang = new Version(6, 1, 3);
|
||||||
|
private readonly Version _minFixedKernel60i915Hang = new Version(6, 0, 18);
|
||||||
|
|
||||||
private static readonly string[] _videoProfilesH264 = new[]
|
private static readonly string[] _videoProfilesH264 = new[]
|
||||||
{
|
{
|
||||||
@ -1309,7 +1313,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
// which will reduce overhead in performance intensive tasks such as 4k transcoding and tonemapping.
|
// which will reduce overhead in performance intensive tasks such as 4k transcoding and tonemapping.
|
||||||
var intelLowPowerHwEncoding = false;
|
var intelLowPowerHwEncoding = false;
|
||||||
|
|
||||||
// Workaround for linux 5.18+ i915 hang at cost of performance.
|
// Workaround for linux 5.18 to 6.1.3 i915 hang at cost of performance.
|
||||||
// https://github.com/intel/media-driver/issues/1456
|
// https://github.com/intel/media-driver/issues/1456
|
||||||
var enableWaFori915Hang = false;
|
var enableWaFori915Hang = false;
|
||||||
|
|
||||||
@ -1328,18 +1332,25 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
}
|
}
|
||||||
else if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
|
else if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
if (OperatingSystem.IsLinux() && Environment.OSVersion.Version >= _minKernelVersioni915Hang)
|
if (OperatingSystem.IsLinux())
|
||||||
{
|
{
|
||||||
var vidDecoder = GetHardwareVideoDecoder(state, encodingOptions) ?? string.Empty;
|
var ver = Environment.OSVersion.Version;
|
||||||
var isIntelDecoder = vidDecoder.Contains("qsv", StringComparison.OrdinalIgnoreCase)
|
var isFixedKernel60 = ver.Major == 6 && ver.Minor == 0 && ver >= _minFixedKernel60i915Hang;
|
||||||
|| vidDecoder.Contains("vaapi", StringComparison.OrdinalIgnoreCase);
|
var isUnaffectedKernel = ver < _minKerneli915Hang || ver > _maxKerneli915Hang;
|
||||||
var doOclTonemap = _mediaEncoder.SupportsHwaccel("qsv")
|
|
||||||
&& IsVaapiSupported(state)
|
|
||||||
&& IsOpenclFullSupported()
|
|
||||||
&& !IsVaapiVppTonemapAvailable(state, encodingOptions)
|
|
||||||
&& IsHwTonemapAvailable(state, encodingOptions);
|
|
||||||
|
|
||||||
enableWaFori915Hang = isIntelDecoder && doOclTonemap;
|
if (!(isUnaffectedKernel || isFixedKernel60))
|
||||||
|
{
|
||||||
|
var vidDecoder = GetHardwareVideoDecoder(state, encodingOptions) ?? string.Empty;
|
||||||
|
var isIntelDecoder = vidDecoder.Contains("qsv", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| vidDecoder.Contains("vaapi", StringComparison.OrdinalIgnoreCase);
|
||||||
|
var doOclTonemap = _mediaEncoder.SupportsHwaccel("qsv")
|
||||||
|
&& IsVaapiSupported(state)
|
||||||
|
&& IsOpenclFullSupported()
|
||||||
|
&& !IsVaapiVppTonemapAvailable(state, encodingOptions)
|
||||||
|
&& IsHwTonemapAvailable(state, encodingOptions);
|
||||||
|
|
||||||
|
enableWaFori915Hang = isIntelDecoder && doOclTonemap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.Equals(videoEncoder, "h264_qsv", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(videoEncoder, "h264_qsv", StringComparison.OrdinalIgnoreCase))
|
||||||
|
Loading…
Reference in New Issue
Block a user