-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High GPU usage in Python Interactive #2878
Comments
I would hazard a guess that a jupyter notebook would have the same GPU usage. You're updating a UI ever millisecond. |
@rchiodo time.sleep takes seconds.. not milliseconds. :/ |
This might be the problem we have of updating the rendering of every update. You can try the insider's build to see if it's any better as we addressed some UI update problems. |
I'm not seeing any such GPU usage on my own machine though. Maybe Electron isn't GPU accelerated on my machine though. You can disable it yourself I believe based on this issue here: |
@rchiodo I tried this at home now with a GTX 1070.. for some reason it's even worse here - GPU usage goes up to 30% when VS Code starts printing in the interactive window. As soon as I close the interactive window, it goes back down to almost 0%. Here's a screenshot with GPU-Z, which shows some more details: I also tried to disable GPU acceleration (just run |
Were you able to try the insider's build? It should eliminate some of our rendering. Although that GPU usage may just be the progress bar across the top. It's certainly continually rendering, so any render fixes won't make a difference. The css for that is here:
I put that into a jsfiddle. That should repro your GPU usage: |
Yeah that repros it for me in chrome. I guess we could have a setting that disables all animations. |
@rchiodo I tried the jsfiddle, it doesn't cause >10% GPU like VS Code does, but 2-4%.. not sure if that's really it? I tried to enable developer mode in VS Code, find the progress container and hide or completely remove it from the DOM.. but I failed to find it in the DOM (I ended up at some empty iframe). Not sure how that works. I tried the insiders build (2019.11.42782-dev), but GPU usage is exactly the same as before. As for disabling all animations - that would be fine for me. But please add some static indicator instead that shows if a cell is still running. Maybe change the color of the "Interrupt IPython Kernel" to gray while no cell is running and red while a cell is running.. or some other icon that tells the user if something is still running. |
Let's only show the cylon when we are performing an operation that is not running a cell. When running a cell we should just use the asterisk. |
My GPU usage shows around 5% while running that code. Validated |
Running the following piece of code in Python Interactive:
Results in >10% usage of my GPU (GTX 980 Ti):
(I haven't measured the impact, but I'd rather let pytorch use these 10% while the training loop is running...)
Other windows, like the terminal or even heavy scrolling in the code editor do not cause high GPU usage - for example heavily scrolling in the code window results in 1-2% GPU usage.. note that the code snippet above creates only 1 output per second, yet causes 10%.
Your Jupyter and/or Python environment
Please provide as much info as you readily know
The text was updated successfully, but these errors were encountered: