【问题标题】:Win10 Electron Error: Passthrough is not supported, GL is disabled, ANGLE isWin10 Electron 错误:不支持直通,GL 被禁用,ANGLE 是
【发布时间】:2022-12-20 06:55:45
【问题描述】:

我有一个电子存储库 (https://github.com/MartinBarker/RenderTune),在使用命令提示符运行时,它曾经在 Windows 10 上正常工作。几个月后,我回到了一台带有 Nvidia GPU 的全新 Windows 10 机器上,电子应用程序在启动时在窗口中打印了一个错误:

Uncaught TypeError: Cannot read properties of undefined (reading 'getCurrentWindow')

运行 ffmpeg shell 命令也会导致错误,并且在命令提示符终端中输出此消息:

[14880:1207/145651.085:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is disabled, ANGLE is

我检查了我的其他 Windows 笔记本电脑,这些笔记本电脑从我的存储库的 master 分支运行完全相同的代码,并且在本地运行时它工作得很好。

好像这可能是最近的问题?我发现它在各种论坛上都有讨论: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1944468

https://www.reddit.com/r/electronjs/comments/qdauhu/passthrough_is_not_supported_gl_is_disabled_angle/

我尝试将我的全局电子 npm 包升级到更新的版本:electron@16.0.4,但错误仍然出现。

【问题讨论】:

    标签: npm electron command-prompt chromium nvidia


    【解决方案1】:

    您可以尝试使用app.disableHardwareAcceleration() (See the docs) 禁用硬件加速。不过,我认为这不是解决方法,它只是让消息对我消失了。


    用法示例

    主程序

    import { app, BrowserWindow } from 'electron'
    import isDev from 'electron-is-dev'
    
    app.disableHardwareAcceleration()
    
    let win = null
    
    async function createWindow() {
      win = new BrowserWindow({
        title: 'My Window'
      })
    
      const winURL = isDev
        ? 'http://localhost:9080'
        : `file://${__dirname}/index.html`
      win.loadURL(url)
    
      win.on('ready-to-show', async () => {
        win.show()
        win.maximize()
      })
    }
    
    app.whenReady().then(createWindow)
    
    app.on('window-all-closed', () => {
      win = null
      if (process.platform !== 'darwin') {
        app.quit()
      }
    })
    

    【讨论】:

    • 我怎样才能强制加速?顺利渲染?
    • @Dee 我认为这可以通过使用 app.commandLine.appendSwitch('force_high_performance_gpu') 为 Chromium 设置相应的命令行开关来完成,如 here 所述。
    • 我们的应用程序包含一个 3D 渲染场景,需要硬件加速,这在 Electron 中默认启用,所以这不是我们的选择。虽然我不想看到这个错误,但我似乎无法发现对应用程序本身有任何影响,所以我们决定暂时忽略它。
    【解决方案2】:

    您的代码中应该有拼写错误,请检查,

    我在电子中遇到了类似的错误

    [7608:1220/032708.152:ERROR:gpu_init.cc(523)] 
    Passthrough is not supported, GL is disabled, ANGLE is
    

    问题是类型错误

    错误代码

    // events funstions of electron
    SM_app.on('redy', F_create_windows);
    

    固定码

    // events funstions of electron
    SM_app.on('ready', F_create_windows);
    

    我的代码中缺少aredy

    检查您的代码。再次

    【讨论】:

      猜你喜欢
      • 2021-08-02
      • 1970-01-01
      • 1970-01-01
      • 2015-12-02
      • 2017-04-29
      • 1970-01-01
      • 2013-12-28
      • 1970-01-01
      • 2019-03-01
      相关资源
      最近更新 更多