Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClBuildProgram fails on kernels with infinite loop #132

Open
dpanfilyonok opened this issue Mar 18, 2022 · 0 comments
Open

ClBuildProgram fails on kernels with infinite loop #132

dpanfilyonok opened this issue Mar 18, 2022 · 0 comments

Comments

@dpanfilyonok
Copy link

Describe the bug
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. while compiling following kernel:

let command =
    <@ fun (range: Range1D) (xs: int clarray) ->
        let mutable i = 0

        while i < 10 do
            printf "str"
    @>

The following kernels are OK:

let command =
    <@ fun (range: Range1D) (xs: int clarray) ->
        let mutable i = 0

        while i < 10 do
            printf "str"
            i <- i + 1
    @>
let command =
    <@ fun (range: Range1D) (xs: int clarray) ->
        let mutable i = 0

        while i < 10 do
            xs.[0] <- 0
    @>

Desktop (please complete the following information):

  • OS: Windows 11
  • Commit: link
  • Device: AMD GPU only

Additional context
Stack trace:

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
   at OpenCL.Net.Cl.clBuildProgram(IntPtr, UInt32, OpenCL.Net.Device[], System.String, ProgramNotify, IntPtr)
--------------------------------
   at OpenCL.Net.Cl.BuildProgram(OpenCL.Net.Program, UInt32, OpenCL.Net.Device[], System.String, ProgramNotify, IntPtr)
   at Brahma.FSharp.OpenCL.ClProgram`2[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, C
ulture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(Brahma.FSharp.OpenCL.IContext, Microsoft.FSharp.Quotations.FSharpExpr`1<Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>>)
   at Brahma.FSharp.OpenCL.ClContext.CreateClProgram[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Vers
ion=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Quotations.FSharpExpr`1<Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>>)
   at Brahma.FSharp.Tests.Utils.openclCompile[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0
.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Quotations.FSharpExpr`1<Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>>)
   at Program.main(System.String[])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant