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

    <tr>
        <th>Summary</th>
        <td>
            ``clang: error: cannot find libdevice for sm_50``. Provide path to different CUDA installation 
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          pulak-gautam
      </td>
    </tr>
</table>

<pre>
    I followed through the documentation and setup cuda libararies and nvvm. I couldn't get my code running. I have tried using several different versions of CUDA and Clang, and different gpu_arch too. I have tried scrounging through the internet for similar issues, but have had no working fixes so far. 

I am trying to compile a file vecadd.cu using the following command
``clang++ -std=c++11 vecadd.cu --cuda-path=/usr/local/cuda-11.4 --cuda-gpu-arch=sm_50 -L/usr/local/cuda-11.4/lib64 -lcudart_static -ldl -lrt -pthread -save-temps -v  || true``

I am getting the output 
```Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda-11.4, version 7.0
clang: error: cannot find libdevice for sm_50. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_50. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: cannot find libdevice for sm_50. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.```

Platform:
Ubuntu 20.04 

Version Info:
```$ llvm-config-14 --version
      14.0.6
``` 
```$ nvcc --version
      nvcc: NVIDIA (R) Cuda compiler driver
 Copyright (c) 2005-2021 NVIDIA Corporation
      Built on Mon_Oct_11_21:27:02_PDT_2021
      Cuda compilation tools, release 11.4, V11.4.152
      Build cuda_11.4.r11.4/compiler.30521435_0

```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVs1u4zYQfhr6MpBAkbLsHHxwZLgI0J9F292rQZGUxC5FCvxRkrcvKNmJN9sNukXdU3OIRXL4zcw3w5lh3qvOSLlD63u0PqxYDL11uzFq9jnrWAxsWDVWPO8eoLVa20cpIPTOxq6H0EsQlsdBmsCCsgaYEeBliCPwKBho1TDHnJJ-PjHTNOTwANxGLQwimwCdDDA8A7dCgovGKNMliZ5NEoJTUkD0ynTg5SQd0yBU20onTYBJOq-s8WBbqD8e9rOGWjPTIVLPi1fZbown5ngPwdo38J47G02XdFy7pUyQzsgArXXg1aA0c6C8j9In-CaGBaRnAoyFR-s-J4hWPUkP3kLLXA4IHxDeL_8fgA0Q3POsyAK3w6i0BAZt-pkkZ0LkPJ7dTSYsdKcVt8PAjDjDVRhVmC-O3iNyD5kPAtEDX5ZFcYWWZSkO2chCj-gBkWP0DpGjtpxpRI7zYVHk5UWwG2OWiEL04IfTGkP247cvpT3VVCVkOu25cPIpDThkWmjItAuQjaF3kgnIPJtkFuQwesgmALSp0aaG4KJcHPqKq06GcKHCxjDGANcEoAofbTQCODNCCRYk_FDXoIwPTOs5GxHdw4v1jTKIHPN8MRqRY8c5IsenbXWqykwrE5-yzkREjptFza3Q83WOb6phe1P0u3-AfgPCb8TyDaj9e3z-JrXkQYp_OUz1i41D1EGlS3QPOaL3qMRDVb4nRclZjJL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