CUDA driver API cuLinkComplete can't find libdevice (nvvm intrinsics bitcode)


I’m using CUDA 11.5 on an Ubuntu 20.04 and in using the CUDA driver API’s cuLinkComplete, I get the following link error:

error: cuLinkComplete(linkState, &cubinData, &cubinSize) failed with error code device kernel image is invalid[error : Undefined reference to ‘__nv_expf’ in …

Now __nv_expf is an intrinsic that is part of CUDA’s libdevice library and it’s in the form of NVVM bitcode which I can see at /usr/local/cuda-11.5/nvvm/libdevice/libdevice.10.bc. However, somehow, the link above is failing. I am using the right (CUDA 11.5) driver API.

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_Sep_13_19:13:29_PDT_2021
Cuda compilation tools, release 11.5, V11.5.50
Build cuda_11.5.r11.5/compiler.30411180_0

Does anyone have insights into why it fails to find/link with libdevice here? I don’t have this issue on another Ubuntu 20.04 system where I use CUDA 11.2.