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

GPU Support #20

Open
milesway opened this issue Oct 20, 2024 · 0 comments
Open

GPU Support #20

milesway opened this issue Oct 20, 2024 · 0 comments

Comments

@milesway
Copy link

milesway commented Oct 20, 2024

Hi,

I currently use const { createCanvas } = require('node-canvas-webgl/lib') to create a PNG screenshot image of whatever drawing on the canvas, using:

const canvas = createCanvas(width, height);
const renderer = new THREE.WebGLRenderer({ canvas });

const imageStream = canvas.createPNGStream({
        bufsize: 4096,
        compressionLevel: compressionLevel,
        progressive: false
      });
      
const chunks = [];
      
imageStream.on('data', chunk => {
     chunks.push(chunk);
     });

However, I realize that all computing is done on the CPU, and it is extremely resource-consuming.

My code runs well without xvfb-run by using the X server on a virtual display, which should give GPU access to all node packages.

Is there anything to do to put the computing on GPU, not CPU? Or is it supported, but my system configuration is somehow blocking it from accessing GPU?

Thanks!

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