jcef_helper using VRAM - how to prevent this
Trying to use my Nvidia graphics CUDA cores to do some machine learning development. I do not currently have a card with a lot of VRAM (planning to upgrade in the new year once stock is available again). So I have been getting rid of as many processes as I can that use VRAM (ex disabled acceleration in Firefox).
I found there is a PyCharm process called jcef_helper that is also consuming various amounts of VRAM. It is not a lot - max has been around 28Meg, but given the small size of my card, even this small amount can cause task failure due to insufficient memory.
What is this process and how can I get it to stop using VRAM and stick solely to CPU RAM?
Perventing Firefox from using VRAM has had no serious ill-effects - I have an Intel i7 and the CPU is plenty fast enough to handle the graphics load Firefox requires. I don't see any requirement for PyCharm to be using VRAM (it has even lower graphics requirements - i.e. no video or audio processing required).
Please sign in to leave a comment.
Hi, JCEF (Java embedded framework) is used to render Markdown and Jupyter in PyCharm. Are you using any of that, by any chance?
Thanks - yes, I have some Jupyter notebooks open. OK - that explains why the JCEF process is running.
Do you know if it is possible to force JCEF to run entirely on the CPU and avoid using the GPU entirely?
As I indicated, I have an 8-core Intel i7 running at 3.4GHz so definitely do not need anything like Jupyter rendering running on the GPU. In fact I have the impression sometimes that Jupyter cell execution is slow - perhaps the overhead of getting things over to run small tasks on the GPU is slower than direct and immediate execution on the CPU would be??
Actually, the problem is worse than I thought. I have a Jupyter ML notebook that I am working on. Running some of the cells caused JCEF to balloon to 148Meg of VRAM - this is no good. You cannot have your development environment (Pycharm) fighting for the same resources you need to actually run your application (VRAM). If there is no way to disable use of VRAM in JCEF, then this makes Pycharm useless as a development environment for Jupyter notebooks, at least as far as ML/CUDA is concerned.
There is an experimental mode called OffScreen Rendering, which renders entirely on CPU in the current version.
You can enable that by enabling `ide.browser.jcef.osr.enabled` registry option.
To access registry, go to **Help | Find Action...** and search for "Registry..."
I have to warn though this mode is experimental, and may result in performance and stability issues.
Thanks for your help. This wouldn't really be an issue if it weren't that PyCharm is such a good development environment for Python - I actually don't find Jupyter notebooks as useful as some do for doing development (being an old school s/w developer, I prefer an IDE like PyCharm), but Jupyter notebooks as documentation and learning tool is the "new thing" everyone wants these days, so I'm trying to make do as best as possible while staying within Pycharm.
I tried your suggestion regarding the Registry change, unfortunately, it didn't work (I have the latest version installed). See "Dedicated GPU memory" in the image below. JCEF helper is still there, as well as PyCharm itself. Part of the problem is also Windows 10, which as you can see hogs nearly half of the physical 2Gig VRAM I have available. The only solution for the latter is probably to work in Linux, which I may yet do.
There isn't by any chance a hidden command line option for PyCharm to force it to do rendering on CPU vs GPU??
Just found out that Visual Studio Code has a good way of handling this: a command line option that disables gpu rendering at the application level:
--disable-gpuSince it appears that JCEF and PyCharm itself both use GPU rendering, I think this should be the way to go - allow disabling it everywhere.
I have consulted with the team responsible for JCEF integration with our IDE and, unfortunately, there's no other option implemented. Could you please submit a feature request to https://youtrack.jetbrains.com/ to add the option similar to VS code?
Will do - may take a couple of days given it is the holiday season ;).