Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Requires CPU feature SSE41 but the current block only supports None

Discussion in 'Entity Component System' started by BigRookGames, Jun 12, 2022.

  1. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    328
    I am getting the current error when building:

    "The instruction Unity.Burst.Intrinsics.X86.Sse4_1.min_epi8(Unity.Burst.Intrinsics.v128 a, Unity.Burst.Intrinsics.v128 b) requires CPU feature SSE41 but the current block only supports None and the target CPU for this method is SSE2AndLower. Consider enclosing the usage of this instruction with an if test for the appropriate IsXXXSupported property."

    which started happening once implementing Occlusion Culling on Hybrid.

    The statements that it refers to are inside of #if MOC_USE_SSE41

    Does anyone have any clues as to what might be causing this?

    Edit_______________________
    I have SSE4 enabled for 64-bit architecture in the settings (set to Everything), and am using a capable CPU, but still cannot seem to build this out.
     
    Last edited: Jun 13, 2022
  2. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    328
    I got some help and the problem was that I was using a assembly define (#if MOC_USE_SSE41) to filter for SSE4 but that is stripped out before it gets to Burst. It needs to be defined in an if statement like:

    if (X86.Sse4_1.IsSse41Supported) {
    // use it here
    }
     
  3. kobechenyang

    kobechenyang

    Joined:
    Jan 16, 2013
    Posts:
    5
    hmm I got a same error when building for windows x86_64
    Code (CSharp):
    1. The instruction `Unity.Burst.Intrinsics.X86.Sse4_1.testz_si128(Unity.Burst.Intrinsics.v128 a, Unity.Burst.Intrinsics.v128 b)` requires CPU feature `SSE41` but the current block only supports `None` and the target CPU for this method is `SSE2AndLower`. Consider enclosing the usage of this instruction with an if test for the appropriate `IsXXXSupported` property.
    2.  
    coming from `Library\PackageCache\com.unity.rendering.hybrid@0.51.0-preview.32\Unity.Rendering.Hybrid\Occlusion\BurstIntrinsics\MOC.cs`
     
    Last edited: Jun 16, 2022
  4. athert

    athert

    Joined:
    Dec 31, 2012
    Posts:
    36
    I got this error today too when i tried to build game with occlusion enabled. Does anyone know what to do with that?
     
  5. Sponge2k

    Sponge2k

    Joined:
    Sep 22, 2021
    Posts:
    4
    Not sure if you solved in the end (please post it next time) but the solution is that you need to add an if statement to check for it. not an compile one #if, a normal if.

    For example:


    Code (CSharp):
    1.            
    2. // We need this at compile time!
    3.             if (Avx.IsAvxSupported == false)
    4.             {
    5.                 min = 0;
    6.                 max = 0;
    7.  
    8.                 return;
    9.             }
    Now it will compile :).