<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54498>54498</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Compiling CUDA example from llvm docs - 'No available targets are compatible with triple "nvptx64-nvidia-cuda"'
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          fbartolic
      </td>
    </tr>
</table>

<pre>
    I am trying to compile the example CUDA code axpy.cu from the [llvm docs](https://llvm.org/docs/CompileCudaWithLLVM.html#invoking-clang) 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 built llvm-13.0.0 from source and I've used `clang++` to successfully  compile cuda code a few days ago but something changed on my system and now I'm getting this error message. I have no idea what to do about it.  I'm running CentOS 7. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytU01v2zAM_TX2hbBhyx9xDj60CQoE6LbDsO04yJJia5MtQx9J8-9HKUm7Yj0OEGxRpB6f-MhB80t_ADqDMxe5jOA0MD2vUglwkwDxQucV97tv-wd0cAH0Zb3kzMPR6DmGJM2jUqcZuGY2afYJ6SbnVptUDwl5whWcuTYjbmMIedpdE-w8pz-km56fv3_KJzerhFRyOenfyCNjii54ZQveohnAin1S3L9tcVvRvMU-4nqll-m4hSxjmCYbV59Rw6ak2tv5Z9dC9oxEvDWBoGYUcz_FwLLMSTiTQ1tDpsKZcT-to04ytLnCj3GQrW4ygvIP-QzewSEhmxlG4VysKtbpqJXS52AJY7R5e9L7y3cn-IUOQQUUBDM53FGDeMGF2J_xfScq1TUmeixQI6J6SDYcn7G4qKsMAiaELKfVvbR1tpwklzTWBU8R60MeBxi8VA6CfFlZ5UVeXDW32huGfbDw-MiTQIkEB7z4lw5oBebWMyasPXqlLvDaWCHzrZngKM7A6QW5jxpC4ayehZtCmdiEcIisF5gvYC_WiTmmXfT5n_pKey0rzJiPjiKHA0wUyS0aJBcUzhN1gRLHwg0aE0mXww3G-GUJMDuxuC9fYZNDyvuKb6stTZ10SvTXlo0xYRLuYxEL8tr9kP1vZVJvVP9-nEa86occwW6zdftlq9G_BHNoSmu9CIPW1PW2S6ee1JuBElHQ5tg2RXMsu6puGasYZ7TgFUuRrFC2x1EObFCSCBE4NPtU9qQgpKgIKcuyK7u8bdqua8m23mwbUm_LpC7EjC_O76Oemj5SGvxo0amkdfbNSa2V4yJETIf41LtJm_444KRpJVkak_eR_B_k7n5d">