How can I free my GPU memory in Ubuntu 14.04?
How can I free my gpu memory as much as possible?
Currently there seems 400+ MB of GPU ram to be always occupied!
How can I free these ?
Wed Feb 24 21:48:33 2016
+------------------------------------------------------+
| NVIDIA-SMI 352.39 Driver Version: 352.39 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 750 Off | 0000:01:00.0 On | N/A |
| 22% 31C P8 0W / 38W | 438MiB / 2046MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 731 C /usr/bin/python 24MiB |
| 0 1121 G /usr/bin/X 260MiB |
| 0 2058 G compiz 140MiB |
| 0 8408 G /proc/self/exe 3MiB |
+-----------------------------------------------------------------------------+
Solution 1:
- Check what is using your GPU memory with
sudo fuser -v /dev/nvidia*
The output will be as follows:
USER PID ACCESS COMMAND
/dev/nvidia0: root 10 F...m Xorg
user 1025 F...m compiz
user 1070 F...m python
user 2001 F...m python
- kill the PID that you no longer need with
sudo kill -9 <PID>
Example:sudo kill -9 2001
Solution 2:
nvidia-smi
NVIDIA System Management Interface program
sudo nvidia-smi --gpu-reset -i 0