Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 833
    • Issues 833
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 234
    • Merge requests 234
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTKVTK
  • VTKVTK
  • Issues
  • #17988
Closed
Open
Issue created Aug 26, 2020 by Ming Jin@mjin_origen

Cannot run WebAssembly examples with rendering

Hi, I have been following the instructions for buidling WebAssembly examples:
https://gitlab.kitware.com/vtk/vtk/-/tree/master/Examples/Emscripten/Cxx

Everything compiles fine, but when I try to run the examples (e.g. Cone) in the webserver, nothing is rendered, and I get the following error messages in Firefox:

Error: WebGL warning: <SetDimensions>: Failed to create WebGL context: WebGL creation failed: 
* tryNativeGL
* Exhausted GL driver options. Cone.js:6305:20
ERROR: In /work/src/Rendering/OpenGL2/vtkSDL2OpenGLRenderWindow.cxx, line 276 Cone.js:2217:13
vtkSDL2OpenGLRenderWindow (0x579ab0): Unable to create SDL2 opengl context Cone.js:2217:13
Cone.js:2217:13
TypeError: GLctx is undefined
Cone.js:8140:22
exception thrown: TypeError: GLctx is undefined,emscriptenWebGLGet@http://localhost:8000/Cone/Cone.js:8140:22
_glGetIntegerv@http://localhost:8000/Cone/Cone.js:10804:7
__ZN21vtkTextureUnitManager10InitializeEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[2555]:0x968a7
__ZN14vtkOpenGLState10InitializeEP21vtkOpenGLRenderWindow@http://localhost:8000/Cone/Cone.wasm:wasm-function[1980]:0x71ffa
__ZN21vtkOpenGLRenderWindow15OpenGLInitStateEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[1673]:0x640ab
__ZN21vtkOpenGLRenderWindow10OpenGLInitEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[1672]:0x6407a
__ZN25vtkSDL2OpenGLRenderWindow10InitializeEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[2605]:0x977ad
__ZN21vtkOpenGLRenderWindow5StartEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[1612]:0x617bb
__ZN29vtkSDL2RenderWindowInteractor10InitializeEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[2945]:0xab9ba
__ZN15vtkRenderWindow6RenderEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[3484]:0xd5f1b
__ZN21vtkOpenGLRenderWindow6RenderEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[1594]:0x60fdc
_main@http://localhost:8000/Cone/Cone.wasm:wasm-function[491]:0x12b0d
vtkApp/Module._main@http://localhost:8000/Cone/Cone.js:12258:33
callMain@http://localhost:8000/Cone/Cone.js:13216:15
doRun@http://localhost:8000/Cone/Cone.js:13277:23
run@http://localhost:8000/Cone/Cone.js:13292:5
runCaller@http://localhost:8000/Cone/Cone.js:13193:19
removeRunDependency@http://localhost:8000/Cone/Cone.js:1488:7
receiveInstance@http://localhost:8000/Cone/Cone.js:1611:5
receiveInstantiatedSource@http://localhost:8000/Cone/Cone.js:1622:5

Slightly different error message in Chrome, but also complaining about being "Unable to create SDL2 opengl context":

Cone.js:2217 ERROR: In /work/src/Rendering/OpenGL2/vtkSDL2OpenGLRenderWindow.cxx, line 276
put_char @ Cone.js:2217
write @ Cone.js:2150
write @ Cone.js:3487
doWritev @ Cone.js:4299
_fd_write @ Cone.js:4652
___wasi_fd_write @ Cone.js:4661
___stdio_write @ Cone.wasm:0x3b3b74
___fwritex @ Cone.wasm:0x3b6507
_fwrite @ Cone.wasm:0x3ba220
__ZNSt3__211__stdoutbufIcE6xsputnEPKcl @ Cone.wasm:0x3d1882
__ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ @ Cone.wasm:0x14121
__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m @ Cone.wasm:0x13f80
__ZN15vtkOutputWindow11DisplayTextEPKc @ Cone.wasm:0x2f4023
__ZN15vtkOutputWindow16DisplayErrorTextEPKc @ Cone.wasm:0x2f413f
__Z31vtkOutputWindowDisplayErrorTextPKciS0_P9vtkObject @ Cone.wasm:0x2f44fa
__ZN25vtkSDL2OpenGLRenderWindow10InitializeEv @ Cone.wasm:0x9778b
__ZN21vtkOpenGLRenderWindow5StartEv @ Cone.wasm:0x617bb
__ZN29vtkSDL2RenderWindowInteractor10InitializeEv @ Cone.wasm:0xab9ba
__ZN15vtkRenderWindow6RenderEv @ Cone.wasm:0xd5f1b
__ZN21vtkOpenGLRenderWindow6RenderEv @ Cone.wasm:0x60fdc
_main @ Cone.wasm:0x12b0d
Module._main @ Cone.js:12258
callMain @ Cone.js:13216
doRun @ Cone.js:13277
run @ Cone.js:13292
runCaller @ Cone.js:13193
removeRunDependency @ Cone.js:1488
receiveInstance @ Cone.js:1611
receiveInstantiatedSource @ Cone.js:1622
Promise.then (async)
(anonymous) @ Cone.js:1643
Promise.then (async)
instantiateAsync @ Cone.js:1641
createWasm @ Cone.js:1668
(anonymous) @ Cone.js:12126
(anonymous) @ (index):29
Cone.js:2217 vtkSDL2OpenGLRenderWindow (0x579ab0): Unable to create SDL2 opengl context
put_char @ Cone.js:2217
write @ Cone.js:2150
write @ Cone.js:3487
doWritev @ Cone.js:4299
_fd_write @ Cone.js:4652
___wasi_fd_write @ Cone.js:4661
___stdio_write @ Cone.wasm:0x3b3b74
___fwritex @ Cone.wasm:0x3b6507
_fwrite @ Cone.wasm:0x3ba220
__ZNSt3__211__stdoutbufIcE6xsputnEPKcl @ Cone.wasm:0x3d1882
__ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ @ Cone.wasm:0x14121
__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m @ Cone.wasm:0x13f80
__ZN15vtkOutputWindow11DisplayTextEPKc @ Cone.wasm:0x2f4023
__ZN15vtkOutputWindow16DisplayErrorTextEPKc @ Cone.wasm:0x2f413f
__Z31vtkOutputWindowDisplayErrorTextPKciS0_P9vtkObject @ Cone.wasm:0x2f44fa
__ZN25vtkSDL2OpenGLRenderWindow10InitializeEv @ Cone.wasm:0x9778b
__ZN21vtkOpenGLRenderWindow5StartEv @ Cone.wasm:0x617bb
__ZN29vtkSDL2RenderWindowInteractor10InitializeEv @ Cone.wasm:0xab9ba
__ZN15vtkRenderWindow6RenderEv @ Cone.wasm:0xd5f1b
__ZN21vtkOpenGLRenderWindow6RenderEv @ Cone.wasm:0x60fdc
_main @ Cone.wasm:0x12b0d
Module._main @ Cone.js:12258
callMain @ Cone.js:13216
doRun @ Cone.js:13277
run @ Cone.js:13292
runCaller @ Cone.js:13193
removeRunDependency @ Cone.js:1488
receiveInstance @ Cone.js:1611
receiveInstantiatedSource @ Cone.js:1622
Promise.then (async)
(anonymous) @ Cone.js:1643
Promise.then (async)
instantiateAsync @ Cone.js:1641
createWasm @ Cone.js:1668
(anonymous) @ Cone.js:12126
(anonymous) @ (index):29
Cone.js:2217 
put_char @ Cone.js:2217
write @ Cone.js:2150
write @ Cone.js:3487
doWritev @ Cone.js:4299
_fd_write @ Cone.js:4652
___wasi_fd_write @ Cone.js:4661
___stdio_write @ Cone.wasm:0x3b3b74
___fwritex @ Cone.wasm:0x3b6507
_fwrite @ Cone.wasm:0x3ba220
__ZNSt3__211__stdoutbufIcE6xsputnEPKcl @ Cone.wasm:0x3d1882
__ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ @ Cone.wasm:0x14121
__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m @ Cone.wasm:0x13f80
__ZN15vtkOutputWindow11DisplayTextEPKc @ Cone.wasm:0x2f4023
__ZN15vtkOutputWindow16DisplayErrorTextEPKc @ Cone.wasm:0x2f413f
__Z31vtkOutputWindowDisplayErrorTextPKciS0_P9vtkObject @ Cone.wasm:0x2f44fa
__ZN25vtkSDL2OpenGLRenderWindow10InitializeEv @ Cone.wasm:0x9778b
__ZN21vtkOpenGLRenderWindow5StartEv @ Cone.wasm:0x617bb
__ZN29vtkSDL2RenderWindowInteractor10InitializeEv @ Cone.wasm:0xab9ba
__ZN15vtkRenderWindow6RenderEv @ Cone.wasm:0xd5f1b
__ZN21vtkOpenGLRenderWindow6RenderEv @ Cone.wasm:0x60fdc
_main @ Cone.wasm:0x12b0d
Module._main @ Cone.js:12258
callMain @ Cone.js:13216
doRun @ Cone.js:13277
run @ Cone.js:13292
runCaller @ Cone.js:13193
removeRunDependency @ Cone.js:1488
receiveInstance @ Cone.js:1611
receiveInstantiatedSource @ Cone.js:1622
Promise.then (async)
(anonymous) @ Cone.js:1643
Promise.then (async)
instantiateAsync @ Cone.js:1641
createWasm @ Cone.js:1668
(anonymous) @ Cone.js:12126
(anonymous) @ (index):29
Cone.js:13238 exception thrown: TypeError: Cannot read property 'getParameter' of undefined,TypeError: Cannot read property 'getParameter' of undefined
    at emscriptenWebGLGet (http://localhost:8000/Cone/Cone.js:8140:28)
    at _glGetIntegerv (http://localhost:8000/Cone/Cone.js:10804:7)
    at __ZN21vtkTextureUnitManager10InitializeEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[2555]:0x968a7)
    at __ZN14vtkOpenGLState10InitializeEP21vtkOpenGLRenderWindow (http://localhost:8000/Cone/Cone.wasm:wasm-function[1980]:0x71ffa)
    at __ZN21vtkOpenGLRenderWindow15OpenGLInitStateEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[1673]:0x640ab)
    at __ZN21vtkOpenGLRenderWindow10OpenGLInitEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[1672]:0x6407a)
    at __ZN25vtkSDL2OpenGLRenderWindow10InitializeEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[2605]:0x977ad)
    at __ZN21vtkOpenGLRenderWindow5StartEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[1612]:0x617bb)
    at __ZN29vtkSDL2RenderWindowInteractor10InitializeEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[2945]:0xab9ba)
    at __ZN15vtkRenderWindow6RenderEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[3484]:0xd5f1b)
callMain @ Cone.js:13238
doRun @ Cone.js:13277
run @ Cone.js:13292
runCaller @ Cone.js:13193
removeRunDependency @ Cone.js:1488
receiveInstance @ Cone.js:1611
receiveInstantiatedSource @ Cone.js:1622
Promise.then (async)
(anonymous) @ Cone.js:1643
Promise.then (async)
instantiateAsync @ Cone.js:1641
createWasm @ Cone.js:1668
(anonymous) @ Cone.js:12126
(anonymous) @ (index):29
Cone.js:8140 Uncaught (in promise) TypeError: Cannot read property 'getParameter' of undefined
    at emscriptenWebGLGet (Cone.js:8140)
    at _glGetIntegerv (Cone.js:10804)
    at __ZN21vtkTextureUnitManager10InitializeEv (:8000/Cone/Cone.wasm:wasm-function[2555]:0x968a7)
    at __ZN14vtkOpenGLState10InitializeEP21vtkOpenGLRenderWindow (:8000/Cone/Cone.wasm:wasm-function[1980]:0x71ffa)
    at __ZN21vtkOpenGLRenderWindow15OpenGLInitStateEv (:8000/Cone/Cone.wasm:wasm-function[1673]:0x640ab)
    at __ZN21vtkOpenGLRenderWindow10OpenGLInitEv (:8000/Cone/Cone.wasm:wasm-function[1672]:0x6407a)
    at __ZN25vtkSDL2OpenGLRenderWindow10InitializeEv (:8000/Cone/Cone.wasm:wasm-function[2605]:0x977ad)
    at __ZN21vtkOpenGLRenderWindow5StartEv (:8000/Cone/Cone.wasm:wasm-function[1612]:0x617bb)
    at __ZN29vtkSDL2RenderWindowInteractor10InitializeEv (:8000/Cone/Cone.wasm:wasm-function[2945]:0xab9ba)
    at __ZN15vtkRenderWindow6RenderEv (:8000/Cone/Cone.wasm:wasm-function[3484]:0xd5f1b)

Are there any known issues with SDL2? Thanks!

Assignee
Assign to
Time tracking