JuliaGL/GLFW.jl

GLFW couldn't create an OpenGL window.

Opened this issue · 8 comments

Working on Julia on Windows. How to solve this problem?
Using GLMakie v0.8.8

ERROR: LoadError: 
ReadOnlyMemoryError()
Stacktrace:
  [1] CreateWindow(width::Int64, height::Int64, title::String, monitor::GLFW.Monitor, share::GLFW.Window)
    @ GLFW [C:\Users\Vlad\.julia\packages\GLFW\BWxfF\src\](file:///C:/Users/Vlad/.julia/packages/GLFW/BWxfF/src/)glfw3.jl:499
  [2] 
GLFW.Window(; name::String, resolution::Tuple{Int64, Int64}, debugging::Bool, major::Int64, minor::Int64, windowhints::Vector{Tuple{UInt32, Int64}}, contexthints::Vector{Tuple{UInt32, Integer}}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window)
    @ GLFW [C:\Users\Vlad\.julia\packages\GLFW\BWxfF\src\](file:///C:/Users/Vlad/.julia/packages/GLFW/BWxfF/src/)glfw3.jl:344
  [3] Window
    @ [C:\Users\Vlad\.julia\packages\GLFW\BWxfF\src\](file:///C:/Users/Vlad/.julia/packages/GLFW/BWxfF/src/)glfw3.jl:302 [inlined]
  [4] empty_screen(debugging::Bool; reuse::Bool)
    @ GLMakie [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/)screen.jl:219
  [5] empty_screen
    @ [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/)screen.jl:202 [inlined]
  [6] singleton_screen(debugging::Bool)
    @ GLMakie [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/)screen.jl:304
  [7] macro expansion
    @ [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/)precompiles.jl:18 [inlined]
  [8] macro expansion
    @ [C:\Users\Vlad\.julia\packages\PrecompileTools\kmH5L\src\](file:///C:/Users/Vlad/.julia/packages/PrecompileTools/kmH5L/src/)workloads.jl:78 [inlined]
  [9] macro expansion
    @ [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/)precompiles.jl:16 [inlined]
 [10] macro expansion
    @ [C:\Users\Vlad\.julia\packages\PrecompileTools\kmH5L\src\](file:///C:/Users/Vlad/.julia/packages/PrecompileTools/kmH5L/src/)workloads.jl:140 [inlined]
 [11] top-level scope
    @ [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/)precompiles.jl:14
 [12] include(mod::Module, _path::String)
    @ Base [.\](https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/Vlad/Projects/Dashboard/)Base.jl:457
 [13] include(x::String)
    @ GLMakie [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/)GLMakie.jl:1
 [14] top-level scope
    @ [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/)GLMakie.jl:59
 [15] include
    @ [.\](https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/Vlad/Projects/Dashboard/)Base.jl:457 [inlined]
 [16] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base [.\](https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/Vlad/Projects/Dashboard/)loading.jl:2049
 [17] top-level scope
    @ stdin:3
in expression starting at [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\precompiles.jl:13](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/precompiles.jl:13)
in expression starting at [C:\Users\Vlad\.julia\packages\GLMakie\toRaR\src\GLMakie.jl:1](file:///C:/Users/Vlad/.julia/packages/GLMakie/toRaR/src/GLMakie.jl:1)
in expression starting at stdin:3

On windows? That's really weird! Anything special about the system?
Can you post the full system configuration?

Device name LAPTOP-F5O1N7V3
Processor AMD Ryzen 7 5800H with Radeon Graphics 3.20 GHz
Installed RAM 16.0 GB (15.4 GB usable)
Device ID 99199F31-7E5A-4CCB-B695-39EEB04D95DC
Product ID 00355-60680-92500-AAOEM
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display

Edition Windows 11 Pro
Version 22H2
Installed on ‎12/‎03/‎2023
OS build 22621.2134
Serial number PF3A2HMT
Experience Windows Feature Experience Pack 1000.22659.1000.0

And when you run using GLFW; GLFW.Window() in a normal terminal/powershell/cmd, it just throws that error?

julia> GLFW.Window() ERROR: ReadOnlyMemoryError() Stacktrace: [1] CreateWindow(width::Int64, height::Int64, title::String, monitor::GLFW.Monitor, share::GLFW.Window) @ GLFW C:\Users\Vlad\.julia\packages\GLFW\BWxfF\src\glfw3.jl:499 [2] GLFW.Window(; name::String, resolution::Tuple{Int64, Int64}, debugging::Bool, major::Int64, minor::Int64, windowhints::Vector{Tuple{UInt32, Int64}}, contexthints::Vector{Tuple{UInt32, Integer}}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window) @ GLFW C:\Users\Vlad\.julia\packages\GLFW\BWxfF\src\glfw3.jl:344 [3] GLFW.Window() @ GLFW C:\Users\Vlad\.julia\packages\GLFW\BWxfF\src\glfw3.jl:302 [4] top-level scope @ REPL[5]:1

And all drivers for the GPU are correctly installed and you dont run this in WSL or something?

I run it on Visual Studio Code and it was working before.

Since this is directly calling into C and doesn't do anything weird, and GLFW hasn't changed at all in the last year or so, my only idea is that you must have gotten a faulty driver update, or something like that.
Unless, something else is different now on your system, but this more or less directly calls into the OS to open a window, and Windows has been very stable with driver support in the last 5 years or so.
Btw, which Julia version is this?

Julia 1.9.2