m4rs-mt / ILGPU

ILGPU JIT Compiler for high-performance .Net GPU programs
http://www.ilgpu.net
Other
1.34k stars 115 forks source link

XMath.Exp : An internal compiler error has been detected #1234

Closed ShagufthaT closed 3 months ago

ShagufthaT commented 3 months ago

Describe the bug

ILGPU crashes when I use XMath.Exp or XMath.Pow.

Environment

Steps to reproduce

a = IntrinsicMath.Abs(1 / b0); c = XMath.Exp(-1 b1 a);

Expected behavior

Output: ERROR:An internal compiler error has been detected image

Additional context

No response

MoFtZ commented 3 months ago

hi @ShagufthaT

Which version of ILGPU are you using? Which version of .NET are you using? What type of graphics cards are you using? Nvidia/Cuda?

If you look at the Releases page, you will find some sample code. The sample code is also available on Github (e.g. https://github.com/m4rs-mt/ILGPU/blob/master/Samples/AlgorithmsMath/Program.cs). Are you able to get these to work?

Also, please ensure that the ILGPU nuget package version matches the ILGPU.Algorithms nuget package version.

ShagufthaT commented 3 months ago

Hi @MoFtZ

ILGPU version: 1.5.1 ILGPU Algorithms: 1.5.1 .Net version: 6.0 Graphics card: Nvidia/Cuda

Abs works fine but XMath.Sinh, XMath.Exp, XMath.Pow etc shows the same error.

MoFtZ commented 3 months ago

Have you called EnableAlgorithms ? https://github.com/m4rs-mt/ILGPU/blob/master/Samples/AlgorithmsMath/Program.cs#L46

Also, the exception thrown by ILGPU may have an InnerException property. Please take a look, as it will have more detailed information.

ShagufthaT commented 3 months ago

Ah! I missed to call EnableAlgorithms. It works fine now. Thanks a lot.