Able to run on WebGL? (ArgumentException: Kernel 'Transpose' not found)

Hey there,

I read in the documentation that we are able to run WebGL demos with Sentis.

I compiled it to Windows exe and it works correctly but with WebGL I’ve got two errors:

  • Kernel ‘Transpose’ not found
  • ArgumentException: Kernel ‘Transpose’ not found. Rethrow as TypeInitializationException: The type initializer for ‘Unity.Sentis.ComputeShaderSingleton’ threw an exception.

I tried with a BackendType.CPU and BackendType.GPUCompute

How I init sentis:

 /// <summary>
    /// Load the model on awake
    /// </summary>
    void Awake()
    {
        // Load the ONNX model
        runtimeModel = ModelLoader.Load(modelAsset);

        // Create an engine and set the backend as GPU //GPUCompute
        worker = WorkerFactory.CreateWorker(BackendType.CPU, runtimeModel);

        // Create an allocator.
        allocator = new TensorCachingAllocator();

        // Create an operator
        ops = WorkerFactory.CreateOps(BackendType.GPUCompute, allocator);
    }

Do you know why? Is there’s something specific I need to do in the config?
Thanks for your help :hugs:

GPU uses compute shaders which are only available on webgpu
if you are targeting webgl, either use the cpu backend or use the pixelshader one

2 Likes