Troubleshooting SEHException and AVX Support in IronOCR
Unhandled exception: System.Runtime.InteropServices.SEHException
This issue is commonly encountered on machines using older Xeon, Celeron, Pentium, or Atom processors that lack AVX support.
Support for non-AVX processors was added in IronOcr version 2022.8.7804, so please upgrade to a later release.
// Example: Checking AVX support programmatically in C#
using System;
class ProcessorFeatures
{
// Main method to check AVX support
static void Main()
{
// Check if the machine's processor supports AVX
if (IsAvxSupported())
{
Console.WriteLine("AVX is supported.");
}
else
{
Console.WriteLine("AVX is not supported. Consider updating IronOcr to the latest version that supports non-AVX processors.");
}
}
// Function to determine if AVX is supported
static bool IsAvxSupported()
{
return System.Runtime.Intrinsics.X86.Avx.IsSupported;
}
}
// Example: Checking AVX support programmatically in C#
using System;
class ProcessorFeatures
{
// Main method to check AVX support
static void Main()
{
// Check if the machine's processor supports AVX
if (IsAvxSupported())
{
Console.WriteLine("AVX is supported.");
}
else
{
Console.WriteLine("AVX is not supported. Consider updating IronOcr to the latest version that supports non-AVX processors.");
}
}
// Function to determine if AVX is supported
static bool IsAvxSupported()
{
return System.Runtime.Intrinsics.X86.Avx.IsSupported;
}
}
In this example code, we use the System.Runtime.Intrinsics.X86.Avx.IsSupported
property to determine if the processor supports AVX instructions. If AVX is not supported, it's advisable to ensure you are using a version of IronOcr that includes support for non-AVX processors.