Skip to content

Instantly share code, notes, and snippets.

@msaroufim
Created June 11, 2025 21:24
Show Gist options
  • Save msaroufim/d3f2676936e163d2dce4265df97b9118 to your computer and use it in GitHub Desktop.
Save msaroufim/d3f2676936e163d2dce4265df97b9118 to your computer and use it in GitHub Desktop.
# Stop all GPU monitoring services that block ncu
sudo systemctl stop nvidia-dcgm.service dynologd.service
# Verify they're stopped
sudo systemctl list-units --state=active | grep -E "(nvidia|dynolog)"
# Check GPU is clear
sudo lsof /dev/nvidia7 | grep -v python
# Now run ncu
CUDA_VISIBLE_DEVICES=7 ncu --page source \
--import-source yes \
--source-folders /home/marksaroufim/pytorch/aten/src/ATen/native/cuda \
python /home/marksaroufim/test/t.py
# When done, restart the services
sudo systemctl start nvidia-dcgm.service dynologd.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment