Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIP kernels with bool parameters produce non-conformant SPIR-V #849

Open
linehill opened this issue May 13, 2024 · 0 comments
Open

HIP kernels with bool parameters produce non-conformant SPIR-V #849

linehill opened this issue May 13, 2024 · 0 comments
Milestone

Comments

@linehill
Copy link
Collaborator

HIP kernels with bool parameters fail to run on rusticl. This is due to the produced SPIR-V being non-conformant respect to the OpenCL SPIR-V environment specification. The SPIR-V kernels have parameters of OpTypeBool type but they are not allowed in kernels.

$ cat bool-kernel-arg.hip
#include <hip/hip_runtime.h>

__global__ void k(bool cond) { printf("cond=%d\n", cond); }

int main() {
  k<<<1, 1>>>(true);
  if (hipGetLastError() != hipSuccess)
    return 1;
  if (hipDeviceSynchronize() != hipSuccess)
    return 2;
  return 0;
}
$ ../install/bin/hipcc bool-kernel-arg.hip -O2 -o bool-kernel-arg
$ CHIP_LOGLEVEL=info ./bool-kernel-arg
CHIP info [TID 31602] [1715603385.982596711] : CHIP_PLATFORM=0
CHIP info [TID 31602] [1715603385.982717400] : CHIP_DEVICE_TYPE=default
CHIP info [TID 31602] [1715603385.982754591] : CHIP_DEVICE=0
CHIP info [TID 31602] [1715603385.982776661] : CHIP_BE=opencl
CHIP info [TID 31602] [1715603385.982803903] : CHIP_DUMP_SPIRV=off
CHIP info [TID 31602] [1715603385.982844175] : CHIP_JIT_FLAGS_OVERRIDE=-cl-kernel-arg-info -cl-std=CL3.0
CHIP info [TID 31602] [1715603385.982882198] : CHIP_L0_COLLECT_EVENTS_TIMEOUT=0
CHIP info [TID 31602] [1715603385.982905412] : CHIP_L0_EVENT_TIMEOUT=0
CHIP info [TID 31602] [1715603385.982921474] : CHIP_SKIP_UNINIT=off
CHIP info [TID 31602] [1715603387.961502576] : OpenCL Devices of type default with SPIR-V_1 support:
AMD Radeon Pro VII (radeonsi, vega20, LLVM 17.0.6, DRM 3.57, 6.5.0-28-generic)  is supported.

CHIP warning [TID 31602] [1715603387.961755173] : The device might not support subgroup size 32, warp-size sensitive kernels might not work correctly.
CHIP error [TID 31602] [1715603387.965727841] : hipErrorTbd (CL_INVALID_ARG_SIZE clSetKernelArg failed) in /mnt/md0/linehill/ws-chip-spv-3/chipstar/src/backend/OpenCL/CHIPBackendOpenCL.cc:1752:operator()

CHIP error [TID 31602] [1715603387.965848329] : Caught Error: hipErrorTbd
@pvelesko pvelesko modified the milestones: Release 1.2, Release 1.3 May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants