My GPU is dead while using Nvidia Apex

keunwoo: <p>I was training my model with 3 Nvidia 2080 Ti on Ubuntu 16.04.<br>
I used Nvidia Apex to use the full capacity of the gpus.<br>
However, my pytorch training code hung up after a few epochs.<br>
It worked well for one or two trainings.<br>
I terminated the program and check the gpus with ‘nvidia-smi’.<br>
It showed only two gpus (and it was really slow).</p>
<p>I found out that one of my gpus were dead.<br>
My computer did not properly boot with that dead gpu (GUI didn’t show up).<br>
I reinstalled OS of my computer to Ubuntu 18.04, reinstall drivers, but the problem still existed.<br>
When I plugged that GPU on a Windows machine, it showed a 43 error code.</p>
<p>I was wondering if this problem is caused by Apex or did my graphics card had a problem.<br>
Is there anyone who had a similar issue with Apex?</p>

ptrblck: <p>I’ve never seen this issue raised by using apex and suspect the GPU might have some hardware issues.<br>
Depending on the <code>opt_level</code> you are using in <code>apex.amp</code>, we are e.g. patching some PyTorch methods to use FP16 instead of FP32 (whitelist/blacklist style) or transform the model’s parameters to FP16 and use master parameters (master gradients) etc.<br>
<code>apex</code> does not manipulate the hardware in any way and just uses CUDA and PyTorch for e.g. mixed precision training.</p>
<p>How old is the GPU and how long was it working fine?</p>

keunwoo: <p>I just bought the gpus.<br>
I’ve been using the gpu about two weeks and it ran fine for a few train sessions.</p>
<p>I’m not sure it is relevant, but there were some weird incidents while using Apex.<br>
When I terminated a python script with ctrl-c, sometimes Apex did not fully terminate and some sub-processes existed. Those sub-processes kept held GPU memories, so I had to kill them manually. These incidents made me suspect Apex.</p>
<p>I agree that it might be a hardware problem, but I wonder if a high GPU utilization might harm a gpu.<br>
Is it possible that utilizing GPU 99% for a long time can affect the hardware (e.g. overheat)?</p>
<p>Moreover, is there any other way to utilize gpu up to 90% instead of using Apex?<br>
When I tested some codes, gpu utilization was around 50~70% and I’m not sure whether it is normal.<br>
I wanted to increase it, so I ended up with Apex.</p>

ptrblck: <aside class="quote no-group" data-username="keunwoo" data-post="3" data-topic="54862">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/keunwoo/48/28438_2.png" class="avatar"> keunwoo:</div>
<blockquote>
<p>I’m not sure it is relevant, but there were some weird incidents while using Apex.<br>
When I terminated a python script with ctrl-c, sometimes Apex did not fully terminate and some sub-processes existed. Those sub-processes kept held GPU memories, so I had to kill them manually. These incidents made me suspect Apex.</p>
</blockquote>
</aside>
<p>I’m not sure, if this is caused by <code>apex</code> or PyTorch, as I’ve seen this behavior using plain PyTorch. If I’m not mistaken, this should be fixed in the latest stable release.</p>
<aside class="quote no-group" data-username="keunwoo" data-post="3" data-topic="54862">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/keunwoo/48/28438_2.png" class="avatar"> keunwoo:</div>
<blockquote>
<p>I agree that it might be a hardware problem, but I wonder if a high GPU utilization might harm a gpu.<br>
Is it possible that utilizing GPU 99% for a long time can affect the hardware (e.g. overheat)?</p>
</blockquote>
</aside>
<p>If you didn’t overclocked the GPU, it should be fine. In case your device overheats, e.g. if your GPUs are packed tightly into the case, it should reduce its clock and shutdown as the last step.</p>
<aside class="quote no-group" data-username="keunwoo" data-post="3" data-topic="54862">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/keunwoo/48/28438_2.png" class="avatar"> keunwoo:</div>
<blockquote>
<p>Moreover, is there any other way to utilize gpu up to 90% instead of using Apex?<br>
When I tested some codes, gpu utilization was around 50~70% and I’m not sure whether it is normal.<br>
I wanted to increase it, so I ended up with Apex.</p>
</blockquote>
</aside>
<p>It depends on your code and e.g. you might have a data loading bottleneck.<br>
<a href="https://discuss.pytorch.org/t/how-to-prefetch-data-when-processing-with-gpu/548/19">This post</a> explains some workarounds.</p>

keunwoo: <p>Thank you very much! Your answers really helped me.</p>