1

I am trying to open my Three.js script on Node.js headless server with CentOS 9. But I get this problem:

THREE.WebGLRenderer: Error creating WebGLContext
/home/oleg/servrend/node_modules/three/build/three.cjs:19211
                throw error;
                ^

Error: Error creating WebGLContext
    at new WebGLRenderingContext (/home/oleg/servrend/node_modules/gl/src/javascript/webgl-rendering-context.js:98:1)
    at createContext (/home/oleg/servrend/node_modules/gl/src/javascript/node-index.js:37:13)
    at NodeCanvasElement.getContext (/home/oleg/servrend/scripts/lib/canvas.js:89:19)
    at getContext (/home/oleg/servrend/node_modules/three/build/three.cjs:19155:28)
    at new WebGLRenderer (/home/oleg/servrend/node_modules/three/build/three.cjs:19188:10)
    at Object.<anonymous> (/home/oleg/servrend/scripts/img.js:55:18)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)

When I start script on local windows or ubuntu server everything is ok.

This is output of lspci | grep VGA if it's necessary:

00:02.0 VGA compatible controller: Device 1234:1111 (rev 02)
  • I think there was a problem with GPU - I started script at another server and it's ok – Олег О Feb 14 '22 at 18:58
  • Mmm... I started project on windows server without GPU and its ok too. And I found that project dooesn't work on headless ubuntu, but if gui is installed and project was started from gui (unity in my case), it works as I said above. – Олег О Mar 30 '22 at 16:43

0 Answers0