Skip to content

GPU usage fluctuate in VS Code, but stably high in other IDE. #238197

Open
@hawkiyc

Description

@hawkiyc

Type: Performance Issue

I am building a BERT-like model with pytorch, but I encounter a very unstable GPU usage while training my model on VS Code.
I tested the same code and python env in Spyder IDE, everything is fine and GPU usage is stably above 90%. So, it seems that there is something bog down my device and cause the bottleneck.

VS Code version: Code 1.96.4 (cd4ee3b, 2025-01-16T00:16:19.038Z)
OS version: Linux x64 6.8.0-51-generic
Modes:

System Info
Item Value
CPUs Intel(R) Xeon(R) CPU E7-8890 v3 @ 2.50GHz (144 x 0)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 0, 1, 12
Memory (System) 125.72GB (118.82GB free)
Process Argv --crash-reporter-id 4e28e8db-6680-4dea-a577-845468db680c
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Process Info
CPU %	Mem MB	   PID	Process
    0	   129	167128	code main
    0	     0	167132	   zygote
    0	   129	167175	     gpu-process
    0	     0	167210	       broker
    0	     0	167133	   zygote
    0	     0	167135	     zygote
    0	   257	167191	window [1] (train.py - ECG_Encoder_for_JoLT - Visual Studio Code)
    0	     0	167177	   utility-network-service
    0	     0	167318	ptyHost
    0	     0	167434	     /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
    0	     0	167437	     /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
    0	     0	167914	     /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
    0	     0	168130	     /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
    0	   386	167333	extensionHost [1]
    0	     0	167632	     /home/revlis_ai/.vscode/extensions/ms-python.python-2024.22.2-linux-x64/python-env-tools/bin/pet server
    0	     0	168094	     /usr/share/code/code /usr/share/code/resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=167333
    0	   257	179521	     electron-nodejs (bundle.js )
    0	   129	167364	shared-process
    0	     0	180812	     /bin/sh -c /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	     0	180813	       /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	   129	167366	fileWatcher [1]
Workspace Info
|  Window (train.py - ECG_Encoder_for_JoLT - Visual Studio Code)
|    Folder (ECG_Encoder_for_JoLT): more than 44316 files
|      File types: dat(9641) hea(9641) png(610) npz(19) hdf5(18) txt(8) pt(8)
|                  py(8) pyc(3) csv(3)
|      Conf files:;
Extensions (23)
Extension Author (truncated) Version
arepl alm 3.0.0
githistory don 0.6.20
gitlens eam 16.2.0
vscode-html-css ecm 2.0.12
copilot Git 1.257.0
copilot-chat Git 0.23.2
vscode-docker ms- 1.29.3
vscode-language-pack-zh-hant MS- 1.96.2024121109
debugpy ms- 2024.14.0
python ms- 2024.22.2
vscode-pylance ms- 2024.12.1
datawrangler ms- 1.16.0
jupyter ms- 2024.11.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.21
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.394.0
remote-wsl ms- 0.88.5
vscode-yaml red 1.15.0
pdf tom 1.2.2
vscode-pets ton 1.27.0
tconda zhp 0.0.5
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624
dwoutputs:31217127

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions