title: Does Amazon GPU Instance Get Exclusive Access to the GPU?
body: <p>I am running Ubuntu 16.04 on an EC2 p2.xlarge shared instance.
  <a href="https://i.stack.imgur.com/m0Y5D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m0Y5D.png" alt="enter image description here"></a></p>
  
  <p>The P2.xlarge instance gives access to a single GPU (1/2 of an NVidia K80 GPU?) to my shared instance.</p>
  
  <h2>How is this GPU shared between other Amazon EC2 instances on the same physical machine?</h2>
  
  <p>I was under the impression that 100% of the GPU was allocated to my instance. But this is clearly not the case. When my instance is running <em>nothing</em> on the GPU:</p>
  
  <pre><code>$ nvidia-smi
  Tue Feb 21 00:11:16 2017       
  +-----------------------------------------------------------------------------+
  | NVIDIA-SMI 375.39                 Driver Version: 375.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  Tesla K80           Off  | 0000:00:1E.0     Off |                    0 |
  | N/A   39C    P0    55W / 149W |      0MiB / 11439MiB |     63%      Default |
  +-------------------------------+----------------------+----------------------+
  
  +-----------------------------------------------------------------------------+
  | Processes:                                                       GPU Memory |
  |  GPU       PID  Type  Process name                               Usage      |
  |=============================================================================|
  |  No running processes found                                                 |
  +-----------------------------------------------------------------------------+
  </code></pre>
  
  <p>A moment later:</p>
  
  <pre><code>|   0  Tesla K80           Off  | 0000:00:1E.0     Off |                    0 |
  | N/A   40C    P0    57W / 149W |      0MiB / 11439MiB |     97%      Default |
  </code></pre>
  
  <p>And the next moment:</p>
  
  <pre><code>|   0  Tesla K80           Off  | 0000:00:1E.0     Off |                    0 |
  | N/A   40C    P0    56W / 149W |      0MiB / 11439MiB |    100%      Default |
  </code></pre>
  
  <p>And pretty much stays there...</p>
  
  <pre><code>|   0  Tesla K80           Off  | 0000:00:1E.0     Off |                    0 |
  | N/A   41C    P0    56W / 149W |      0MiB / 11439MiB |    100%      Default |
  
  
  |   0  Tesla K80           Off  | 0000:00:1E.0     Off |                    0 |
  | N/A   41C    P0    56W / 149W |      0MiB / 11439MiB |     99%      Default |
  </code></pre>
  
  <h2>What are the rules for GPU allocation for GPU instances?</h2>