Pytorch not working for me but same setting works for other user

username: mhadnanali
cooked: <p>I can not run a simple code as this<br>
import torch<br>
toTest=torch.rand(2,4)<br>
toTest=toTest.to(“cuda”)<br>
print(toTest)</p>
<p>it just stuck and nothing happens.<br>
Note: My real code is something else, but that one is also doing same, runs fine on cpu but not on cuda.</p>
<p>Here are the possibilities I tried so far.<br>
1- all other options go to the same problem, but 10.2 has a different error as this is not compatible with RTX 3090.<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/7/4/74edd2007378d5c6b2bdf26a13127c7a5a255e13.jpeg" alt="image" data-base62-sha1="gGoUGoUvF5O7L3mo7kWAigIuVN1" width="384" height="411"></p>
<p>but nothing worked. Even I asked my server admin to create a new account for me. he created a new account and I just installed the below packages. These are the total packages installed in my conda env.</p>
<p>(cant upload pictures as I am a new user)</p>
<p>My least requirement is Pytorch 1.9.0 as it is required by PyGCL.<br>
I even asked my admin to create a new user for me and then I installed it there. but no… still the same problem. While my other labmate is using 1.9.0+cu111 or the same server and he has no problem.<br>
Any guess what could be a possible problem?</p>
<p>here is the stackoverflow version of the question as there i can upload pictures.</p><aside class="onebox stackexchange" data-onebox-src="https://stackoverflow.com/questions/70357564/pytorch-with-gpu-is-not-working-but-working-fine-with-cpu">
  <header class="source">

      <a href="https://stackoverflow.com/questions/70357564/pytorch-with-gpu-is-not-working-but-working-fine-with-cpu" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>

  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/3809691/adnan-ali" target="_blank" rel="noopener nofollow ugc">
    <img alt="Adnan Ali" src="https://graph.facebook.com/100001763021303/picture?type=large" class="thumbnail onebox-avatar" width="" height="">
  </a>

<h4>
  <a href="https://stackoverflow.com/questions/70357564/pytorch-with-gpu-is-not-working-but-working-fine-with-cpu" target="_blank" rel="noopener nofollow ugc">PyTorch with GPU is not working but working fine with CPU</a>
</h4>

<div class="tags">
  <strong>pytorch, gpu</strong>
</div>

<div class="date">
  asked by
  
  <a href="https://stackoverflow.com/users/3809691/adnan-ali" target="_blank" rel="noopener nofollow ugc">
    Adnan Ali
  </a>
  on <a href="https://stackoverflow.com/questions/70357564/pytorch-with-gpu-is-not-working-but-working-fine-with-cpu" target="_blank" rel="noopener nofollow ugc">01:45AM - 15 Dec 21 UTC</a>
</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>


username: ptrblck
cooked: <p>Since the same system seems to work for other users, I would guess it’s a setup issue on your account.<br>
Try to run any CUDA application (e.g. build the CUDA samples and execute them on all devices), use a docker container and see if it would be working there, check <code>dmesg</code> for any Xid error codes.</p>

username: mhadnanali
cooked: <p>It turned out to be the device problem (The device i was trying on just behave as i mentioned in the question, so i tried with different devices and got different errors but at least i know that where is the problem), I keep the question here, may be useful for someone else in the future.</p>