CUDA Memory Release

$ nvidia-smi
$ lsof /dev/nvidia*
$ ps f -o user,pgrp,pid,pcpu,pmem,start,time,command -p `lsof -n -w -t /dev/nvidia*`
$ kill -9 $(lsof -t)

REFERENCES:

  • https://gist.github.com/mgoldchild/c79345ed56d712466a2818a615714d4e