print(torch.cuda.is_available())

jackwky: <p>(openocc) (base) jackwky@LAPTOP-EITG560S:~/Myproject/Model/10-OCC/OpenOccupancy$ nvcc -V<br>
nvcc: NVIDIA (R) Cuda compiler driver<br>
Copyright (c) 2005-2021 NVIDIA Corporation<br>
Built on Sun_Mar_21_19:15:46_PDT_2021<br>
Cuda compilation tools, release 11.3, V11.3.58<br>
Build cuda_11.3.r11.3/compiler.29745058_0<br>
(openocc) (base) jackwky@LAPTOP-EITG560S:~/Myproject/Model/10-OCC/OpenOccupancy$ nvidia-smi<br>
Sat Jan  6 16:30:28 2024<br>
±--------------------------------------------------------------------------------------+<br>
| NVIDIA-SMI 535.129.03             Driver Version: 545.84       CUDA Version: 12.3     |<br>
|-----------------------------------------±---------------------±---------------------+<br>
| GPU  Name                 Persistence-M | 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 RTX 4060 …    On  | 00000000:01:00.0  On |                  N/A |<br>
| N/A   46C    P8               3W / 125W |   2576MiB /  8188MiB |      2%      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>
±--------------------------------------------------------------------------------------+<br>
(openocc) (base) jackwky@LAPTOP-EITG560S:~/Myproject/Model/10-OCC/OpenOccupancy$ echo $CUDA_HOME<br>
/usr/local/cuda-11.3<br>
(openocc) (base) jackwky@LAPTOP-EITG560S:~/Myproject/Model/10-OCC/OpenOccupancy$ echo $LD_LIBRARY_PATH<br>
/usr/local/cuda-11.3/lib64:/usr/local/cuda-11.3/lib64:</p>
<p>import torch</p>
<p>print(torch.<strong>version</strong>)<br>
1.10.1</p>
<p>print(torch.cuda.is_available())<br>
False</p>
<p>print(torch.cuda.device_count())<br>
0</p>
<p>print(torch.cuda.get_device_name(0))<br>
RuntimeError Traceback (most recent call last) /tmp/ipykernel_39354/304443368.py in  3 print(torch.cuda.is_available()) 4 print(torch.cuda.device_count()) ----&gt; 5 print(torch.cuda.get_device_name(0)) <a href="https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jackwky/Myproject/Model/10-OCC/OpenOccupancy/~/miniconda3/envs/OpenOccupancy/lib/python3.7/site-packages/torch/cuda/__init__.py" rel="noopener nofollow ugc">~/miniconda3/envs/OpenOccupancy/lib/python3.7/site-packages/torch/cuda/<strong>init</strong>.py</a> in get_device_name(device) 324 str: the name of the device 325 “”" → 326 return get_device_properties(device).name 327 328 <a href="https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jackwky/Myproject/Model/10-OCC/OpenOccupancy/~/miniconda3/envs/OpenOccupancy/lib/python3.7/site-packages/torch/cuda/__init__.py" rel="noopener nofollow ugc">~/miniconda3/envs/OpenOccupancy/lib/python3.7/site-packages/torch/cuda/<strong>init</strong>.py</a> in get_device_properties(device) 354 _CudaDeviceProperties: the properties of the device 355 “”" → 356 _lazy_init() # will define _get_device_properties 357 device = _get_device_index(device, optional=True) 358 if device &lt; 0 or device &gt;= device_count(): <a href="https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/jackwky/Myproject/Model/10-OCC/OpenOccupancy/~/miniconda3/envs/OpenOccupancy/lib/python3.7/site-packages/torch/cuda/__init__.py" rel="noopener nofollow ugc">~/miniconda3/envs/OpenOccupancy/lib/python3.7/site-packages/torch/cuda/<strong>init</strong>.py</a> in _lazy_init() 212 # This function throws if there’s a driver initialization error, no GPUs 213 # are found or any other error occurs → 214 torch._C._cuda_init() 215 # Some of the queued calls may reentrantly call _lazy_init(); 216 # we need to just return without initializing in that case. RuntimeError: No CUDA GPUs are available</p>

ptrblck: <p>Install the latest stable or nightly release with CUDA support and run your test again.</p>

jackwky: <p>I’m sorry, I don’t quite understand what you mean. What exactly do I need to install? Need to update cuda11.3 or the driver version viewed by nvidia-smi or pytorch?</p>

ashok_arora: <p>Something along the lines of</p>
<pre><code class="lang-auto">conda install pytorch torchvision cudatoolkit=11.3 -c pytorch
</code></pre>
<p>so the pytorch has CUDA support built-in.</p>