Skip to content

clLinkProgram fails when linking SPIR-V that contains OpExtInst printf with a UniformConstant pointer as a %s format argument. #381

@pvelesko

Description

@pvelesko

Error:
: error: Invalid record (Producer: 'LLVM16.0.6' Reader: 'LLVM 16.0.6')
clLinkProgram returns CL_LINK_PROGRAM_FAILURE (-17).

Environment:
Device: Intel Arc A770
Driver: 25.44.36015.5
OS: Ubuntu 22.04

SPIR-V pattern that fails:
%fmt = OpVariable %ptr_UniformConstant ... ; "%s"
%str = OpVariable %ptr_UniformConstant ... ; "Hello"
%r = OpExtInst %uint %1 printf %fmt %str ; FAILS

Notes:
SPIR-V passes spirv-val validation
Same kernel compiles fine from OpenCL C source
printf with integer arguments works fine

Reproducer: https://github.com/pvelesko/reproducers/tree/main/opencl-printf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions