-
Notifications
You must be signed in to change notification settings - Fork 39
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
create_some_context causes Segmentation fault from REPL #176
Comments
Can you post the stacktrace you get from the segfault, as well as the OpenCL driver you're using (I assume it's Apple's OpenCL implementation)? It could be something to do with GC running earlier in the REPL, which is uncovering a bug. |
Here I can put what I get an OSX with similar specs
The test: julia> Pkg.test("OpenCL")
Testing OpenCL
Resolving package versions...
Status `/var/folders/mg/sxhvxdv96mqgprwhzxv8gwbw0000gn/T/tmpZQxe4Y/Manifest.toml`
[08131aa3] OpenCL v0.8.0
[2a0f44e3] Base64 [`@stdlib/Base64`]
[8ba89e20] Distributed [`@stdlib/Distributed`]
[b77e0a4c] InteractiveUtils [`@stdlib/InteractiveUtils`]
[8f399da3] Libdl [`@stdlib/Libdl`]
[37e2e46d] LinearAlgebra [`@stdlib/LinearAlgebra`]
[56ddb016] Logging [`@stdlib/Logging`]
[d6f4376e] Markdown [`@stdlib/Markdown`]
[de0858da] Printf [`@stdlib/Printf`]
[9a3f8284] Random [`@stdlib/Random`]
[9e88b42a] Serialization [`@stdlib/Serialization`]
[6462fe0b] Sockets [`@stdlib/Sockets`]
[8dfed614] Test [`@stdlib/Test`]
[4ec0a83e] Unicode [`@stdlib/Unicode`]
Test Summary: | Pass Total
layout | 2 2
Test Summary: | Pass Total
OpenCL.Platform | 13 13
Couldn't compile kernel:
1 :
2 : __kernel void test() {
3 : int c = 1 + 1;
4 : };
With following build error:
No kernels or only kernel prototypes found when build executable.
Couldn't compile kernel:
1 :
2 : __kernel void test() {
3 : int c = 1 + 1;
4 : };
With following build error:
<program source>:5:13: warning: unused variable 'c'
int c = 1 + 1;
^
No kernels or only kernel prototypes found.
Couldn't compile kernel:
1 :
2 : __kernel void test() {
3 : int c = 1 + 1;
4 : };
With following build error:
<program source>:5:13: warning: unused variable 'c'
int c = 1 + 1;
^
No kernels or only kernel prototypes found.
Test Summary: | Callback works
Pass TotalCallback works
OpenCL.ContextCallback works
| 50 Callback works
50
Callback works
Test Summary: | Pass Callback works
Total
Callback works
OpenCL.Device | Callback works
122 122Callback works
┌ Warning: Platform Apple does not seem to suport out of order queues:
│ CLError(code=-30, CL_INVALID_VALUE)
└ @ Main.TestOpenCL ~/.julia/packages/OpenCL/vsBez/test/test_cmdqueue.jl:16
OpenCL Error: | [CL_INVALID_VALUE] : OpenCL Error : clCreateCommandQueue failed: Device failed to create queue (cld returned: -35). |
Test Summary: | OpenCL Error: | [CL_INVALID_VALUE] : OpenCL Error : clCreateCommandQueue failed: Device failed to create queue (cld returned: -35). |
Pass TotalOpenCL Error: | [CL_INVALID_VALUE] : OpenCL Error : clCreateCommandQueue failed: Device failed to create queue: -30 |
OpenCL.CmdQueueOpenCL Error: | [CL_INVALID_VALUE] : OpenCL Error : clCreateCommandQueue failed: Device failed to create queue (cld returned: -35). |
| 61 OpenCL Error: | [CL_INVALID_VALUE] : OpenCL Error : clCreateCommandQueue failed: Device failed to create queue: -30 |
61
OpenCL Error: | [CL_INVALID_VALUE] : OpenCL Error : clCreateCommandQueue failed: Device failed to create queue: -30 |
Test Summary: | Pass Total
OpenCL.Minver | 20 20
Test Summary: | Pass Total
OpenCL.Event | 48 48
OpenCL.Program binaries: Test Failed at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:86
Expression: prg2[:binaries] == binaries
Evaluated: Dict{OpenCL.cl.Device,Array{UInt8,N} where N}() == Dict{OpenCL.cl.Device,Array{UInt8,N} where N}(OpenCL.Device(Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz on Apple @0x00000000ffffffff)=>[0x62, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x30, 0x30, 0xd4, 0x01 … 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xee])
Stacktrace:
[1] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:86
[2] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
[3] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:76
[4] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
[5] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:3
OpenCL.Program binaries: Test Failed at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:86
Expression: prg2[:binaries] == binaries
Evaluated: Dict{OpenCL.cl.Device,Array{UInt8,N} where N}() == Dict{OpenCL.cl.Device,Array{UInt8,N} where N}(OpenCL.Device(AMD Radeon HD - FirePro D300 Compute Engine on Apple @0x0000000001021c00)=>[0x62, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x30, 0x30, 0xd4, 0x01 … 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0xd2])
Stacktrace:
[1] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:86
[2] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
[3] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:76
[4] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
[5] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:3
OpenCL.Program binaries: Test Failed at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:86
Expression: prg2[:binaries] == binaries
Evaluated: Dict{OpenCL.cl.Device,Array{UInt8,N} where N}() == Dict{OpenCL.cl.Device,Array{UInt8,N} where N}(OpenCL.Device(AMD Radeon HD - FirePro D300 Compute Engine on Apple @0x0000000002021c00)=>[0x62, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x30, 0x30, 0xd4, 0x01 … 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0xd2])
Stacktrace:
[1] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:86
[2] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
[3] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:76
[4] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
[5] top-level scope at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:3
Test Summary: | Pass Fail Total
OpenCL.Program | 63 3 66
OpenCL.Program source constructor | 3 3
OpenCL.Program info | 24 24
OpenCL.Program build | 12 12
OpenCL.Program source code | 3 3
OpenCL.Program binaries | 21 3 24
ERROR: LoadError: LoadError: Some tests did not pass: 63 passed, 3 failed, 0 errored, 0 broken.
in expression starting at /Users/macpro/.julia/packages/OpenCL/vsBez/test/test_program.jl:1
in expression starting at /Users/macpro/.julia/packages/OpenCL/vsBez/test/runtests.jl:30
ERROR: Package OpenCL errored during testing
Stacktrace:
[1] pkgerror(::String, ::Vararg{String,N} where N) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:120
[2] #test#66(::Bool, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1328
[3] #test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:0 [inlined]
[4] #test#44(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:193
[5] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:178 [inlined]
[6] #test#43 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:175 [inlined]
[7] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:175 [inlined]
[8] #test#42 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:174 [inlined]
[9] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:174 [inlined]
[10] #test#41(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:173
[11] test(::String) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:173
[12] top-level scope at none:0 |
Hi I just did a If I open Julia and call Running create_some_context as first command after the using OpenCL in new Julia session causes the crash, see below:
Trying to get a stack backtrace, this is the best I can do at the moment. I guess if I need more details, I would have to custom built Julia with debugging enabled?
|
Given that we don't get a pretty backtrace after the segfault, could you put the call to |
I have the same issue on OSX with OpenCL.jl v0.8.0.
the initial call here was
|
I built OpenCL_jll with BinaryBuilder.jl and plan to refactor the package here to load it instead. This will install the binary dependencies for the end user in theory. I will close the issue as it is hard to reproduce in 2022. |
Hi
When I call create_some_context from the REPL it causes a Segmentation fault which closes julia, however if I can from the bash command line call example code successfully (./run_examples.sh).
I traced (manually executed code lines) it and it atleast got to the line 140 from src/context.jl:
ctx_id = api.clCreateContext(
I suspect it has something to do with environmental variables/paths and possibly to do with module initialisation code which executes differently from the REPL compared to running a julia script from the bash command line.
Pkg.test("OpenCL")
mostly works, but gives the 3 errors :The text was updated successfully, but these errors were encountered: