TypeInitializationException thrown by aleagpu
Asked Answered
C

2

5

I am trying to use aleagpu but I get the System.TypeInitializationException. I have tried to google what the problem is but I couldn't find any solution, so please help. The program is the simplest possible:

class Klazz
{
    private const int N = 100;
    private const int Length = 10000000;
    var gpu = Gpu.Default;// here is the Exception thrown          
    public static void Unmanaged()
    {
        var data = new int[Length];

        for (var k = 0; k < N; k++)
            gpu.For(0, data.Length, i => data[i] += 1); 
    }
}

I am imagining that there is something wrong in my installation, because the program is a copied example from aleagpu's homepage.

My system is:

  • Windows 10
  • .NET v4.5.2
  • VS 2015 Community NVIDIA GPU computing toolkit CUDA v8.0

Alea is installed from NuGet November 9. 2016

  • Alea (3.0.1)
  • Alea.IL (2.2.0.3307)
  • Alea.CUDA (2.2.0.3307)
  • Alea.CUDA.IL (2.2.0.3307)
  • Alea.CUDA.Unbound (2.2.0.3307)

The variables in PATH is correct.

I have tried the AleaSample.CS.ParallelForAutoMemMgt as well with the same result.

Cutoff answered 9/11, 2016 at 9:41 Comment(0)
C
5

It turns out that aleagpu is written in F#, and when you install FSharp.Core the program works. Thanks to Ghosthack answering the question: Alea GPU Tutorial not compiling on VS 2015 Update 2 with FSharp.Core 4.4.0.0

Cutoff answered 9/11, 2016 at 10:19 Comment(1)
you would think alea gpu would have all requirements,,, thank you for the solution , it works perfectly for me, side note, the latest version of FSharp.Core I found for my up to date VS2015 update 3 is 4.2.2Puddling
G
1

Also, please make sure that you either install version 2.2 or version 3.x. For the new version 3.x you only need to install the Alea or the Alea.Fody package [https://www.nuget.org/packages/Alea/3.0.1][1] and do not mix with the 2.2 packages.

Gokey answered 9/11, 2016 at 18:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.