# GPU

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

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

**Page:** 9

---

## [Why GPU still OOM when using CUDA unified memory?](https://discourse.julialang.org/t/why-gpu-still-oom-when-using-cuda-unified-memory/111543)

<div class="topic-metadata">

**Author:** [@pxshen](https://discourse.julialang.org/u/pxshen)\
**Replies:** 6\
**Last updated:** [March 14, 2024, 6:44pm UTC](https://discourse.julialang.org/t/why-gpu-still-oom-when-using-cuda-unified-memory/111543 "2024-03-14T18:44:30Z")

</div>

I’ve way more RAM than VRAM. Code runs fine on CPU. I thought using CUDA unified memory lets GPU tap system RAM but it still OOM. I’m asking bc I’m getting a new laptop for ML work. Does unified memory mean VRAM is no l…

---

## [Metal.jl and Flux.jl on M1 chip](https://discourse.julialang.org/t/metal-jl-and-flux-jl-on-m1-chip/96882)

<div class="topic-metadata">

**Author:** [@Jacob\_Cahoon](https://discourse.julialang.org/u/Jacob_Cahoon)\
**Replies:** 2\
**Last updated:** [March 6, 2024, 12:50pm UTC](https://discourse.julialang.org/t/metal-jl-and-flux-jl-on-m1-chip/96882 "2024-03-06T12:50:54Z")

</div>

When my loss function is called in the train!() method, I keep getting this error and I don’t know how to fix it. I can’t use CUDA because I am using an M1 chip. Any ideas? Here’s my full code: include("data\_prep.jl") …

---

## [Performance of array of structs](https://discourse.julialang.org/t/performance-of-array-of-structs/111156)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 4\
**Last updated:** [March 5, 2024, 12:34pm UTC](https://discourse.julialang.org/t/performance-of-array-of-structs/111156 "2024-03-05T12:34:51Z")

</div>

I compared array-of-struct and struct-of-array and seems struct-of-array is faster. struct MyStr{T} Δxˣ::T Δxʸ::T Δvˣ::T Δvʸ::T ρᵢ::T ρⱼ::T end function pairs\_calk!(buff, pairs; minthreads::Int …

---

## [DiffEqGPU - slow parallel solving of SDEs on GPU](https://discourse.julialang.org/t/diffeqgpu-slow-parallel-solving-of-sdes-on-gpu/110814)

<div class="topic-metadata">

**Author:** [@sob](https://discourse.julialang.org/u/sob)\
**Replies:** 6\
**Last updated:** [March 3, 2024, 4:10pm UTC](https://discourse.julialang.org/t/diffeqgpu-slow-parallel-solving-of-sdes-on-gpu/110814 "2024-03-03T16:10:11Z")

</div>

Hi all, As part of a broader project to run SDEs on GPU, I was taking a stab first at the example on the SciML website, slightly modified with a number of trajectories set to 250e3 to have a better idea of how much time…

---

## [CUDA.jl for particle tracking simulation](https://discourse.julialang.org/t/cuda-jl-for-particle-tracking-simulation/110906)

<div class="topic-metadata">

**Author:** [@VitorSouzaLNLS](https://discourse.julialang.org/u/VitorSouzaLNLS)\
**Replies:** 4\
**Last updated:** [February 29, 2024, 10:40am UTC](https://discourse.julialang.org/t/cuda-jl-for-particle-tracking-simulation/110906 "2024-02-29T10:40:35Z")

</div>

Im trying to implement some consolidated CPU functions for particle tracking simulations (models of synchrotron accelerators) in GPU using CUDA.jl. The goal is to be able to paralelize tracking routines. I had tried to …

---

## [GPU problems with RecursiveArrayTools](https://discourse.julialang.org/t/gpu-problems-with-recursivearraytools/110830)

<div class="topic-metadata">

**Author:** [@agelgazzar](https://discourse.julialang.org/u/agelgazzar)\
**Replies:** 1\
**Last updated:** [February 28, 2024, 8:25pm UTC](https://discourse.julialang.org/t/gpu-problems-with-recursivearraytools/110830 "2024-02-28T20:25:29Z")

</div>

Hi, I have an system of ODEs where the state is an array of arrays. I want to be able to solve my ODE on the gpu. I am using ArrayPartition where each array is an CuArray. However, I get the scalar indexing error. The co…

---

## [How to copy array back from GPU do CPU?](https://discourse.julialang.org/t/how-to-copy-array-back-from-gpu-do-cpu/110802)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 2\
**Last updated:** [February 26, 2024, 8:59pm UTC](https://discourse.julialang.org/t/how-to-copy-array-back-from-gpu-do-cpu/110802 "2024-02-26T20:59:45Z")

</div>

Let’s say I have a done a computation on a GPU. How do I copy this data back to the CPU, so that I can play around with it on CPU (like make the plots) and save it to disk (more important for me)?

---

## [Understanding stride loop](https://discourse.julialang.org/t/understanding-stride-loop/110721)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 7\
**Last updated:** [February 25, 2024, 7:38pm UTC](https://discourse.julialang.org/t/understanding-stride-loop/110721 "2024-02-25T19:38:56Z")

</div>

I try to read performance tips :sweat\_smile:) (Performance Tips · CUDA.jl) and can’t understand what is the point of this example, because seems while executed only once. function gpu\_add5!(y, x) index = (blockIdx…

---

## [Optimizing a CUDA-based Loss Function for Neural Network Training](https://discourse.julialang.org/t/optimizing-a-cuda-based-loss-function-for-neural-network-training/110365)

<div class="topic-metadata">

**Author:** [@josemanuel22](https://discourse.julialang.org/u/josemanuel22)\
**Replies:** 0\
**Last updated:** [February 18, 2024, 8:54am UTC](https://discourse.julialang.org/t/optimizing-a-cuda-based-loss-function-for-neural-network-training/110365 "2024-02-18T08:54:36Z")

</div>

This post is hidden. You deleted this post 8 hours ago. I have been working on the following loss function to train neural networks based on a statistical invariant. I have tried to port the function to GPU/CUDA, and I …

---

## [How to move an array of struct with array members to GPU?](https://discourse.julialang.org/t/how-to-move-an-array-of-struct-with-array-members-to-gpu/110240)

<div class="topic-metadata">

**Author:** [@zhzhang](https://discourse.julialang.org/u/zhzhang)\
**Replies:** 2\
**Last updated:** [February 15, 2024, 9:45am UTC](https://discourse.julialang.org/t/how-to-move-an-array-of-struct-with-array-members-to-gpu/110240 "2024-02-15T09:45:30Z")

</div>

Hello, Recently I wanted to write a finite volume method navier-stokes solver with CUDA.jl. I was planning to store my mesh as a large array of cell structs, which stores positions, indices, primitive variables, etc for…

---

## [Using NVIDIA Nsight Systems](https://discourse.julialang.org/t/using-nvidia-nsight-systems/110220)

<div class="topic-metadata">

**Author:** [@Rabab53](https://discourse.julialang.org/u/Rabab53)\
**Replies:** 1\
**Last updated:** [February 14, 2024, 6:27pm UTC](https://discourse.julialang.org/t/using-nvidia-nsight-systems/110220 "2024-02-14T18:27:33Z")

</div>

Hello, I am trying to use CUDA profile using Nsight Systems, but I facing some issues with some warning. I am using (2024.1.1.59) version of Nsight Systems. omairyrm@vulture:~/Julia\_rabab$ nsys launch julia …

---

## [Solve linear systems inside CUDA kernel function](https://discourse.julialang.org/t/solve-linear-systems-inside-cuda-kernel-function/110202)

<div class="topic-metadata">

**Author:** [@FR13ndSDP](https://discourse.julialang.org/u/FR13ndSDP)\
**Replies:** 8\
**Last updated:** [February 14, 2024, 4:54pm UTC](https://discourse.julialang.org/t/solve-linear-systems-inside-cuda-kernel-function/110202 "2024-02-14T16:54:12Z")

</div>

Hello everyone, I was wondering how to solve a small linear system Ax = b inside a CUDA kernel function, where A, x and b are MMatrix and MVector. I want to do this with x = A\\b, but it does not work inside a kernel, is …

---

## [Failed to profile CUDA.jl with Nsight Systems 2024.1.1](https://discourse.julialang.org/t/failed-to-profile-cuda-jl-with-nsight-systems-2024-1-1/110051)

<div class="topic-metadata">

**Author:** [@yuwenchen95](https://discourse.julialang.org/u/yuwenchen95)\
**Replies:** 4\
**Last updated:** [February 13, 2024, 11:19am UTC](https://discourse.julialang.org/t/failed-to-profile-cuda-jl-with-nsight-systems-2024-1-1/110051 "2024-02-13T11:19:54Z")

</div>

I am following the doc to learn profiling GPU in Julia. When I followed $ nsys launch julia It started a Julia terminal but then failed when I run using CUDA and return errors: Please submit a bug report with steps …

---

## [Modifying a thread-local vector within CUDA Dynamic Parallelism](https://discourse.julialang.org/t/modifying-a-thread-local-vector-within-cuda-dynamic-parallelism/110110)

<div class="topic-metadata">

**Author:** [@luciano-drozda](https://discourse.julialang.org/u/luciano-drozda)\
**Replies:** 2\
**Last updated:** [February 13, 2024, 1:19am UTC](https://discourse.julialang.org/t/modifying-a-thread-local-vector-within-cuda-dynamic-parallelism/110110 "2024-02-13T01:19:40Z")

</div>

Hi! I’d like to modify an MVector in the context of CUDA Dynamic Parallelism. Here goes a minimal example: using CUDA, StaticArrays function outer!() v = MVector{1, Float32}(undef) @cuda dynamic = true inner!(v…

---

## [CUDA + StaticArrays weird dynamic function invocation](https://discourse.julialang.org/t/cuda-staticarrays-weird-dynamic-function-invocation/109881)

<div class="topic-metadata">

**Author:** [@trahflow](https://discourse.julialang.org/u/trahflow)\
**Replies:** 2\
**Last updated:** [February 12, 2024, 12:07pm UTC](https://discourse.julialang.org/t/cuda-staticarrays-weird-dynamic-function-invocation/109881 "2024-02-12T12:07:29Z")

</div>

Hi, I have a weird issue that is somewhat related to this thread. When using StaticArrays within a CUDA kernel, it seems to be necessary to add @inbounds before converting arrays/views to static arrays, otherwise this …

---

## [Error adding CUDA on Windows 11 and Julia 1.10. It works with Julia 1.9](https://discourse.julialang.org/t/error-adding-cuda-on-windows-11-and-julia-1-10-it-works-with-julia-1-9/109476)

<div class="topic-metadata">

**Author:** [@LucB](https://discourse.julialang.org/u/LucB)\
**Replies:** 8\
**Last updated:** [February 6, 2024, 8:08pm UTC](https://discourse.julialang.org/t/error-adding-cuda-on-windows-11-and-julia-1-10-it-works-with-julia-1-9/109476 "2024-02-06T20:08:30Z")

</div>

Hi, I use juliaup to have 1.10 and 1.9 version. I have an application working with 1.9, CUDA (ML with Flux). When I switch to Julia 1.10 I’m unable to add CUDA. (I have the last NVIDIA driver installed). This is the err…

---

## [Unable to test or use HIP libraries on Windows 10](https://discourse.julialang.org/t/unable-to-test-or-use-hip-libraries-on-windows-10/109639)

<div class="topic-metadata">

**Author:** [@mp59](https://discourse.julialang.org/u/mp59)\
**Replies:** 4\
**Last updated:** [February 2, 2024, 7:52pm UTC](https://discourse.julialang.org/t/unable-to-test-or-use-hip-libraries-on-windows-10/109639 "2024-02-02T19:52:39Z")

</div>

Hello, I am relatively new to Julia and very new to GPU programming. Recently I decided to use AMDGPU.jl, however, it does not seem like Julia can AMD’s HIP libraries, even though it recognizes that they are there. Here…

---

## [Image Rotation Algorithm for CUDA and Zygote](https://discourse.julialang.org/t/image-rotation-algorithm-for-cuda-and-zygote/54085)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 10\
**Last updated:** [January 31, 2024, 12:29pm UTC](https://discourse.julialang.org/t/image-rotation-algorithm-for-cuda-and-zygote/54085 "2024-01-31T12:29:43Z")

</div>

Hey, today I wanted to use a image rotation algorithm to rotate a 3D array around one dimension (so basically many 2D images). For my applications it needs to be fast and also fully differentiable by Zygote. I tried I…

---

## [Is this a good GPU use case?](https://discourse.julialang.org/t/is-this-a-good-gpu-use-case/93787)

<div class="topic-metadata">

**Author:** [@philip](https://discourse.julialang.org/u/philip)\
**Replies:** 2\
**Last updated:** [January 28, 2024, 8:08pm UTC](https://discourse.julialang.org/t/is-this-a-good-gpu-use-case/93787 "2024-01-28T20:08:34Z")

</div>

I would like to perform millions of parallel discrete optimization computations loosely like the following: later = \[9, 8, 4, 1, 0\] today = \[1, 2, 3, 4, 5\] best\_value = -Inf best\_index = -Inf for index in 1:5…

---

## [Confusing performance of LinearAlgebra.mul! for Float64](https://discourse.julialang.org/t/confusing-performance-of-linearalgebra-mul-for-float64/109064)

<div class="topic-metadata">

**Author:** [@ArrogantGao](https://discourse.julialang.org/u/ArrogantGao)\
**Replies:** 4\
**Last updated:** [January 23, 2024, 12:17pm UTC](https://discourse.julialang.org/t/confusing-performance-of-linearalgebra-mul-for-float64/109064 "2024-01-23T12:17:46Z")

</div>

Hi, I was benchmarking the performance of LinearAlgebra.mul! and got something quite confusing. julia\> using CUDA, LinearAlgebra, BenchmarkTools julia\> versioninfo() Julia Version 1.10.0 Commit 3120989f39b (2023-12-25 …

---

## [Having issues with running NeuralPDE on GPU](https://discourse.julialang.org/t/having-issues-with-running-neuralpde-on-gpu/108581)

<div class="topic-metadata">

**Author:** [@tajimura](https://discourse.julialang.org/u/tajimura)\
**Replies:** 5\
**Last updated:** [January 22, 2024, 9:49am UTC](https://discourse.julialang.org/t/having-issues-with-running-neuralpde-on-gpu/108581 "2024-01-22T09:49:58Z")

</div>

Was trying to train a PINN for NLSE using NeuralPDE. Everything runs fine on CPU, but when I try to move calculations to GPU, I get the following error: ERROR: CuArray only supports element types that are allocated inli…

---

## [Correct usage of shared memory？](https://discourse.julialang.org/t/correct-usage-of-shared-memory/107997)

<div class="topic-metadata">

**Author:** [@FR13ndSDP](https://discourse.julialang.org/u/FR13ndSDP)\
**Replies:** 5\
**Last updated:** [January 20, 2024, 6:28pm UTC](https://discourse.julialang.org/t/correct-usage-of-shared-memory/107997 "2024-01-20T18:28:23Z")

</div>

Hello everyone, I tried to test the performance of shared memory of CUDA.jl with this code: using CUDA, BenchmarkTools, Plots # initialize const N::Int64 = 1024 ϕ = ones(Float64, N, N) ϕ\[1, :\] .= 10.0 function evolve…

---

## [Help debugging Runtime error 1](https://discourse.julialang.org/t/help-debugging-runtime-error-1/108931)

<div class="topic-metadata">

**Author:** [@nomadbl](https://discourse.julialang.org/u/nomadbl)\
**Replies:** 7\
**Last updated:** [January 19, 2024, 8:27am UTC](https://discourse.julialang.org/t/help-debugging-runtime-error-1/108931 "2024-01-19T08:27:48Z")

</div>

I wrote an implementation of im2col kernel to use with a custom convolution-like operation on GPU with CUDA.jl. After testing it for correctness (comparing with the NNlib cpu implementation), I am trying to use it in my…

---

## [Kernel Error while running code on GPU](https://discourse.julialang.org/t/kernel-error-while-running-code-on-gpu/108745)

<div class="topic-metadata">

**Author:** [@Pranav\_Vinod](https://discourse.julialang.org/u/Pranav_Vinod)\
**Replies:** 12\
**Last updated:** [January 18, 2024, 8:57am UTC](https://discourse.julialang.org/t/kernel-error-while-running-code-on-gpu/108745 "2024-01-18T08:57:10Z")

</div>

I have been trying to run the following code on a GPU: using OrdinaryDiffEq using DiffEqFlux using Random using CUDA using DiffEqFlux: gpu CUDA.allowscalar(true) function RelativisticOrbitModel(u, model\_params, t) …

---

## [Is it possible to diagonalize matrices with M-series Apple Silicon GPUs?](https://discourse.julialang.org/t/is-it-possible-to-diagonalize-matrices-with-m-series-apple-silicon-gpus/106075)

<div class="topic-metadata">

**Author:** [@mdyuki](https://discourse.julialang.org/u/mdyuki)\
**Replies:** 10\
**Last updated:** [January 12, 2024, 3:39pm UTC](https://discourse.julialang.org/t/is-it-possible-to-diagonalize-matrices-with-m-series-apple-silicon-gpus/106075 "2024-01-12T15:39:22Z")

</div>

Hello. I have to diagonalize Hermtian matrices with large (e.g. 10k X 10k) dimensions for many times. To reduce computing time, I am considering using GPUs. Since I have a Mac mini with M1 chip now, I would like to try …

---

## [CURAND no longer makes CU Array for Complex Numbers](https://discourse.julialang.org/t/curand-no-longer-makes-cu-array-for-complex-numbers/108602)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 6\
**Last updated:** [January 11, 2024, 5:13pm UTC](https://discourse.julialang.org/t/curand-no-longer-makes-cu-array-for-complex-numbers/108602 "2024-01-11T17:13:33Z")

</div>

I feel I am doing something wrong. I’m not an expert in this GPU coding, so I was happy when I got this working maybe a year or two ago. I’m revisiting this code and it has stopped working. I have a vector of complex …

---

## [Parallel PyJulia](https://discourse.julialang.org/t/parallel-pyjulia/108680)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 0\
**Last updated:** [January 11, 2024, 12:57pm UTC](https://discourse.julialang.org/t/parallel-pyjulia/108680 "2024-01-11T12:57:00Z")

</div>

I am trying to train a RL model for controlling a kite. I am using python for training, and julia for the simulation. I want to speed up training using parallel deep RL. When trying to run julia functions from python in …

---

## [Is there round(..., digits=2) in CUDA?](https://discourse.julialang.org/t/is-there-round-digits-2-in-cuda/108450)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 2\
**Last updated:** [January 7, 2024, 7:51am UTC](https://discourse.julialang.org/t/is-there-round-digits-2-in-cuda/108450 "2024-01-07T07:51:14Z")

</div>

I would like to use the function round(a, digits=2) on the GPU, but it seems that this is not possible. Is there another function for this purpose? Thank you in advance

---

## [Failed test of CUDA package](https://discourse.julialang.org/t/failed-test-of-cuda-package/107378)

<div class="topic-metadata">

**Author:** [@nihil](https://discourse.julialang.org/u/nihil)\
**Replies:** 6\
**Last updated:** [January 3, 2024, 8:27am UTC](https://discourse.julialang.org/t/failed-test-of-cuda-package/107378 "2024-01-03T08:27:19Z")

</div>

There are a fair few failed tests from ‘test CUDA’ in the package manager. Is this normal, or is this from a miss-match of driver and julia pagage? CUDA.versioninfo() CUDA runtime 12.3, artifact installation CUDA dri…

---

## [Some AMDGPU tests failing on Radeon VII under Windows](https://discourse.julialang.org/t/some-amdgpu-tests-failing-on-radeon-vii-under-windows/108074)

<div class="topic-metadata">

**Author:** [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)\
**Replies:** 10\
**Last updated:** [December 27, 2023, 11:34pm UTC](https://discourse.julialang.org/t/some-amdgpu-tests-failing-on-radeon-vii-under-windows/108074 "2023-12-27T23:34:04Z")

</div>

I recently installed ROCm/HIP on Windows. I have a Radeon VII installed in my desktop, which isn’t officially supported but I’ve heard that it works for some people. It seems to kind-of work, but I consistently get a sma…

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

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