# CUDA.sqrt will not found symbol "\_\_nv\_sqrt"

**URL:** <https://discourse.julialang.org/t/cuda-sqrt-will-not-found-symbol-nv-sqrt/50533>\
**Category:** GPU\
**Tags:** question, bug\
**Created:** [November 21, 2020, 1:14pm UTC](https://discourse.julialang.org/t/cuda-sqrt-will-not-found-symbol-nv-sqrt/50533 "2020-11-21T13:14:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaoxuanGuo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haoxuanguo/32/19052_2.png) [@HaoxuanGuo](https://discourse.julialang.org/u/HaoxuanGuo)\
**Post date:** [November 21, 2020, 1:14pm UTC](https://discourse.julialang.org/t/cuda-sqrt-will-not-found-symbol-nv-sqrt/50533/1 "2020-11-21T13:14:42Z")

</div>

I think this may be a bug and reported it.

[https://github.com/JuliaGPU/CUDA.jl/issues/559#issue-748013387](https://github.com/JuliaGPU/CUDA.jl/issues/559#issue-748013387)

Now I wonder if this a artifact error because other math function like `abs` are not work too. But, what caused it?

---

<div class="post-metadata">

**Author:** ![HaoxuanGuo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haoxuanguo/32/19052_2.png) [@HaoxuanGuo](https://discourse.julialang.org/u/HaoxuanGuo)\
**Post date:** [November 21, 2020, 4:15pm UTC](https://discourse.julialang.org/t/cuda-sqrt-will-not-found-symbol-nv-sqrt/50533/2 "2020-11-21T16:15:55Z")

</div>

`CUDA.sqrt` is GPU only. The following code is OK.

```julia
using CUDA

function sqrt_kernel!(res, val)
    res[begin] = CUDA.sqrt(val)
    return
end

res = cu([0.0])
@cuda sqrt_kernel!(res, 12.34)
println(res[begin])

```

Answered by

[https://github.com/JuliaGPU/CUDA.jl/issues/559#issuecomment-731595826](https://github.com/JuliaGPU/CUDA.jl/issues/559#issuecomment-731595826)
