# GPU

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

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

**Page:** 17

---

## [Strange issues with stride loops as in CUDA.Random](https://discourse.julialang.org/t/strange-issues-with-stride-loops-as-in-cuda-random/85163)

<div class="topic-metadata">

**Author:** [@physicsjoke](https://discourse.julialang.org/u/physicsjoke)\
**Replies:** 1\
**Last updated:** [August 3, 2022, 12:51pm UTC](https://discourse.julialang.org/t/strange-issues-with-stride-loops-as-in-cuda-random/85163 "2022-08-03T12:51:10Z")

</div>

Hello everyone, I’ve been spending quite some time debugging my method to sample gamma-distributed random numbers on my GPU. The algo is quite simple, as my shape parameter (k) is drawn from a Poisson distribution and …

---

## [Broadcasting an expression-evaluator function](https://discourse.julialang.org/t/broadcasting-an-expression-evaluator-function/85127)

<div class="topic-metadata">

**Author:** [@RXGottlieb](https://discourse.julialang.org/u/RXGottlieb)\
**Replies:** 2\
**Last updated:** [August 2, 2022, 2:21pm UTC](https://discourse.julialang.org/t/broadcasting-an-expression-evaluator-function/85127 "2022-08-02T14:21:46Z")

</div>

Hello, I have a symbolic expression that I’d like to evaluate a large number of times on a GPU. A few days ago I made a post about creating an evaluator function (see: the previous post), which led me to Symbolics.build…

---

## [Custom random sampling kernels](https://discourse.julialang.org/t/custom-random-sampling-kernels/57092)

<div class="topic-metadata">

**Author:** [@simsurace](https://discourse.julialang.org/u/simsurace)\
**Replies:** 16\
**Last updated:** [July 26, 2022, 6:51pm UTC](https://discourse.julialang.org/t/custom-random-sampling-kernels/57092 "2022-07-26T18:51:40Z")

</div>

I’m trying to write custom kernels for random sampling from various distributions. Most needed is a Binomial sampler that runs on the GPU. That functionality seems to be under-developed currently. As a first step I trie…

---

## [How to generate a reusable static LLVM IR module?](https://discourse.julialang.org/t/how-to-generate-a-reusable-static-llvm-ir-module/83226)

<div class="topic-metadata">

**Author:** [@knlv.ok](https://discourse.julialang.org/u/knlv.ok)\
**Replies:** 4\
**Last updated:** [July 25, 2022, 11:44am UTC](https://discourse.julialang.org/t/how-to-generate-a-reusable-static-llvm-ir-module/83226 "2022-07-25T11:44:21Z")

</div>

Hello, I am a beginner in Julia programming. I need a way to generate a static LLVM IR module for functions written in Julia and modify the LLVM IR that was generated. I saw on CUDAnative.jl , there are some features …

---

## [LinearAlgebra./ breaks CuArray](https://discourse.julialang.org/t/linearalgebra-breaks-cuarray/84570)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 4\
**Last updated:** [July 23, 2022, 4:15am UTC](https://discourse.julialang.org/t/linearalgebra-breaks-cuarray/84570 "2022-07-23T04:15:29Z")

</div>

Hi, I have made a minimal reproducible example on the errors reported in my previous posts. It seems to me that the A / b operation breaks sonething in the CuArray, which is obscure to the user. Mysterious as it is, t…

---

## [Performance of PencilFFTs with CuArray](https://discourse.julialang.org/t/performance-of-pencilffts-with-cuarray/84569)

<div class="topic-metadata">

**Author:** [@Lightup1](https://discourse.julialang.org/u/Lightup1)\
**Replies:** 1\
**Last updated:** [July 21, 2022, 6:49am UTC](https://discourse.julialang.org/t/performance-of-pencilffts-with-cuarray/84569 "2022-07-21T06:49:54Z")

</div>

Performance issue on PencilFFTs with CuArray CuArray Performance · Issue #56 · jipolanco/PencilFFTs.jl (github.com) Post here to find more tests. Code example: CUFFT: using CUDA using FFTW using BenchmarkTools prin…

---

## [Cuda-memcheck reports over 1300 errors with 4 lines of julia code with CUDA.jl](https://discourse.julialang.org/t/cuda-memcheck-reports-over-1300-errors-with-4-lines-of-julia-code-with-cuda-jl/84516)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 2\
**Last updated:** [July 20, 2022, 11:39pm UTC](https://discourse.julialang.org/t/cuda-memcheck-reports-over-1300-errors-with-4-lines-of-julia-code-with-cuda-jl/84516 "2022-07-20T23:39:00Z")

</div>

I have a file test.jl of four lines of Julia code using CUDA A = CuArray(rand(1000,1000)); B = CuArray(rand(1000,1000)); C = A \* B; After running the command cuda-memcheck julia test.jl \>\> test.jl.log I have got so m…

---

## [CUDA.jl mystery : VSCode + Julia extension works fine but commandline run fails](https://discourse.julialang.org/t/cuda-jl-mystery-vscode-julia-extension-works-fine-but-commandline-run-fails/84524)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 4\
**Last updated:** [July 20, 2022, 12:10pm UTC](https://discourse.julialang.org/t/cuda-jl-mystery-vscode-julia-extension-works-fine-but-commandline-run-fails/84524 "2022-07-20T12:10:33Z")

</div>

Hi, I have encountered some mysterious issues with CUDA.jl. When I run the code from within the file (in VSCode + Julia extension), everything seems fine and I got the expected answer. But if I run the same code in comm…

---

## [Inplace array modification performances](https://discourse.julialang.org/t/inplace-array-modification-performances/84044)

<div class="topic-metadata">

**Author:** [@dgasteau](https://discourse.julialang.org/u/dgasteau)\
**Replies:** 4\
**Last updated:** [July 20, 2022, 7:09am UTC](https://discourse.julialang.org/t/inplace-array-modification-performances/84044 "2022-07-20T07:09:48Z")

</div>

Hi, I am trying to improve the memory management of some complex iterative procedure. Basically the procedure could be synthesized to for ii = 1:Nt do some partial arrays value update Compute some stuff (include fft…

---

## [CUDA.jl unsupported call to an unknown function, unsupported dynamic function invocation](https://discourse.julialang.org/t/cuda-jl-unsupported-call-to-an-unknown-function-unsupported-dynamic-function-invocation/83997)

<div class="topic-metadata">

**Author:** [@kongdd](https://discourse.julialang.org/u/kongdd)\
**Replies:** 3\
**Last updated:** [July 11, 2022, 1:31pm UTC](https://discourse.julialang.org/t/cuda-jl-unsupported-call-to-an-unknown-function-unsupported-dynamic-function-invocation/83997 "2022-07-11T13:31:04Z")

</div>

I am trying to translate the following function into the GPU version. But faced with the following error: unsupported call to an unknown function Reason: unsupported dynamic function invocation (call to libcuda) begin …

---

## [GPU sparse matrix-vector product with DoubleFloats.jl](https://discourse.julialang.org/t/gpu-sparse-matrix-vector-product-with-doublefloats-jl/84008)

<div class="topic-metadata">

**Author:** [@geoffroyleconte](https://discourse.julialang.org/u/geoffroyleconte)\
**Replies:** 3\
**Last updated:** [July 11, 2022, 7:43am UTC](https://discourse.julialang.org/t/gpu-sparse-matrix-vector-product-with-doublefloats-jl/84008 "2022-07-11T07:43:00Z")

</div>

Hi, Is it possible to use mul! with a CUDA sparse array and CuVectors using DoubleFloats.jl? The following code leads to scalar indexing: using CUDA, SparseArrays, LinearAlgebra, DoubleFloats CUDA.allowscalar(false) T…

---

## [Test of AMDGPU fails on 5900HX - hipErrorNoBinaryForGpu](https://discourse.julialang.org/t/test-of-amdgpu-fails-on-5900hx-hiperrornobinaryforgpu/83982)

<div class="topic-metadata">

**Author:** [@jdad](https://discourse.julialang.org/u/jdad)\
**Replies:** 2\
**Last updated:** [July 9, 2022, 4:05pm UTC](https://discourse.julialang.org/t/test-of-amdgpu-fails-on-5900hx-hiperrornobinaryforgpu/83982 "2022-07-09T16:05:59Z")

</div>

I have small server (Minisforum HX90) with Ryzen 5900HX/ Cezanne APU. I successfully installed AMDGPU julia\> AMDGPU.versioninfo() HSA Runtime (ready) - Path: /home/davidj/.julia/artifacts/b1aa837f69ba67b20f9654af56c818e…

---

## [Metal.jl : Seamless GPU acceleration for Julia based physics using unified processing units?](https://discourse.julialang.org/t/metal-jl-seamless-gpu-acceleration-for-julia-based-physics-using-unified-processing-units/83006)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 1\
**Last updated:** [July 1, 2022, 10:38am UTC](https://discourse.julialang.org/t/metal-jl-seamless-gpu-acceleration-for-julia-based-physics-using-unified-processing-units/83006 "2022-07-01T10:38:21Z")

</div>

Hi, I found this work about GPU programming with apple silicon machines very interesting : Seamless GPU acceleration for C++ based physics using unified processing units: A case study for elastic wave propagation and PD…

---

## [CUDA.jl - Better GPU but Worse Performance](https://discourse.julialang.org/t/cuda-jl-better-gpu-but-worse-performance/83337)

<div class="topic-metadata">

**Author:** [@moukann](https://discourse.julialang.org/u/moukann)\
**Replies:** 10\
**Last updated:** [June 29, 2022, 6:45pm UTC](https://discourse.julialang.org/t/cuda-jl-better-gpu-but-worse-performance/83337 "2022-06-29T18:45:19Z")

</div>

Hello all, I have a question regarding to general usage of CUDA.jl, not a code problem. So we have 2 different computers, both is running on Ubuntu. One of them has Nvidia Quadro P2000 5GB DDR5 160Bit graphics card and…

---

## [CUDA.jl - Memory Efficient Operations, Manipulations and Calculations on Large Sparse Arrays](https://discourse.julialang.org/t/cuda-jl-memory-efficient-operations-manipulations-and-calculations-on-large-sparse-arrays/83091)

<div class="topic-metadata">

**Author:** [@moukann](https://discourse.julialang.org/u/moukann)\
**Replies:** 6\
**Last updated:** [June 21, 2022, 7:54pm UTC](https://discourse.julialang.org/t/cuda-jl-memory-efficient-operations-manipulations-and-calculations-on-large-sparse-arrays/83091 "2022-06-21T19:54:00Z")

</div>

Hello all, I formerly created this topic, my problem is continuing until this day: The problem is related to GPU RAM and its size. The global system is a square matrix, consisting of Float64 values. However, it is mos…

---

## [Gradient of sum of singular values of a matrix with CUDA.jl](https://discourse.julialang.org/t/gradient-of-sum-of-singular-values-of-a-matrix-with-cuda-jl/55390)

<div class="topic-metadata">

**Author:** [@ymtoo](https://discourse.julialang.org/u/ymtoo)\
**Replies:** 7\
**Last updated:** [June 8, 2022, 10:19am UTC](https://discourse.julialang.org/t/gradient-of-sum-of-singular-values-of-a-matrix-with-cuda-jl/55390 "2022-06-08T10:19:16Z")

</div>

Any idea on why it doesn’t work with CUDA julia\> using Flux, LinearAlgebra julia\> x = randn(10, 10); julia\> xgpu = gpu(x); julia\> gradient(x -\> sum(svd(x).S), xgpu) ERROR: MethodError: no method matching svd\_rev(::CU…

---

## [Why does EnsembleGPUArray not save at the given time points the solution?](https://discourse.julialang.org/t/why-does-ensemblegpuarray-not-save-at-the-given-time-points-the-solution/78036)

<div class="topic-metadata">

**Author:** [@Marius\_123](https://discourse.julialang.org/u/Marius_123)\
**Replies:** 1\
**Last updated:** [June 4, 2022, 12:27pm UTC](https://discourse.julialang.org/t/why-does-ensemblegpuarray-not-save-at-the-given-time-points-the-solution/78036 "2022-06-04T12:27:41Z")

</div>

I am trying to solve the same ODE for multiple parameters on the GPU, however as you can see in the provided code, the size of the solution trajectories is not the expected one. I get solution that are of the size 7\*6, b…

---

## [Bug with Julia 1.7.1 and CUDA 3.3](https://discourse.julialang.org/t/bug-with-julia-1-7-1-and-cuda-3-3/74052)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 26\
**Last updated:** [June 2, 2022, 4:12pm UTC](https://discourse.julialang.org/t/bug-with-julia-1-7-1-and-cuda-3-3/74052 "2022-06-02T16:12:05Z")

</div>

Hi, The following lines of code: b, r = CUDA.threadIdx().x, CUDA.blockIdx().x Ush = @cuStaticSharedMem(T, (D,2)) for id1 in N:-1:1 bu1, ru1 = up((b, r), id1, lp) Ush\[b,1\] = U\[b,id1,r\] …

---

## [Using AMDGPU.jl with an AMD APU](https://discourse.julialang.org/t/using-amdgpu-jl-with-an-amd-apu/82134)

<div class="topic-metadata">

**Author:** [@Bruno\_Amorim](https://discourse.julialang.org/u/Bruno_Amorim)\
**Replies:** 4\
**Last updated:** [June 2, 2022, 2:02pm UTC](https://discourse.julialang.org/t/using-amdgpu-jl-with-an-amd-apu/82134 "2022-06-02T14:02:33Z")

</div>

I was trying AMDGPU.jl with an AMD APU. I was convinced that ROCm did not support APU’s, but this thread gave me hope that it might work. I have a desktop with a Ryzen 4750G APU. I am running linux (Kubuntu 21.10 with a…

---

## [Unexpectedly high memory usage when running CUFFT.ifft()](https://discourse.julialang.org/t/unexpectedly-high-memory-usage-when-running-cufft-ifft/82108)

<div class="topic-metadata">

**Author:** [@dnakaikit](https://discourse.julialang.org/u/dnakaikit)\
**Replies:** 3\
**Last updated:** [June 2, 2022, 12:04pm UTC](https://discourse.julialang.org/t/unexpectedly-high-memory-usage-when-running-cufft-ifft/82108 "2022-06-02T12:04:41Z")

</div>

I want to use CUDA.jl instead of CUDA C/C++ on Jetson nano (Single-board computer with GPU), but I am puzzled by the inexplicable memory usage when executing CUFFT.ifft(). I have confirmed that the memory usage of the Ju…

---

## [OpenGL rendering with CUDA](https://discourse.julialang.org/t/opengl-rendering-with-cuda/82063)

<div class="topic-metadata">

**Author:** [@Lads-oxygen](https://discourse.julialang.org/u/Lads-oxygen)\
**Replies:** 2\
**Last updated:** [June 1, 2022, 5:05pm UTC](https://discourse.julialang.org/t/opengl-rendering-with-cuda/82063 "2022-06-01T17:05:48Z")

</div>

I am currently working on a personal project on fractals to be specific, and have used CUDA to implement the computational aspect for a number of reasons. I haven’t optimised my kernel yet, although it runs fast enough f…

---

## [CUDA arrays not working well with broadcast!(), and other in-place operations inside a loop](https://discourse.julialang.org/t/cuda-arrays-not-working-well-with-broadcast-and-other-in-place-operations-inside-a-loop/81965)

<div class="topic-metadata">

**Author:** [@ayushinav](https://discourse.julialang.org/u/ayushinav)\
**Replies:** 4\
**Last updated:** [June 1, 2022, 10:56am UTC](https://discourse.julialang.org/t/cuda-arrays-not-working-well-with-broadcast-and-other-in-place-operations-inside-a-loop/81965 "2022-06-01T10:56:23Z")

</div>

Hey guys, I was working on using GPUs for my codes, and came across this unusual anomaly. I am using Flux.jl along with CUDA.jl. Let’s define the variables first: rickfg= fill(0 .+ im\*0., nf, 1, 1, 1, 1, 1) |\>gpu; # F…

---

## [Training with Flux.jl on the GPU causes ArgumentError: cannot take the CPU address of a CuArray](https://discourse.julialang.org/t/training-with-flux-jl-on-the-gpu-causes-argumenterror-cannot-take-the-cpu-address-of-a-cuarray/81751)

<div class="topic-metadata">

**Author:** [@lfenzo](https://discourse.julialang.org/u/lfenzo)\
**Replies:** 4\
**Last updated:** [May 28, 2022, 4:30pm UTC](https://discourse.julialang.org/t/training-with-flux-jl-on-the-gpu-causes-argumenterror-cannot-take-the-cpu-address-of-a-cuarray/81751 "2022-05-28T16:30:54Z")

</div>

Hello! I’m trying to train a neural network using Flux.jl on the GPU with CUDA.jl. My issue (see error below) is that there seems to be some problem during the data transfer process between the GPU and CPU which causes …

---

## [ERROR: UndefVarError: parameters not defined](https://discourse.julialang.org/t/error-undefvarerror-parameters-not-defined/81385)

<div class="topic-metadata">

**Author:** [@Hupdup](https://discourse.julialang.org/u/Hupdup)\
**Replies:** 6\
**Last updated:** [May 24, 2022, 7:50am UTC](https://discourse.julialang.org/t/error-undefvarerror-parameters-not-defined/81385 "2022-05-24T07:50:06Z")

</div>

Hi, I want to do some reinforcement learning in Julia, but when I want to perform my action, it always gives me this error. do you know what i should do? I already downloaded the latest version of the packages. functio…

---

## [Is it possible to unsynch the EnsembleGPUArrays?](https://discourse.julialang.org/t/is-it-possible-to-unsynch-the-ensemblegpuarrays/77879)

<div class="topic-metadata">

**Author:** [@Marius\_123](https://discourse.julialang.org/u/Marius_123)\
**Replies:** 6\
**Last updated:** [May 20, 2022, 9:35am UTC](https://discourse.julialang.org/t/is-it-possible-to-unsynch-the-ensemblegpuarrays/77879 "2022-05-20T09:35:52Z")

</div>

Hello, i want to solve multiple ODEs in parallel on the GPU, is it possible to do this unsynchronized? As stated in the DiffEqGPU, all trajectories have the same time stepping. This slows down the solving if one trajecto…

---

## [ParallelStencil works with Threads but not with CUDA](https://discourse.julialang.org/t/parallelstencil-works-with-threads-but-not-with-cuda/78927)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 6\
**Last updated:** [May 17, 2022, 5:40pm UTC](https://discourse.julialang.org/t/parallelstencil-works-with-threads-but-not-with-cuda/78927 "2022-05-17T17:40:30Z")

</div>

Hellos I have a code of Edge Detection using ParallelStencil. The algorithm is basic, it just compares one pixel to its left and bottom neighbors, if their values are above one threshold, I fill the image(matrix) with …

---

## [InvalidIRError on rand! when using Flux and MLDatasets](https://discourse.julialang.org/t/invalidirerror-on-rand-when-using-flux-and-mldatasets/80675)

<div class="topic-metadata">

**Author:** [@sigmike](https://discourse.julialang.org/u/sigmike)\
**Replies:** 7\
**Last updated:** [May 14, 2022, 9:08am UTC](https://discourse.julialang.org/t/invalidirerror-on-rand-when-using-flux-and-mldatasets/80675 "2022-05-14T09:08:37Z")

</div>

I recently updated my system and Julia and now the following program fails (it didn’t fail before the updates): using Flux using MLDatasets using CUDA using Random a = CuArray{Float32}(undef, 2) Random.rand!(CUDA.defau…

---

## [Cross-platform (CPU/GPU) data structure for linear algebra](https://discourse.julialang.org/t/cross-platform-cpu-gpu-data-structure-for-linear-algebra/79877)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 3\
**Last updated:** [May 13, 2022, 7:26am UTC](https://discourse.julialang.org/t/cross-platform-cpu-gpu-data-structure-for-linear-algebra/79877 "2022-05-13T07:26:20Z")

</div>

Hi, I’m building an ML application, and want to pass around a data structure that contains several scalars/arrays/vertices/matrices. The dimension will be determined at runtime, depending on input dataset etc. The nume…

---

## [NVIDIA Driver Release 510 and Julia 1.7.2](https://discourse.julialang.org/t/nvidia-driver-release-510-and-julia-1-7-2/80451)

<div class="topic-metadata">

**Author:** [@afas](https://discourse.julialang.org/u/afas)\
**Replies:** 8\
**Last updated:** [May 10, 2022, 8:52pm UTC](https://discourse.julialang.org/t/nvidia-driver-release-510-and-julia-1-7-2/80451 "2022-05-10T20:52:55Z")

</div>

Hi everyone, I am experiencing unwanted behavior from CUDA and I was wondering if anyone has any idea about what is happening here. Brief intro: I just installed Julia 1.7.2 on a new Windows machine. CUDA was working ju…

---

## [Cannot take the CPU address of a CUDA.CuArray{Float32, 1, CUDA.Mem.DeviceBuffer} in LinearAlgebra matmul](https://discourse.julialang.org/t/cannot-take-the-cpu-address-of-a-cuda-cuarray-float32-1-cuda-mem-devicebuffer-in-linearalgebra-matmul/80666)

<div class="topic-metadata">

**Author:** [@LarsWl](https://discourse.julialang.org/u/LarsWl)\
**Replies:** 0\
**Last updated:** [May 7, 2022, 12:53pm UTC](https://discourse.julialang.org/t/cannot-take-the-cpu-address-of-a-cuda-cuarray-float32-1-cuda-mem-devicebuffer-in-linearalgebra-matmul/80666 "2022-05-07T12:53:17Z")

</div>

Have such function, that usually calculated correct. function predict\_train(model::Model, batch) (calculate\_hidden(model, batch, dropout\_active=true) .^ 3) |\> model.upper\_layer |\> (upper) -\> model.output\_laye…

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

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