intel / intel/llvm

[SYCL][HIP] hip/amd device not found when building with hip

Open
#5,314 0 comments 0 reactions 0 assignees View on GitHub
bug hip
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

I have a host running centos7 with and AMD Vega 56 (gfx900). Rocm 4.5 and CUDA 11.5.0 are installed.

I have built from a recent commit (106882cf5f15), using the buildbot configuration opts `--hip --hip-platform AMD --hip-amd-arch gfx900 -t release --no-werror --shared-libs`, but when I list available devices I only see the OpenCL one:
```
[opencl:gpu:0] AMD Accelerated Parallel Processing, gfx900:xnack- 2.0 [3361.0 (HSA1.1,LC)]
[host:host:0] SYCL host platform, SYCL host device 1.2 [1.2]

Platforms: 2
Platform [#1]:
Version : OpenCL 2.2 AMD-APP (3361.0)
Name : AMD Accelerated Parallel Processing
Vendor : Advanced Micro Devices, Inc.
Devices : 1
Device [#0]:
Type : gpu
Version : 2.0
Name : gfx900:xnack-
Vendor : Advanced Micro Devices, Inc.
Driver : 3361.0 (HSA1.1,LC)
Platform [#2]:
Version : 1.2
Name : SYCL host platform
Vendor :
Devices : 1
Device [#0]:
Type : host
Version : 1.2
Name : SYCL host device
Vendor :
Driver : 1.2
default_selector() : gpu, AMD Accelerated Parallel Processing, gfx900:xnack- 2.0 [3361.0 (HSA1.1,LC)]
host_selector() : host, SYCL host platform, SYCL host device 1.2 [1.2]
accelerator_selector() : No device of requested type available. -1 (CL_DEVI...
cpu_selector() : No device of requested type available. -1 (CL_DEVI...
gpu_selector() : gpu, AMD Accelerated Parallel Processing, gfx900:xnack- 2.0 [3361.0 (HSA1.1,LC)]
custom_selector(gpu) : gpu, AMD Accelerated Parallel Processing, gfx900:xnack- 2.0 [3361.0 (HSA1.1,LC)]
custom_selector(cpu) : No device of requested type available. -1 (CL_DEVI...
custom_selector(acc) : No device of requested type available. -1 (CL_DEVI...
```

I believe there should be a platform with a `Version : HIP XXX.YY` and `Name: AMD HIP BACKEND`

I have built with both gcc 8.4.0 and 9.3.0, with the same result.

When I try to execute a program on the gpu, built with `-fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx900`, I get the error
```
terminate called after throwing an instance of 'cl::sycl::runtime_error'
what(): Native API failed. Native API returns: -42 (CL_INVALID_BINARY) -42 (CL_INVALID_BINARY)
```

The host also has an NVIDIA card, and when I build with `--hip-platform NVIDIA`, it works fine.

Not sure what's going wrong here. Any suggestions?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.