# GPU

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

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

**Page:** 29

---

## [ArrayFire and FFTW dependency Issue](https://discourse.julialang.org/t/arrayfire-and-fftw-dependency-issue/33735)

<div class="topic-metadata">

**Author:** [@cshen](https://discourse.julialang.org/u/cshen)\
**Replies:** 0\
**Last updated:** [January 24, 2020, 11:22am UTC](https://discourse.julialang.org/t/arrayfire-and-fftw-dependency-issue/33735 "2020-01-24T11:22:00Z")

</div>

Hello, I’ve been trying to install ArrayFire but there seems to be some issue regarding dependencies regarding FFTW (and Zygote). Here with the most recent FFTW@1.2.0: ERROR: Unsatisfiable requirements detected for p…

---

## [Passing array of pointers to CUDA kernel](https://discourse.julialang.org/t/passing-array-of-pointers-to-cuda-kernel/33570)

<div class="topic-metadata">

**Author:** [@Michael\_Benton](https://discourse.julialang.org/u/Michael_Benton)\
**Replies:** 2\
**Last updated:** [January 20, 2020, 5:00pm UTC](https://discourse.julialang.org/t/passing-array-of-pointers-to-cuda-kernel/33570 "2020-01-20T17:00:09Z")

</div>

I need to be able to stack arbitrarily sized cuarrays and CuTextures as a single input to a kernel, so I can do operations in the kernel that loop over the data like so: (get GitHub - cdsousa/CuTextures.jl: \[DEPRECATED,…

---

## [KernelError: recursion is currently not supported](https://discourse.julialang.org/t/kernelerror-recursion-is-currently-not-supported/33233)

<div class="topic-metadata">

**Author:** [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Replies:** 4\
**Last updated:** [January 13, 2020, 10:40am UTC](https://discourse.julialang.org/t/kernelerror-recursion-is-currently-not-supported/33233 "2020-01-13T10:40:07Z")

</div>

Background: I changed my task to a simple example for description: I will take every element in array x, make it into a third-order matrix and calculate its determinant, and then assign the value of the determinant to…

---

## [Gradient of \`sum(f, x)\` using Zygote, when \`f\` is real valued and \`x isa CuArray{\<:Complex}\`](https://discourse.julialang.org/t/gradient-of-sum-f-x-using-zygote-when-f-is-real-valued-and-x-isa-cuarray-complex/33081)

<div class="topic-metadata">

**Author:** [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Replies:** 1\
**Last updated:** [January 8, 2020, 6:58am UTC](https://discourse.julialang.org/t/gradient-of-sum-f-x-using-zygote-when-f-is-real-valued-and-x-isa-cuarray-complex/33081 "2020-01-08T06:58:01Z")

</div>

While I’m able to differentiate sum(abs2, a) (using Zygote) when a isa CuArray{\<:Complex}, this fails for sum(f, a) with f = abs2 \[see below for details\]. I haven’t been able to figure out exactly why – and how to fix th…

---

## [Faster read only memory](https://discourse.julialang.org/t/faster-read-only-memory/32457)

<div class="topic-metadata">

**Author:** [@Michael\_Benton](https://discourse.julialang.org/u/Michael_Benton)\
**Replies:** 5\
**Last updated:** [January 8, 2020, 6:50am UTC](https://discourse.julialang.org/t/faster-read-only-memory/32457 "2020-01-08T06:50:57Z")

</div>

I’ve got something that works, but it needs to work faster. I’ve tested different methods outside of Julia that can do this much faster, and by comparison with peakflops.jl and a rudimentary calculation of how many opera…

---

## [Use GPU to generate known sparse matrix](https://discourse.julialang.org/t/use-gpu-to-generate-known-sparse-matrix/33023)

<div class="topic-metadata">

**Author:** [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Replies:** 2\
**Last updated:** [January 6, 2020, 12:51pm UTC](https://discourse.julialang.org/t/use-gpu-to-generate-known-sparse-matrix/33023 "2020-01-06T12:51:19Z")

</div>

Suppose we have a known matrix A: \\begin{equation} A=\\left\[\\begin{array}{lll} {1} & {0} & {0} \\\\ {0} & {2} & {4} \\\\ {0} & {0} & {3} \\end{array}\\right\] \\end{equation} At this point, I want to express A as a sparse matr…

---

## [CUDA\_ERROR\_ILLEGAL\_ADDRESS with CuArrays/Zygote getindex](https://discourse.julialang.org/t/cuda-error-illegal-address-with-cuarrays-zygote-getindex/32744)

<div class="topic-metadata">

**Author:** [@tanhevg](https://discourse.julialang.org/u/tanhevg)\
**Replies:** 4\
**Last updated:** [January 3, 2020, 12:07pm UTC](https://discourse.julialang.org/t/cuda-error-illegal-address-with-cuarrays-zygote-getindex/32744 "2020-01-03T12:07:56Z")

</div>

Hello, I am getting an error CuError(CUDA\_ERROR\_ILLEGAL\_ADDRESS) with the following stacktrace. My code is trying to take gradients of a deep learning model with Zygote. I wonder if this is a symptom of running out of me…

---

## [DiffEqFlux neural\_ode used with Flux.Train! is slower on GPU than CPU](https://discourse.julialang.org/t/diffeqflux-neural-ode-used-with-flux-train-is-slower-on-gpu-than-cpu/32830)

<div class="topic-metadata">

**Author:** [@charlie\_strauss](https://discourse.julialang.org/u/charlie_strauss)\
**Replies:** 0\
**Last updated:** [December 31, 2019, 7:47pm UTC](https://discourse.julialang.org/t/diffeqflux-neural-ode-used-with-flux-train-is-slower-on-gpu-than-cpu/32830 "2019-12-31T19:47:45Z")

</div>

\*\*\*It appears Flux training of the DiffEqFlux Package method neural\_ode is incompatible with (fast) GPU operations, But I’m hoping that perhaps I’m doing something wrong and you can point me to example code where gpu op…

---

## [Performance issue with broadcasting of custom array wrapper wrapping a CuArray](https://discourse.julialang.org/t/performance-issue-with-broadcasting-of-custom-array-wrapper-wrapping-a-cuarray/32818)

<div class="topic-metadata">

**Author:** [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Replies:** 5\
**Last updated:** [December 31, 2019, 6:41pm UTC](https://discourse.julialang.org/t/performance-issue-with-broadcasting-of-custom-array-wrapper-wrapping-a-cuarray/32818 "2019-12-31T18:41:39Z")

</div>

Background I’m trying to make my own array (wrapper) type that can be used both on CPUs and GPUs. Here’s a minimal example: struct MyWrapper{T,N,A\<:AbstractArray{T,N}} \<: AbstractArray{T,N} data::A end # Basic Abst…

---

## [Solves the linear system using CuArrays.jl](https://discourse.julialang.org/t/solves-the-linear-system-using-cuarrays-jl/32692)

<div class="topic-metadata">

**Author:** [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Replies:** 3\
**Last updated:** [December 27, 2019, 1:18pm UTC](https://discourse.julialang.org/t/solves-the-linear-system-using-cuarrays-jl/32692 "2019-12-27T13:18:58Z")

</div>

I am new to GPU parallel computing. With my knowledge of CUSOLVER and CUSPARSE, I am sure that I can complete my task through them: Solving large linear sparse equations in parallel. I have read the documentation of CUD…

---

## [Failed to load \`CUDAdrv\`](https://discourse.julialang.org/t/failed-to-load-cudadrv/32524)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 3\
**Last updated:** [December 26, 2019, 1:02am UTC](https://discourse.julialang.org/t/failed-to-load-cudadrv/32524 "2019-12-26T01:02:22Z")

</div>

I am, for the first time, trying to learn how GPU programming works. I have two Tesla K80s on a HPC. To begin I request the proper node through slurm, and launch an interactive job. \[affans@hpc ~\]$ srun -p gpuq --gres=g…

---

## [Composite types array, and composite type with array fields](https://discourse.julialang.org/t/composite-types-array-and-composite-type-with-array-fields/32466)

<div class="topic-metadata">

**Author:** [@garychow](https://discourse.julialang.org/u/garychow)\
**Replies:** 5\
**Last updated:** [December 20, 2019, 3:43am UTC](https://discourse.julialang.org/t/composite-types-array-and-composite-type-with-array-fields/32466 "2019-12-20T03:43:18Z")

</div>

Hi, I am using CUDAnative now and wonder if anyone could point me to a correct direction such that these operations is possible. Is there anyone else found that it will be easier if these 2 functions are supported? I un…

---

## [Some help with ArrayFire + DifferentialEquations](https://discourse.julialang.org/t/some-help-with-arrayfire-differentialequations/32342)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 20\
**Last updated:** [December 18, 2019, 1:50pm UTC](https://discourse.julialang.org/t/some-help-with-arrayfire-differentialequations/32342 "2019-12-18T13:50:47Z")

</div>

Hellos, I noticed that with one line definition for ArrayFire.jl I can make it run together with DifferentialEquations.jl, but it is not working as expected. DifferentialEquations is calling a generic multiplication fu…

---

## [Is there a way to explicitly free GPU memory?](https://discourse.julialang.org/t/is-there-a-way-to-explicitly-free-gpu-memory/32266)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 3\
**Last updated:** [December 15, 2019, 5:59pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-explicitly-free-gpu-memory/32266 "2019-12-15T17:59:04Z")

</div>

Hi folks, I’m doing some CUDA coding using CuArrays, CUDAnative and CUDAdrv, in my jupyter notebooks. Since I’m developping, I write and test functions constantly. But then it happens that every now and then I have to r…

---

## [CPU/GPU data transfer speed](https://discourse.julialang.org/t/cpu-gpu-data-transfer-speed/31857)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 12\
**Last updated:** [December 6, 2019, 3:22am UTC](https://discourse.julialang.org/t/cpu-gpu-data-transfer-speed/31857 "2019-12-06T03:22:08Z")

</div>

I’m having trouble pushing data from CPU to GPU memory at a decent rate. With 512 MB of Float32 data julia\> using CuArrays julia\> data = rand(Float32, 134217728); everything is nice and fast once the data is on the G…

---

## [GPUparallelisation on Intel card?](https://discourse.julialang.org/t/gpuparallelisation-on-intel-card/31843)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [December 5, 2019, 12:41pm UTC](https://discourse.julialang.org/t/gpuparallelisation-on-intel-card/31843 "2019-12-05T12:41:06Z")

</div>

Hello, is GPU parallelisation reserved to CUDarray/NVIDIA cards, or is there an API for generic (i.e. Intel integrated) cards ? And if yes, is it worth it? Where could I get more doc/info about it ?

---

## [Stress test DGX-1](https://discourse.julialang.org/t/stress-test-dgx-1/31810)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 0\
**Last updated:** [December 3, 2019, 4:02pm UTC](https://discourse.julialang.org/t/stress-test-dgx-1/31810 "2019-12-03T16:02:33Z")

</div>

I have an excuse to run some stress tests on an Nvidia DGX-1 over the next few days. Is there anything interesting I could run on an 8 GPU setup like that?

---

## [Maintaining OpenCL packages](https://discourse.julialang.org/t/maintaining-opencl-packages/16279)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 6\
**Last updated:** [November 29, 2019, 10:20pm UTC](https://discourse.julialang.org/t/maintaining-opencl-packages/16279 "2019-11-29T22:20:22Z")

</div>

I tried asking on slack, but since I didn’t get many replies, I am asking here. Could someone from the JuliaGPU organization please take care of the PRs in OpenCL? There are many attempts to port the package to Julia v1…

---

## [Rewriting function on CPU for execution on GPU](https://discourse.julialang.org/t/rewriting-function-on-cpu-for-execution-on-gpu/31608)

<div class="topic-metadata">

**Author:** [@ennvvy](https://discourse.julialang.org/u/ennvvy)\
**Replies:** 4\
**Last updated:** [November 29, 2019, 5:48am UTC](https://discourse.julialang.org/t/rewriting-function-on-cpu-for-execution-on-gpu/31608 "2019-11-29T05:48:00Z")

</div>

I am trying to execute a function that I am currently running on a CPU on the GPU. There are a few bottlenecks, like accessing elements of an array scalar getindex is disallowed The code is below: using CUDAdrv,CUDAnat…

---

## [Writing simple kernel functions (EM algorithm)](https://discourse.julialang.org/t/writing-simple-kernel-functions-em-algorithm/24787)

<div class="topic-metadata">

**Author:** [@myroslav](https://discourse.julialang.org/u/myroslav)\
**Replies:** 7\
**Last updated:** [November 28, 2019, 2:39pm UTC](https://discourse.julialang.org/t/writing-simple-kernel-functions-em-algorithm/24787 "2019-11-28T14:39:12Z")

</div>

Hi everyone, I am trying to get my head around writing GPU kernels in Julia, would be great if someone could help me with my example. Without going into too many details, I am trying to run a simple EM (Expectation-Maxi…

---

## [Performance of kernel function](https://discourse.julialang.org/t/performance-of-kernel-function/31605)

<div class="topic-metadata">

**Author:** [@ennvvy](https://discourse.julialang.org/u/ennvvy)\
**Replies:** 3\
**Last updated:** [November 28, 2019, 5:35am UTC](https://discourse.julialang.org/t/performance-of-kernel-function/31605 "2019-11-28T05:35:11Z")

</div>

I tried executing the following function on the GPU, for array sizes of 10,000. function update!(s,c,cedg,θ) index = (blockIdx().x - 1) \* blockDim().x + threadIdx().x stride = blockDim().x \* gridDim().x @inbounds …

---

## [What do I get when I subtype GPUArray?](https://discourse.julialang.org/t/what-do-i-get-when-i-subtype-gpuarray/31537)

<div class="topic-metadata">

**Author:** [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)\
**Replies:** 7\
**Last updated:** [November 27, 2019, 11:04am UTC](https://discourse.julialang.org/t/what-do-i-get-when-i-subtype-gpuarray/31537 "2019-11-27T11:04:44Z")

</div>

As the main developer of ROCArrays.jl, I’m trying to understand what benefits I get when I make ROCArray \<: GPUArray. GPUArrays.jl is a rather large package (likely due to it also implementing JLArray), so it’s hard for …

---

## [Trignometric functions on GPU](https://discourse.julialang.org/t/trignometric-functions-on-gpu/31338)

<div class="topic-metadata">

**Author:** [@ennvvy](https://discourse.julialang.org/u/ennvvy)\
**Replies:** 4\
**Last updated:** [November 21, 2019, 8:55am UTC](https://discourse.julialang.org/t/trignometric-functions-on-gpu/31338 "2019-11-21T08:55:17Z")

</div>

I tried executing a simple function involving sin and cos as below: using CUDAdrv,CUDAnative,CuArrays sine(x::Float32) = sin(x) cosine(x::Float32) = cos(x) CuArrays.@cufunc sine(x::Real) = sin(x) CuArrays.@cufunc cosin…

---

## [CuArrays: Call reclaim from user code](https://discourse.julialang.org/t/cuarrays-call-reclaim-from-user-code/31224)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 4\
**Last updated:** [November 20, 2019, 7:14pm UTC](https://discourse.julialang.org/t/cuarrays-call-reclaim-from-user-code/31224 "2019-11-20T19:14:47Z")

</div>

Hi, I’m getting hit pretty hard with what I think is this issue: https://github.com/JuliaGPU/CuArrays.jl/issues/323 When using CuArrays 1.2.1 I could keep things afloat fairly well by calling CuArrays.reclaim(true) at …

---

## [The performance difference of transferring (SubArray, ReshapedArray) Array to GPU](https://discourse.julialang.org/t/the-performance-difference-of-transferring-subarray-reshapedarray-array-to-gpu/31303)

<div class="topic-metadata">

**Author:** [@findmyway](https://discourse.julialang.org/u/findmyway)\
**Replies:** 2\
**Last updated:** [November 20, 2019, 8:50am UTC](https://discourse.julialang.org/t/the-performance-difference-of-transferring-subarray-reshapedarray-array-to-gpu/31303 "2019-11-20T08:50:29Z")

</div>

I encounter some performance differences when trying to move data from cpu to gpu. The result is listed in the table bellow: methods cpu(x) gpu(x) CuArray{Float32}(x) a = rand(Float32, 100, 100, 32); 62.947 ns (…

---

## [How to set the seed properly in CURAND](https://discourse.julialang.org/t/how-to-set-the-seed-properly-in-curand/24180)

<div class="topic-metadata">

**Author:** [@findmyway](https://discourse.julialang.org/u/findmyway)\
**Replies:** 4\
**Last updated:** [November 15, 2019, 4:04pm UTC](https://discourse.julialang.org/t/how-to-set-the-seed-properly-in-curand/24180 "2019-11-15T16:04:49Z")

</div>

I just found it’s a little tricky for me to set the seed in CuArrays.CURAND julia\> using CuArrays, CuArrays.CURAND julia\> s = CuArrays.CURAND.create\_generator() CuArrays.CURAND.RNG(Ptr{Nothing} @0x00000000054faec0, 100…

---

## [Random numbers in \[0.f0,1.f0\]](https://discourse.julialang.org/t/random-numbers-in-0-f0-1-f0/30926)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 2\
**Last updated:** [November 10, 2019, 9:04pm UTC](https://discourse.julialang.org/t/random-numbers-in-0-f0-1-f0/30926 "2019-11-10T21:04:11Z")

</div>

Hi again, is there a simple way to have the same as this rand(\[0.f0,1.f0\],10) on the GPU? I need to generate random bits (in that case they’re Float32 but anyway), and trying the obvious thing refuses to work CuArray…

---

## [Kernel Compilation error- KernelError: recursion is currently not supported](https://discourse.julialang.org/t/kernel-compilation-error-kernelerror-recursion-is-currently-not-supported/30853)

<div class="topic-metadata">

**Author:** [@Batel\_Str](https://discourse.julialang.org/u/Batel_Str)\
**Replies:** 8\
**Last updated:** [November 8, 2019, 10:36am UTC](https://discourse.julialang.org/t/kernel-compilation-error-kernelerror-recursion-is-currently-not-supported/30853 "2019-11-08T10:36:37Z")

</div>

Hi i wrote this kernel function: function gpu\_kernel\_init\_format(format\_img) gpu\_lab\_image =CuArrays.fill(128, (10,10,3)) i = (blockIdx().x - 1) \* blockDim().x + threadIdx().x j = (blockIdx().y - 1) \* blockDim().y + …

---

## [Code using Flux slow on GPU](https://discourse.julialang.org/t/code-using-flux-slow-on-gpu/30696)

<div class="topic-metadata">

**Author:** [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Replies:** 9\
**Last updated:** [November 6, 2019, 4:09pm UTC](https://discourse.julialang.org/t/code-using-flux-slow-on-gpu/30696 "2019-11-06T16:09:16Z")

</div>

I am trying to make Julia code running on GPU for quantile function regression where the probability distribution is specified by a linear combination of Bernstein polynomials and its parameters are linked to the covaria…

---

## [Copyto! does not work for subarray when scalar get index is disallowed?](https://discourse.julialang.org/t/copyto-does-not-work-for-subarray-when-scalar-get-index-is-disallowed/30044)

<div class="topic-metadata">

**Author:** [@ww1g11](https://discourse.julialang.org/u/ww1g11)\
**Replies:** 1\
**Last updated:** [October 18, 2019, 9:34am UTC](https://discourse.julialang.org/t/copyto-does-not-work-for-subarray-when-scalar-get-index-is-disallowed/30044 "2019-10-18T09:34:07Z")

</div>

I have a large Array in CPU and want to copy back the GPU data to it. Here is a demo: using CuArrays CuArrays.allowscalar(false) N = 100 u\_c = rand(N, 2); u\_d = CuArrays.CuArray(ones(N)); u\_v = view(u\_c, :, 1); copyto!(…

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

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