Skip to content

Commit

Permalink
vscode: add libGL.so.1 and libEGL.so.1 to vscode
Browse files Browse the repository at this point in the history
Fixes gpu acceleration for X and Wayland.
  • Loading branch information
anilanar committed Dec 7, 2023
1 parent 955aaaa commit fdb1afe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkgs/applications/editors/vscode/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ in
);

postFixup = lib.optionalString stdenv.isLinux ''
patchelf --add-needed ${libglvnd}/lib/libGLESv2.so.2 $out/lib/vscode/${executableName}
patchelf \
--add-needed ${libglvnd}/lib/libGLESv2.so.2 \
--add-needed ${libglvnd}/lib/libGL.so.1 \
--add-needed ${libglvnd}/lib/libEGL.so.1 \
$out/lib/vscode/${executableName}
'';

inherit meta;
Expand Down

4 comments on commit fdb1afe

@VanCoding
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anilanar This commit broke my VSCode. It opens, but doesn't really render anything anymore. Clicks still work though. I'm on Wayland with intel Integrated Graphics.

@anilanar
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VanCoding Sorry about that! Could you run code --verbose or codium --verbose and hopefully it will give us some clues about what's missing for your case. I really have no clue how GLES/GL/EGL and gpu vendoring works and how linking nix packages vs. linking prebundled ones that come with vscode/chromium works. You might have more luck creating a Github issue.

@VanCoding
Copy link

@VanCoding VanCoding commented on fdb1afe Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anilanar Thanks, I've found the issue and a solution to it here: microsoft/vscode#195502

TLDR: just delete ~/.config/Code/GPUCache/ if VSCode was already installed before. Fresh installs are not affected.

@tagamma
Copy link

@tagamma tagamma commented on fdb1afe Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For anyone else that stumbles upon this, note that vscodium's GPUCache is in ~/.config/VSCodium/GPUCache

Please sign in to comment.