Skip to content

Commit 91b34d0

Browse files
AbhiPrasadclaude
andauthored
fix: Handle getGPUInfo error on Linux with Electron v40+ (#1302)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f462e61 commit 91b34d0

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/integrations/gpu-context.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,14 @@ export const gpuContextIntegration = defineIntegration((options: Options = { inf
5555
name: 'GpuContext',
5656
processEvent: async (event): Promise<Event> => {
5757
if (gpuContexts === undefined) {
58-
const result = (await app.getGPUInfo(options.infoLevel)) as GpuInfoResult;
59-
gpuContexts = result.gpuDevice.map(gpuDeviceToGpuContext);
58+
try {
59+
const result = (await app.getGPUInfo(options.infoLevel)) as GpuInfoResult;
60+
gpuContexts = result.gpuDevice.map(gpuDeviceToGpuContext);
61+
} catch {
62+
// getGPUInfo can throw on Linux when hardware acceleration is disabled (Electron v40+)
63+
// In this case, we just don't add GPU context to events
64+
gpuContexts = [];
65+
}
6066
}
6167

6268
if (gpuContexts.length === 1) {

0 commit comments

Comments
 (0)