# Unable to access GPU using cuda in jetson

**URL:** <https://forums.developer.nvidia.com/t/unable-to-access-gpu-using-cuda-in-jetson/231145>\
**Category:** Jetson Nano\
**Tags:** cuda\
**Created:** [October 18, 2022, 3:20pm UTC](https://forums.developer.nvidia.com/t/unable-to-access-gpu-using-cuda-in-jetson/231145 "2022-10-18T15:20:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yashkumar.atkare.ai](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@yashkumar.atkare.ai](https://forums.developer.nvidia.com/u/yashkumar.atkare.ai)\
**Post date:** [October 18, 2022, 3:20pm UTC](https://forums.developer.nvidia.com/t/unable-to-access-gpu-using-cuda-in-jetson/231145/1 "2022-10-18T15:20:12Z")

</div>

Hello,  
i am trying to run yolo v7 algorithm on jetson nano, but i am unable to use gpu, i am using cuda 11.  
getting this error

```auto
    assert torch.cuda.is_available(), f'CUDA unavailable, invalid device {device} requested' # check availability
AssertionError: CUDA unavailable, invalid device 0 requested

```

here’s the CUDA version:

```auto
 nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:10_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0

```

I am beginner  
Please help me !

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [October 18, 2022, 5:05pm UTC](https://forums.developer.nvidia.com/t/unable-to-access-gpu-using-cuda-in-jetson/231145/2 "2022-10-18T17:05:37Z")

</div>

I’m guessing you installed content with some method other than JetPack/SDK Manager. `nvidia-smi` is for PCI-based GPUs, but Jetson GPUs are directly integrated with the memory controller. That software (and drivers) will fail with non-PCI GPUs.

You’ll need to remove anything which was not for the Jetson, and add via JetPack/SDKM instead (use the release currently installed).

---

<div class="post-metadata">

**Author:** ![yashkumar.atkare.ai](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@yashkumar.atkare.ai](https://forums.developer.nvidia.com/u/yashkumar.atkare.ai)\
**Post date:** [October 19, 2022, 11:26am UTC](https://forums.developer.nvidia.com/t/unable-to-access-gpu-using-cuda-in-jetson/231145/3 "2022-10-19T11:26:41Z")

</div>

Noted! , can you please tell me how can i remove which is not for the jetson

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [October 19, 2022, 4:34pm UTC](https://forums.developer.nvidia.com/t/unable-to-access-gpu-using-cuda-in-jetson/231145/4 "2022-10-19T16:34:26Z")

</div>

I will recommend flashing and reinstalling if you don’t need what is present. However, here are some general tips:

- To find out the full path of a program, e.g., `nvidia-smi`:  
`which nvidia-smi`
- To search for the package owning a program:  
`dpkg -S /usr/bin/nvidia-smi`
- To both find and search in one command (remove the backslash “`\`”, I have those to escape the forum’s use of the single backquote and it won’t let me type it in correctly…basically the first “`which nvidia-smi`” surrounded by single backquote):

```auto
dpkg -S \`which nvidia-smi\`

```

- To remove a package, for example “`nvidia-utils-450`” (which happens to be a desktop version and not intended for a Jetson):  
`sudo apt remove nvidia-utils-450`
- To see which L4T release runs on your Jetson:  
`head -n 1 /etc/nv_tegra_release`
- To find the correct software for installing to a Jetson (including flash, but you can uncheck everything except for the package you want to install to the Jetson):  
[https://developer.nvidia.com/linux-tegra](https://developer.nvidia.com/linux-tegra)  
(each L4T release is tied to a single JetPack/SDKM release)

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 19, 2022, 8:20pm UTC](https://forums.developer.nvidia.com/t/unable-to-access-gpu-using-cuda-in-jetson/231145/5 "2022-10-19T20:20:46Z")

</div>

Additional note for when you’ll have clean up as advised by @linuxdev :

You can get similar information as from nvidia-smi from other tools with Jetson;

- **Get GPU capabilities** : you can get that from **deviceQuery**. Just build as root the sample in `/usr/local/cuda/samples/1_Utilities/deviceQuery` and run it.

- **Get GPU usage and temperature** : You may use tool **tegrastats**. GPU is referred as `GR3D`, you would see usage and current clock frequency. For temperature, you would further see something like: `GPU@40.875C`

- For memory usage, Jetsons have an iGPU sharing physical memory with the system.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [November 2, 2022, 8:21pm UTC](https://forums.developer.nvidia.com/t/unable-to-access-gpu-using-cuda-in-jetson/231145/6 "2022-11-02T20:21:16Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
