GLMakie in VSCode on hybrid graphics laptop

My laptop runs Ubuntu 20.04. It has a discrete Nvidia GeForce GTX 1650 Ti GPU, which is set to be used on demand (“hybrid graphics”) following Graphics Switching (Ubuntu) - System76 Support . In an ordinary terminal, in order to run GLMakie on the GPU, I need to launch Julia as

$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia julia

(instead of just $ julia ). Is there a way of doing this within VSCode, i.e. with the VSCode Julia REPL?

1 Like

You should be able to use the terminal.integrated.env.linux setting for that or set these env variables in your shell before starting VS Code (from that same terminal, of course)

1 Like

Thanks for the reply!

Before I got to try your suggestions, I accidentally discovered that I no longer have to set these environment variables to use GLMakie - it now works “out of the box”! (Sometime between now and last time I tried to accomplish this, something must have been updated such that this is no longer required. Yay!)

Sorry for the noise :grimacing: