Not able to use torch with NVIDIA Geforce MX130

Megha_jain: <p>I have a laptop with Intel UHD card and NVIDIA Geforce MX130. My CUDA version is 12.0<br>
Environment path variable is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0.<br>
torch version 1.13.1.<br>
Please help me with following errors<br>
<strong>But torch.cuda.is_available() is shown as false</strong><br>
but for tensor flow<br>
tf.test.is_built_with_cuda() is shown as true<br>
tf.config.experimental.list_physical_devices(‘gpu’) is []</p>
<p>Additional info:</p>
<p>nvcc --version is</p>
<p>nvcc: NVIDIA (R) Cuda compiler driver<br>
Copyright (c) 2005-2022 NVIDIA Corporation<br>
Built on Mon_Oct_24_19:40:05_Pacific_Daylight_Time_2022<br>
Cuda compilation tools, release 12.0, V12.0.76<br>
Build cuda_12.0.r12.0/compiler.31968024_0</p>
<p>from numba import cuda<br>
cuda.detect()</p>
<p>shows</p>
<p>Found 1 CUDA devices<br>
id 0    b’NVIDIA GeForce MX130’                              [SUPPORTED]<br>
Compute Capability: 5.0<br>
PCI Device ID: 0<br>
PCI Bus ID: 1<br>
Watchdog: Enabled<br>
Compute Mode: WDDM<br>
FP32/FP64 Performance Ratio: 32<br>
Summary:<br>
1/1 devices are supported</p>
<p>nvidia-smi</p>
<p>shows</p>
<p>±----------------------------------------------------------------------------+<br>
| NVIDIA-SMI 527.41       Driver Version: 527.41       CUDA Version: 12.0     |<br>
|-------------------------------±---------------------±---------------------+<br>
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |<br>
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |<br>
|                               |                      |               MIG M. |<br>
|===============================+======================+======================|<br>
|   0  NVIDIA GeForce … WDDM  | 00000000:01:00.0 Off |                  N/A |<br>
| N/A    0C    P8    N/A /  N/A |      0MiB /  2048MiB |      1%      Default |<br>
|                               |                      |                  N/A |<br>
±------------------------------±---------------------±---------------------+</p>
<p>±----------------------------------------------------------------------------+<br>
| Processes:                                                                  |<br>
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |<br>
|        ID   ID                                                   Usage      |<br>
|=============================================================================|<br>
|  No running processes found                                                 |<br>
±----------------------------------------------------------------------------+</p>

ptrblck: <p>Could you post the output of <code>python -m torch.utils.collect_env</code> please?</p>

Megha_jain: <p>Thanks for the reply. Following is the output</p>
<p>Traceback (most recent call last):<br>
File “C:\Users\Megha\anaconda3\lib\runpy.py”, line 188, in _run_module_as_main<br>
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)<br>
File “C:\Users\Megha\anaconda3\lib\runpy.py”, line 111, in <em>get_module_details<br>
<strong>import</strong>(pkg_name)<br>
File "C:\Users\Megha\anaconda3\lib\site-packages\torch_<em>init</em></em>.py", line 139, in <br>
raise err<br>
OSError: [WinError 126] The specified module could not be found. Error loading “C:\Users\Megha\anaconda3\lib\site-packages\torch\lib\caffe2_nvrtc.dll” or one of its dependencies.</p>

Megha_jain: <p>By doing above exercise, I also found that my path is C:\Users\Megha\AppData\Local\Microsoft\WindowsApps whereas output of os.path.dirname(sys.executable) is C:\Users\Megha\anaconda3.</p>
<p>Can this be creating some issue? Sorry in advance as I am new to all this and trying to self learn</p>

ptrblck: <p>Based on <a href="https://discuss.pytorch.org/t/cannot-import-torch-error-loading-caffe2-nvrtc-dll/166808">this topic</a> it seems as if the installation might be corrupt somehow and reinstalling it fixed the issue. Do you see the <code>caffe2_nvrtc.dll</code> in the posted folder?</p>

AlanJohnstone: <p>What is the “posted folder”<br>
Alan</p>

ptrblck: <aside class="quote no-group" data-username="Megha_jain" data-post="3" data-topic="170262">
<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/megha_jain/48/56406_2.png" class="avatar"> Megha_jain:</div>
<blockquote>
<p>Error loading “C:\Users\Megha\anaconda3\lib\site-packages\torch\lib\caffe2_nvrtc.dll” or one of its dependencies.</p>
</blockquote>
</aside>
<p>The install folder where the missing <code>.dll</code> should be located.</p>

Megha_jain: <p>I have reinstalled torch but again I am facing the same problem. What might be causing faulty installation</p>

Megha_jain: <p>Sorry for the confusion but I think I am not able to uninstall torch in the first place.<br>
conda uninstall torch<br>
Collecting package metadata (repodata.json): …working… done<br>
Solving environment: …working… failed</p>
<p>Note: you may need to restart the kernel to use updated packages.</p>
<p>PackagesNotFoundError: The following packages are missing from the target environment:</p>
<ul>
<li>torch</li>
</ul>
<p>However, output of pip show torch is</p>
<p>ame: torch<br>
Version: 1.13.1<br>
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration<br>
Home-page: <a href="https://pytorch.org/" rel="noopener nofollow ugc">https://pytorch.org/</a><br>
Author: PyTorch Team<br>
Author-email: <a href="mailto:packages@pytorch.org">packages@pytorch.org</a><br>
License: BSD-3<br>
Location: c:\users\megha\anaconda3\lib\site-packages<br>
Requires: typing_extensions<br>
Required-by: torchvision, torchaudio<br>
Note: you may need to restart the kernel to use updated packages.</p>

ptrblck: <p>Try to run <code>conda uninstall pytorch</code> instead as this should be the conda package name.</p>