ROCm / HIP

HIP: C++ Heterogeneous-Compute Interface for Portability
https://rocmdocs.amd.com/projects/HIP/
MIT License
3.54k stars 518 forks source link

[Issue]: Windows + nvidia gpu = error: no ROCm-capable device is detected? #3519

Closed logic-finder closed 2 weeks ago

logic-finder commented 3 weeks ago

Problem Description

image source

Hi, today I tried to compile a .hip file in Visual Studio 2022 in Windows 11 with NVIDIA GeForce RTX 3080, but in vain. Although I attempted to change some environment variables such as HIP_PLATFORM=nvidia, HIP_COMPILER=nvcc, and HIPRUNTIME=cuda, the compiled executable file kept giving me the error message: **"no ROCm-capable devide is detected."_** So this time I tried to install HIP in WSL2 and it works like a charm. Thus it seems that I can't use HIP in Windows with NVIDIA gpu.

I think the following line causes the error:

HIP_CHECK(hipMalloc((void **)&input, input_size));

Thank you.

P.S. Since the required GPU selection list in this issue report doesn't provide an option corresponding to my gpu, I've chosen an arbitrary one!

Operating System

Windows 11, version 23H2 (OS build 22631.3593) // 10.0.22631

CPU

AMD Ryzen 3 3200G with Radeon Vega Graphics

GPU

AMD Instinct MI300X

ROCm Version

ROCm 5.7.0

ROCm Component

HIP

Steps to Reproduce

  1. I installed HIP SDK for Win 10&11 (ROCm version: 5.7.1) from this site.
  2. I changed the content of .hipInfo file in the sdk (path: 5.7/lib/.hipInfo).
    HIP_COMPILER=nvcc
    HIP_RUNTIME=cuda
    HIP_PLATFORM=nvidia
    <- here is a new line character.
    Without it, I think "5.7/bin/hipconfig --platform" would print "nvidi" ('a' dropped).
  3. I added the following environment variables in Settings - Advanced System Properties - Environment Variables - System Variables.
    HIP_COMPILER = nvcc
    HIP_RUNTIME = cuda
    HIP_PLATFORM = nvidia
  4. In Visual Studio 2022, I pressed the local Windows debugger button and it built without any error.
  5. I encountered the error message: "error: 'no ROCm-capable device is detected' at _filename.hip:_linenumber".

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

n/a

Additional Information

Incidentally, while I was following the installation manual in this repository, I had a difficult time to install HIP in WSL2 (Ubuntu 22.04) because of the following error:

// Before I entered the below commands,
// I had installed CUDA Toolkit 12.5 (Linux, x86_64, WSL-Ubuntu, 2.0).

develop@Cor:~/recycle_bin$ sudo apt-get install hip-runtime-nvidia hip-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package hip-runtime-nvidia
E: Unable to locate package hip-dev

From this reason, I tried the following commands and it seemed it was successful:

sudo apt update
wget https://repo.radeon.com/amdgpu-install/5.7.1/ubuntu/jammy/amdgpu-install_5.7.50701-1_all.deb
sudo apt install ./amdgpu-install_5.7.50701-1_all.deb
sudo amdgpu-install --usecase=hip,hiplibsdk
sudo apt-get install hip-runtime-nvidia hip-dev

Thank you.

harkgill-amd commented 2 weeks ago

Hi @logic-finder. Unfortunately, we do not currently support NVIDIA GPUs on the HIP SDK for Windows. As for the issue installing HIP on Ubuntu 22.04, there is currently an internal investigation ongoing to fix this. Thank you!