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 |
+-----------------------------------------------------------------------------+
3

3 Answers

  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
  1. kill the PID that you no longer need with sudo kill -9 <PID>
    Example: sudo kill -9 2001

nvidia-smi

NVIDIA System Management Interface program

sudo nvidia-smi --gpu-reset -i 0

Go to NVDIA X server settings -> PRIME Profiled -> Turn on NVIDIA (On Demand). I had Performance mode enabled, which caused Xorg and gnome-shell to run on my dgpu and consume around 430mb memory. Be sure to reboot your PC once you set that option.

Although this question is 4yrs old, just leaving my answer here in case anyone finds it helpful.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like