Compiling CUDA with clang - 'No available targets are compatible with triple "nvptx64-nvidia-cuda"'

I am trying to compile the example CUDA code axpy.cu from the llvm docs using

clang++ axpy.cu -o axpy --cuda-gpu-arch=sm_86 -L/usr/local/cuda-11.2/lib64 -lcudart_static -ldl -lrt -pthread

but I’m getting the following error:

error: unable to create target: 'No available targets are compatible with triple "nvptx64-nvidia-cuda"'

I’m using clang 13 on CentOS 7, the GPU is RTX 3090. I could successfully compile cuda code a day or two ago but something changed on my system and now I’m getting this error message.