# GPU

**URL:** https://discourse.julialang.org/c/domain/gpu/11.md?page=33

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 34

---

## [Strange behaviour of @cuprintf?](https://discourse.julialang.org/t/strange-behaviour-of-cuprintf/11635)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 3\
**Last updated:** [June 13, 2018, 12:34pm UTC](https://discourse.julialang.org/t/strange-behaviour-of-cuprintf/11635 "2018-06-13T12:34:24Z")

</div>

I modified the example from the CUDAnative readme as follows. Am I using @cuprintf in the wrong way? function kernel\_vadd(a, b, c) i = (blockIdx().x-1) \* blockDim().x + threadIdx().x @cuprintf("blockx= %d, block…

---

## [Problem with CUDAintrinsic pow: pow(y\[1,1\],2.0)?](https://discourse.julialang.org/t/problem-with-cudaintrinsic-pow-pow-y-1-1-2-0/11637)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 2\
**Last updated:** [June 13, 2018, 12:14pm UTC](https://discourse.julialang.org/t/problem-with-cudaintrinsic-pow-pow-y-1-1-2-0/11637 "2018-06-13T12:14:16Z")

</div>

Hi again, (sorry for all the questions!) I am a bit puzzled that this does not work. I want to use the power function on values in a Matrix. if I uncomment x=1.0, it does work. function kernel(ydepK::CuDeviceMatrix{Fl…

---

## [Best way to call an OpenCL kernel with arguments of type CLArray](https://discourse.julialang.org/t/best-way-to-call-an-opencl-kernel-with-arguments-of-type-clarray/11368)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 6\
**Last updated:** [June 4, 2018, 9:59am UTC](https://discourse.julialang.org/t/best-way-to-call-an-opencl-kernel-with-arguments-of-type-clarray/11368 "2018-06-04T09:59:45Z")

</div>

I would like to perform some computations on GPUs using CLArrays, since these support standard array syntax. However, I would like to call some existing OpenCL kernels on these CLArrays. Some possibilities that might see…

---

## [LLVM LoadError: Permission Denied (EACCES)](https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941)

<div class="topic-metadata">

**Author:** [@cuchxq](https://discourse.julialang.org/u/cuchxq)\
**Replies:** 4\
**Last updated:** [May 18, 2018, 3:04pm UTC](https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941 "2018-05-18T15:04:48Z")

</div>

Hi, everyone, I am using Julia on a cluster. But I am having error from LLVM. Here is the steps I took: $./julia \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation…

---

## [Initializing @cuStaticSharedMem array?](https://discourse.julialang.org/t/initializing-custaticsharedmem-array/10861)

<div class="topic-metadata">

**Author:** [@fghorow](https://discourse.julialang.org/u/fghorow)\
**Replies:** 3\
**Last updated:** [May 12, 2018, 8:13pm UTC](https://discourse.julialang.org/t/initializing-custaticsharedmem-array/10861 "2018-05-12T20:13:52Z")

</div>

I’m both a Julia and a CUDAnative newbie. CUDAnative is attracting me from my native numpy environment! :wink: This is probably a FAQ: I have several arrays I want to live in Shared Memory. (They are constant throughout…

---

## [Stack overflow on cuda](https://discourse.julialang.org/t/stack-overflow-on-cuda/10735)

<div class="topic-metadata">

**Author:** [@swethmandava](https://discourse.julialang.org/u/swethmandava)\
**Replies:** 9\
**Last updated:** [May 9, 2018, 8:02am UTC](https://discourse.julialang.org/t/stack-overflow-on-cuda/10735 "2018-05-09T08:02:41Z")

</div>

I’m trying to write a radix sort in julia using cuda but I get a stack overflow error. I’ve got it down to a bare minimum kernel and am not sure what’s wrong with it. function increment\_with\_block\_sums(d\_predicateScan::…

---

## [Understanding GPU Kernels](https://discourse.julialang.org/t/understanding-gpu-kernels/10252)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 4\
**Last updated:** [April 10, 2018, 3:05pm UTC](https://discourse.julialang.org/t/understanding-gpu-kernels/10252 "2018-04-10T15:05:38Z")

</div>

I’m trying understand the basics of GPU kernels for Julia. I’ve followed http://mikeinnes.github.io/2017/08/24/cudanative.html and the basic example for addition makes sense using CuArrays, CUDAnative n = 1024 xs, ys, …

---

## [Ccall: could not find function \*\* in library /usr/local/cuda-7.0/lib64/libcusolver.so.7.0.28](https://discourse.julialang.org/t/ccall-could-not-find-function-in-library-usr-local-cuda-7-0-lib64-libcusolver-so-7-0-28/10009)

<div class="topic-metadata">

**Author:** [@cuchxq](https://discourse.julialang.org/u/cuchxq)\
**Replies:** 1\
**Last updated:** [March 28, 2018, 3:49pm UTC](https://discourse.julialang.org/t/ccall-could-not-find-function-in-library-usr-local-cuda-7-0-lib64-libcusolver-so-7-0-28/10009 "2018-03-28T15:49:33Z")

</div>

Hi everyone, I am trying to use QR factorization to solve linear systems using CuArrays package. I am following this CUDA documentation (written in C) and I am trying to do it in Julia. I am using julia 0.6.0. Here is v…

---

## [CUDAnative use multiple GPUs](https://discourse.julialang.org/t/cudanative-use-multiple-gpus/8274)

<div class="topic-metadata">

**Author:** [@fnoelscher](https://discourse.julialang.org/u/fnoelscher)\
**Replies:** 5\
**Last updated:** [March 24, 2018, 1:15pm UTC](https://discourse.julialang.org/t/cudanative-use-multiple-gpus/8274 "2018-03-24T13:15:32Z")

</div>

Hi, I am using julia on docker from maleadt/juliagpu and I’d like to use multiple GPUs, instead of one. The docs mention this: dev = CuDevice(0) CuContext(dev) do ctx # allocate things in this context @cuda ..…

---

## [CUDAnative ERROR: could not load library "libjulia.exe"](https://discourse.julialang.org/t/cudanative-error-could-not-load-library-libjulia-exe/9781)

<div class="topic-metadata">

**Author:** [@Luxemecongineer](https://discourse.julialang.org/u/Luxemecongineer)\
**Replies:** 3\
**Last updated:** [March 18, 2018, 6:35pm UTC](https://discourse.julialang.org/t/cudanative-error-could-not-load-library-libjulia-exe/9781 "2018-03-18T18:35:03Z")

</div>

I have passed tests of LLVM and CUDAdrv (non-documentation tests). But Pkg.test(“CUDAnative”) fails for ERROR: LoadError: could not load library "libjulia.exe" The specified module could not be found. Please, let me kn…

---

## [ANN: Docker image for CUDA packages](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792)

<div class="topic-metadata">

**Author:** [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Replies:** 10\
**Last updated:** [March 18, 2018, 9:27am UTC](https://discourse.julialang.org/t/ann-docker-image-for-cuda-packages/5792 "2018-03-18T09:27:38Z")

</div>

Hi all, Many JuliaGPU packages are pretty hard to install, so I’ve been working a little on a Docker image which comes with some CUDA packages preinstalled: maleadt/juliagpu, requiring nvidia-docker: $ docker pull male…

---

## [Why is source build Julia required to use GPU packages](https://discourse.julialang.org/t/why-is-source-build-julia-required-to-use-gpu-packages/9747)

<div class="topic-metadata">

**Author:** [@cuchxq](https://discourse.julialang.org/u/cuchxq)\
**Replies:** 1\
**Last updated:** [March 15, 2018, 9:23pm UTC](https://discourse.julialang.org/t/why-is-source-build-julia-required-to-use-gpu-packages/9747 "2018-03-15T21:23:17Z")

</div>

I am trying to use Julia GPU packages, and README files from juliaGPU GitHub repo all states that in order to use these packages, I need to build Julia from source. But why is that? Any help is appreciated! Thank you in …

---

## [@cuDynamicSharedMem : allocating beforehand?](https://discourse.julialang.org/t/cudynamicsharedmem-allocating-beforehand/8101)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 2\
**Last updated:** [January 2, 2018, 8:41am UTC](https://discourse.julialang.org/t/cudynamicsharedmem-allocating-beforehand/8101 "2018-01-02T08:41:11Z")

</div>

I am getting: ERROR: LoadError: CUDA error: an illegal memory access was encountered (code #700, ERROR\_ILLEGAL\_ADDRESS) on the following using CUDAdrv, CUDAnative function kernel(x) i = threadIdx().x shared = @…

---

## [Generating Random Number from inside Kernel](https://discourse.julialang.org/t/generating-random-number-from-inside-kernel/8071)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 12\
**Last updated:** [January 2, 2018, 5:13am UTC](https://discourse.julialang.org/t/generating-random-number-from-inside-kernel/8071 "2018-01-02T05:13:57Z")

</div>

Is it possible to generate a random number from within a kernel? My reading of CURAND.jl looks like curand() must be called from host. I am implementing Genetic Algorithm. It is becoming impractical to have to pre-gene…

---

## [Set Cache Configuration using CUDAdrv or CUDAnative](https://discourse.julialang.org/t/set-cache-configuration-using-cudadrv-or-cudanative/7675)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 1\
**Last updated:** [December 10, 2017, 5:38pm UTC](https://discourse.julialang.org/t/set-cache-configuration-using-cudadrv-or-cudanative/7675 "2017-12-10T17:38:20Z")

</div>

Similar to cudaFuncSetCacheConfig(fooKernel, cudaFuncCachePreferL1) I cannot find any example on how to do this. Is it possible?

---

## [Using Math Functions Inside CUDA Kernel](https://discourse.julialang.org/t/using-math-functions-inside-cuda-kernel/7411)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 1\
**Last updated:** [November 30, 2017, 2:15pm UTC](https://discourse.julialang.org/t/using-math-functions-inside-cuda-kernel/7411 "2017-11-30T14:15:31Z")

</div>

using CUDAdrv, CUDAnative function kernel\_a(a) i = (blockIdx().x-1) \* blockDim().x + threadIdx().x a\[i\] = tanh(a\[i\]) return nothing end dev = CuDevice(0) ctx = CuContext(dev) len = 100 a = rand(Float32, len…

---

## [Deployment questions: AOT and Portability](https://discourse.julialang.org/t/deployment-questions-aot-and-portability/7262)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 5\
**Last updated:** [November 23, 2017, 12:49pm UTC](https://discourse.julialang.org/t/deployment-questions-aot-and-portability/7262 "2017-11-23T12:49:41Z")

</div>

AOT: Is it possible to enable AOT compilation? It takes around 10 seconds to compile the kernel. Compilation happens every time even when I rarely change the kernel. Portability: When I run the code on a machine without…

---

## [Understanding Blocks and Threads](https://discourse.julialang.org/t/understanding-blocks-and-threads/7249)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 2\
**Last updated:** [November 23, 2017, 6:03am UTC](https://discourse.julialang.org/t/understanding-blocks-and-threads/7249 "2017-11-23T06:03:54Z")

</div>

I got CUDAnative to work on a MacBook Pro 2016 on High Sierra with GeForce 1080 Ti running as an eGPU connected via USB-C. Everything works great so far, but I need help understanding on how Blocks and Threads work in g…

---

## [Limitation in CuArrays](https://discourse.julialang.org/t/limitation-in-cuarrays/7011)

<div class="topic-metadata">

**Author:** [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Replies:** 1\
**Last updated:** [November 11, 2017, 8:06pm UTC](https://discourse.julialang.org/t/limitation-in-cuarrays/7011 "2017-11-11T20:06:34Z")

</div>

What is the reason for this limitation in CuArrays? When broadcasting, watch out for errors like: julia\> sin.(cos.(xs)) ERROR: CUDA error: invalid program counter (code #718, ERROR\_INVALID\_PC) A current limitation of …

---

## [Construct discrete Bloch sum using GPU](https://discourse.julialang.org/t/construct-discrete-bloch-sum-using-gpu/6993)

<div class="topic-metadata">

**Author:** [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Replies:** 3\
**Last updated:** [November 10, 2017, 6:09pm UTC](https://discourse.julialang.org/t/construct-discrete-bloch-sum-using-gpu/6993 "2017-11-10T18:09:45Z")

</div>

I’m taking my first plunge into the world of GPU computing. What I’m trying to do is to construct a bloch sum of a wavefunction which is defined over 3 unit cells. The idea is that for each point in space, I take the ori…

---

## [Reverting to earlier CUDA - version report stubborn](https://discourse.julialang.org/t/reverting-to-earlier-cuda-version-report-stubborn/6247)

<div class="topic-metadata">

**Author:** [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Replies:** 3\
**Last updated:** [October 5, 2017, 9:57am UTC](https://discourse.julialang.org/t/reverting-to-earlier-cuda-version-report-stubborn/6247 "2017-10-05T09:57:53Z")

</div>

I’m trying to revert versions of CUDA from 9 to 7. The removal of 9 and install of 7 seems to have gone ok but CUDAdrv.version() is still reporting v"9.0.0". I have Pkg.rm() twice each for CUDAdrv and CUDAnative and cle…

---

## [Binary CUDA dependency](https://discourse.julialang.org/t/binary-cuda-dependency/6226)

<div class="topic-metadata">

**Author:** [@una-dinosauria](https://discourse.julialang.org/u/una-dinosauria)\
**Replies:** 8\
**Last updated:** [October 4, 2017, 7:06am UTC](https://discourse.julialang.org/t/binary-cuda-dependency/6226 "2017-10-04T07:06:02Z")

</div>

I’m in the process of building a Julia package which uses some custom CUDA kernels that I wrote a few years ago. I want to provide these CUDA binaries with the package, and have them compiled using BinDeps.jl. I’m follo…

---

## [How to get started with GPU programming? OpenCL or CUDA?](https://discourse.julialang.org/t/how-to-get-started-with-gpu-programming-opencl-or-cuda/5441)

<div class="topic-metadata">

**Author:** [@ttiveron](https://discourse.julialang.org/u/ttiveron)\
**Replies:** 7\
**Last updated:** [August 29, 2017, 10:29am UTC](https://discourse.julialang.org/t/how-to-get-started-with-gpu-programming-opencl-or-cuda/5441 "2017-08-29T10:29:29Z")

</div>

Hello, Thank you for taking the time to read my post, I really appreciate it! I am currently a Windows using, C# developer, but have been learning Julia for some data research and personal projects. I want to learn how …

---

## [Implementing a basic Genetic Algorithm using GPUArrays](https://discourse.julialang.org/t/implementing-a-basic-genetic-algorithm-using-gpuarrays/5290)

<div class="topic-metadata">

**Author:** [@Mikewl](https://discourse.julialang.org/u/Mikewl)\
**Replies:** 18\
**Last updated:** [August 10, 2017, 8:17am UTC](https://discourse.julialang.org/t/implementing-a-basic-genetic-algorithm-using-gpuarrays/5290 "2017-08-10T08:17:55Z")

</div>

So I like playing with Genetic Algorithms and other Evolutionary Algorithms and have gotten nice speedups via using threads before. So I saw GPUArrays and felt it was a good enough reason to setup a linux box again! My…

---

## [Sparse arrays and function arrays in CUDAnative.jl](https://discourse.julialang.org/t/sparse-arrays-and-function-arrays-in-cudanative-jl/4754)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 12\
**Last updated:** [July 10, 2017, 12:32pm UTC](https://discourse.julialang.org/t/sparse-arrays-and-function-arrays-in-cudanative-jl/4754 "2017-07-10T12:32:08Z")

</div>

Is there any simple way to make, write to and read from sparse arrays on the device through CUDAnative.jl? Also, is it possible to define an array of device functions that is moved to the device and then each function c…

---

## [\[Mocha\] Where does libcudnn go on linux boxes?](https://discourse.julialang.org/t/mocha-where-does-libcudnn-go-on-linux-boxes/4181)

<div class="topic-metadata">

**Author:** [@Nectarineimp](https://discourse.julialang.org/u/Nectarineimp)\
**Replies:** 2\
**Last updated:** [June 13, 2017, 3:04pm UTC](https://discourse.julialang.org/t/mocha-where-does-libcudnn-go-on-linux-boxes/4181 "2017-06-13T15:04:57Z")

</div>

I am trying to use the Mocha package, and I’ve downloaded the Deep Neural Network cuda library from nVidia. I put a copy of it in /libs and another in ~/.julia/v0.5/Mocha/Deps. No luck running Pkg.test(“Mocha”). If I tur…

---

## [Status of Dynamic Parallelism Support in CUDANative.jl](https://discourse.julialang.org/t/status-of-dynamic-parallelism-support-in-cudanative-jl/4019)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 4\
**Last updated:** [May 31, 2017, 8:28pm UTC](https://discourse.julialang.org/t/status-of-dynamic-parallelism-support-in-cudanative-jl/4019 "2017-05-31T20:28:40Z")

</div>

I found the following issue about dynamic parallelism, and I was wondering if there is any date by which CUDANative is expected to support dynamic parallelism in the future, or if there is any update on that. https://gi…

---

## [Thinking through distance matrix calculation](https://discourse.julialang.org/t/thinking-through-distance-matrix-calculation/3725)

<div class="topic-metadata">

**Author:** [@randyzwitch](https://discourse.julialang.org/u/randyzwitch)\
**Replies:** 5\
**Last updated:** [May 16, 2017, 1:35pm UTC](https://discourse.julialang.org/t/thinking-through-distance-matrix-calculation/3725 "2017-05-16T13:35:27Z")

</div>

I got a workstation with 2 P5000 cards in it and I want to check out CUDAnative.jl (or other options people can suggest). I understand why GPUs can produce faster results for brute force calculations, but this is my firs…

---

## [Call CUDA C code via ccall](https://discourse.julialang.org/t/call-cuda-c-code-via-ccall/3539)

<div class="topic-metadata">

**Author:** [@WneleiGao](https://discourse.julialang.org/u/WneleiGao)\
**Replies:** 3\
**Last updated:** [May 6, 2017, 6:44am UTC](https://discourse.julialang.org/t/call-cuda-c-code-via-ccall/3539 "2017-05-06T06:44:25Z")

</div>

Hi everyone, I have a very simple code to perform parallel vector summation on GPU. The code is written with CUDA C, then compiled to be a shared library. When I try to call the library function via ccall in Julia, it ca…

---

## [CUDAnative on macOS X](https://discourse.julialang.org/t/cudanative-on-macos-x/2671)

<div class="topic-metadata">

**Author:** [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Replies:** 13\
**Last updated:** [March 17, 2017, 6:05pm UTC](https://discourse.julialang.org/t/cudanative-on-macos-x/2671 "2017-03-17T18:05:54Z")

</div>

Did anyone manage to get CUDAnative running on macOS X? I could successfully install CUDAdrv … push!(Libdl.DL\_LOAD\_PATH, "/usr/local/cuda/lib") Pkg.add("CUDAdrv") … but trying to add CUDAnative fails with LLVM errors:…

[Previous page](https://discourse.julialang.org/c/domain/gpu/11.md?page=32)

[Next page](https://discourse.julialang.org/c/domain/gpu/11.md?page=34)
