0

I am trying to get the "simple to use" Alea Libary to work (I have a RTX2080, so this shouldn't be the Problem).

The UI is WPF based and implemented in a .NET Core 3.1 project. It injects a "GpuCalculator" object into the "Core.Lib" (.Net Standard 2.1).

I created a .Net Standard 2.0 Class-Library for the execution (Core.Calculations Project). The GpuCalculator is implemented here. I installed the Alea NuGet Package (Version 3.0.4) along with the FSharp.Core (Version 5.0.1), which is needed from Alea. At first I had the same Problem described here: How to setup project using Alea GPU

That's why I added the following lines to my csproj File:

  <ItemGroup>
    <Reference Include="Alea">
      <HintPath>$(NuGetPackageRoot)\alea\3.0.4\lib\net45\alea.dll</HintPath>
    </Reference>
    <Reference Include="Alea.IL">
      <HintPath>$(NuGetPackageRoot)\alea\3.0.4\lib\net45\Alea.IL.dll</HintPath>
    </Reference>
    <Reference Include="Alea.Parallel">
      <HintPath>$(NuGetPackageRoot)\alea\3.0.4\lib\net45\Alea.Parallel.dll</HintPath>
    </Reference>
  </ItemGroup>

The Problem now is that whenever I want to access "Gpu.Default", an Exception is thrown (NullReferenceException) from the F# Code. Even a simple access to Default doesn't work:

var gpu = Gpu.Default;

Results in an Error like this:

   at Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.UnboxGeneric[T](Object source) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\prim-types.fs:line 647

I also tried to switch my target platform from "Any CPU" to "x64" because I saw the hint somewhere. It had no effect though :(

I am thankful for every help!

Do I need any other NuGet packages? Should I probably switch to something different? Cudafy? OpenGL (via OpenTK) Compute-Shaders? Vulcan (C#?)...?

edit: On my Latop I get the following error when I want to access the Gpu.Default:

Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.
Eru Iluvatar
  • 353
  • 1
  • 5
  • 17
  • 2
    QuantAlea has not updated those nugets since 2017, their website/blog/etc is gone, their Twitter acct is suspended, etc... I know that Alea fails on 30xx series cards since it has not been updated.... personally I would move to another framework that has active support. – SushiHangover Feb 20 '21 at 15:12
  • Thank you for the information, I saw the website gone as well...Maybe I should switch to ILGPU? It might have some restrictions, but I managed to get a simple example running in like 10 Minutes... Do you have any other suggestions? – Eru Iluvatar Feb 20 '21 at 15:16

0 Answers0