deep learning – PyTorch not detecting AMD GPU although ROCM installed on Ubuntu 20.04 LST

OS Version: Ubuntu 20.04 LTS
PyTorch Version: 2.0
ROCM version: 5.0.2

I installed a fresh copy of Ubuntu 20.04 LTS on my desktop with AMD Radeon RX 5700 XT GPU. Both ROCM and PyTorch installed fine. However, PyTorch is not able to detect GPU. Any pointers here?

$ python -c "import torch; print(torch.__version__)"
2.0.0+cu117
$ apt show rocm-libs -a

Package: rocm-libs

Version: 5.0.2.50002-72

Priority: optional

Section: devel

Maintainer: ROCm Libs Support <rocm-libs.support@amd.com>

Installed-Size: 13.3 kB

Depends: hipblas, hipfft, hipsolver, hipsparse, miopen-hip, rccl, rocalution, rocblas, rocfft, rocrand, rocsolver, rocsparse, rocm-core, hipblas-dev, hipcub-dev, hipfft-dev, hipsolver-dev, hipsparse-dev, miopen-hip-dev, rccl-dev, rocalution-dev, rocblas-dev, rocfft-dev, rocprim-dev, rocrand-dev, rocsolver-dev, rocsparse-dev, rocthrust-dev

Homepage: https://github.com/RadeonOpenCompute/ROCm

Download-Size: 898 B

APT-Sources: https://repo.radeon.com/rocm/apt/5.0.2 ubuntu/main amd64 Packages

Description: Radeon Open Compute (ROCm) Runtime software stack
$ rocminfo | grep 'Name:'
  Name:                    Intel(R) Core(TM) i3-10100 CPU @ 3.60GHz
  Marketing Name:          Intel(R) Core(TM) i3-10100 CPU @ 3.60GHz
  Vendor Name:             CPU                                
  Name:                    gfx1010                            
  Marketing Name:          AMD Radeon RX 5700 XT              
  Vendor Name:             AMD                                
      Name:                    amdgcn-amd-amdhsa--gfx1010:xnack-
$ python3

Python 3.9.16 (main, Mar 8 2023, 14:00:05)

[GCC 11.2.0] :: Anaconda, Inc. on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import torch

>>> print("GPU available:", torch.cuda.is_available())

GPU available: False

I have also tried Ubuntu 22.04 LTS. But it does not work either.

Read more here: Source link