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

Error: internal error in Neon module: Failed to enumerate Vulkan physical devices.: ERROR_INITIALIZATION_FAILED #150

Open
arhip144 opened this issue Oct 6, 2023 · 12 comments

Comments

@arhip144
Copy link

arhip144 commented Oct 6, 2023

Unhandled promise rejection: Error: internal error in Neon module: Failed to enumerate Vulkan physical devices.: ERROR_INITIALIZATION_FAILED
0|wetbot | at Canvas.init (C:\Users\WETBOT\Documents\GitHub\wetbot\node_modules\skia-canvas\lib\index.js:41:45)
0|wetbot | at Canvas.alloc (C:\Users\WETBOT\Documents\GitHub\wetbot\node_modules\skia-canvas\lib\index.js:37:17)
0|wetbot | at new Canvas (C:\Users\WETBOT\Documents\GitHub\wetbot\node_modules\skia-canvas\lib\index.js:399:19)
0|wetbot | at Object.run (C:\Users\WETBOT\Documents\GitHub\wetbot\slash-commands\rank.js:128:24)
0|wetbot | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

How I can disable GPU rendering? My specs: GT610, Xeon E5 2696V3

@mpaperno
Copy link
Contributor

mpaperno commented Oct 6, 2023

If you can create a Canvas instance w/out error then you can use Canvas.gpu property set to false.

However skia-canvas tests for a valid GPU renderer by default for a new Canvas, so if you're getting this error upon Canvas creation then the only recourse I know of is to build skia-canvas with GPU disabled by default.

The change is minor, though of course it does require a rebuild (dev. environment and all that):
mpaperno@522388c

Alternately you can use my fork as the package source if you want, which comes with GPU disabled by default (and other changes). I don't have Linux ARM builds though.

@arhip144
Copy link
Author

arhip144 commented Oct 6, 2023

If you can create a Canvas instance w/out error then you can use Canvas.gpu property set to false.

However skia-canvas tests for a valid GPU renderer by default for a new Canvas, so if you're getting this error upon Canvas creation then the only recourse I know of is to build skia-canvas with GPU disabled by default.

The change is minor, though of course it does require a rebuild (dev. environment and all that): mpaperno@522388c

Alternately you can use my fork as the package source if you want, which comes with GPU disabled by default (and other changes). I don't have Linux ARM builds though.

How can I install your package via npm and require it in project?

@mpaperno
Copy link
Contributor

mpaperno commented Oct 6, 2023

How can I install your package via npm and require it in project?

I don't have it up on NPM (yet?), but you can use any Git[hub] URL as a package source. So eg. change your package.json dependencies to

    "skia-canvas": "github:mpaperno/skia-canvas#master"

Then run npm update. This will keep the module with the same import name, so no code needs to be changed.

@arhip144
Copy link
Author

arhip144 commented Oct 6, 2023

How can I install your package via npm and require it in project?

I don't have it up on NPM (yet?), but you can use any Git[hub] URL as a package source. So eg. change your package.json dependencies to

    "skia-canvas": "github:mpaperno/skia-canvas#master"

Then run npm update. This will keep the module with the same import name, so no code needs to be changed.

PS C:\Users\WETBOT\Documents\GitHub\wetbot> npm update
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent An unknown git error occurred
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

@Julusian
Copy link

Julusian commented Oct 6, 2023

Ive had users report this too, and so far reports have been positive from switching the backend from vulkan to d3d for windows (through recompiling the library). But based on reading this, maybe I should disable using the gpu instead..

@mpaperno
Copy link
Contributor

mpaperno commented Oct 6, 2023

npm ERR! errno -4058

Well, if you find a problem in my forked version, please do file a new Issue there. In this case doing a search on the error code brings up several possible answers, top one being that something is locking your current skia-canvas module files (or maybe some other project file). Adding "git" to the search brings up other suggestions like firewall issues.

@Julusian
Copy link

Julusian commented Oct 6, 2023

@mpaperno you dont appear to have enabled issues there yet, github disables it by default for forks

@mpaperno
Copy link
Contributor

mpaperno commented Oct 6, 2023

Ive had users report this too, and so far reports have been positive from switching the backend from vulkan to d3d for windows (through recompiling the library). But based on reading this, maybe I should disable using the gpu instead..

Hi, I'm curious if you (or your users) have seen any benefit from GPU rendering with D3D? Asking because with Vulkan the benefit it not apparent here.

Also wondering what is involved in switching to D3D... though perhaps off-topic here.

@mpaperno
Copy link
Contributor

mpaperno commented Oct 6, 2023

@mpaperno you dont appear to have enabled issues there yet, github disables it by default for forks

Gah, silly me. Fixed, thanks!

@Julusian
Copy link

Julusian commented Oct 6, 2023

Hi, I'm curious if you (or your users) have seen any benefit from GPU rendering with D3D? Asking because with Vulkan the benefit it not apparent here.

I've not tried doing any tests, performance hasnt been a concern yet.

Also wondering what is involved in switching to D3D... though perhaps off-topic here.

My build scripts are very different to this repository by now, and some other tidying got involved in the change, so it is a little hard to figure out which bits are relevant. But I think the only real change that you would need to make is swapping --features vulkan,window for --features skia-safe/d3d,window in the windows build script. I dont think it needed any extra dependencies

@arhip144
Copy link
Author

arhip144 commented Oct 6, 2023

@samizdatco
Copy link
Owner

samizdatco commented Dec 3, 2024

As of version 2.0, gpu initialization doesn't happen until the canvas is either rendered or its gpu attribute is read. So if you want to prevent Vulkan from starting up, just set gpu to false right after creating your Canvas object.

The initialization process should also be more error tolerant now, reporting failures in canvas.engine rather than panicking. I'd be curious to know if your original error looks different on the new version @arhip144.

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

4 participants