# GPU

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

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

**Page:** 24

---

## [Linear system problems](https://discourse.julialang.org/t/linear-system-problems/54519)

<div class="topic-metadata">

**Author:** [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)\
**Replies:** 35\
**Last updated:** [February 4, 2021, 10:57am UTC](https://discourse.julialang.org/t/linear-system-problems/54519 "2021-02-04T10:57:31Z")

</div>

Hello, I’m writing some code that solves A\*x=b, where A can be quite big (say 10000x10000, hopefully bigger in the future). A is not sparse (at least for now) and might be poorly conditioned. Might even have multiple so…

---

## [VFI algorithm (Econ) on the GPU tutorial](https://discourse.julialang.org/t/vfi-algorithm-econ-on-the-gpu-tutorial/21680)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 5\
**Last updated:** [February 1, 2021, 4:18pm UTC](https://discourse.julialang.org/t/vfi-algorithm-econ-on-the-gpu-tutorial/21680 "2021-02-01T16:18:58Z")

</div>

I wrote a simple extension of the CuArrays.jl tutorial section on how to iterate a value function on the gpu. https://floswald.github.io/html/vfi.html

---

## [Matrix multiplication with CPU and CUDA](https://discourse.julialang.org/t/matrix-multiplication-with-cpu-and-cuda/54364)

<div class="topic-metadata">

**Author:** [@ymtoo](https://discourse.julialang.org/u/ymtoo)\
**Replies:** 2\
**Last updated:** [February 1, 2021, 9:04am UTC](https://discourse.julialang.org/t/matrix-multiplication-with-cpu-and-cuda/54364 "2021-02-01T09:04:23Z")

</div>

Matrix multiplication yields slightly different results with CPU and CUDA. Is this a normal behaviour? julia\> using CUDA julia\> X = randn(Float32, 8, 16) 8×16 Array{Float32,2}: 0.933839 0.535854 0.054124 … -0.…

---

## [CUDA.jl not inlining "simple" functions](https://discourse.julialang.org/t/cuda-jl-not-inlining-simple-functions/50153)

<div class="topic-metadata">

**Author:** [@cdsousa](https://discourse.julialang.org/u/cdsousa)\
**Replies:** 5\
**Last updated:** [January 30, 2021, 7:11pm UTC](https://discourse.julialang.org/t/cuda-jl-not-inlining-simple-functions/50153 "2021-01-30T19:11:04Z")

</div>

After porting some code from using oneAPI.jl GPU kernels to CUDA.jl I got timings in CUDA which were higher than the ones from running in an Intel GPU. Something like getting 20ms on the on an Nvidia Gtx 1080 Ti and 14m…

---

## [CUDA.jl compiles to 15GB](https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040)

<div class="topic-metadata">

**Author:** [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)\
**Replies:** 4\
**Last updated:** [January 27, 2021, 9:56am UTC](https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040 "2021-01-27T09:56:20Z")

</div>

Hi. I’m trying to use PackageCompiler and CUDA. PackageCompiler makes even the smallest program around 150MB because it adds almost all of Julia to it. But when using CUDA, the smallest program seems to have 15GB in the…

---

## [Using functions in GPU Kernel (via KernelAbstractions.jl) (k nearest neighbor kernel)](https://discourse.julialang.org/t/using-functions-in-gpu-kernel-via-kernelabstractions-jl-k-nearest-neighbor-kernel/53850)

<div class="topic-metadata">

**Author:** [@jenkspt](https://discourse.julialang.org/u/jenkspt)\
**Replies:** 1\
**Last updated:** [January 25, 2021, 4:44pm UTC](https://discourse.julialang.org/t/using-functions-in-gpu-kernel-via-kernelabstractions-jl-k-nearest-neighbor-kernel/53850 "2021-01-25T16:44:49Z")

</div>

I’ve been working on implementing the k nearest neighbors CUDA kernel from https://github.com/facebookresearch/pytorch3d/tree/master/pytorch3d/csrc/knn in Julia. I found KernelAbstractions.jl allows the code to be simpli…

---

## [Failure to run CUDA.jl](https://discourse.julialang.org/t/failure-to-run-cuda-jl/53657)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 3\
**Last updated:** [January 20, 2021, 10:07am UTC](https://discourse.julialang.org/t/failure-to-run-cuda-jl/53657 "2021-01-20T10:07:34Z")

</div>

Hi, I just installed julia 1.5.3 and CUDA.jl in an office computer that runs ubuntu 18.04 and that has old UCDA drivers (from a couple of years ago). I can install CUDA.jl but when I try to use it, if fails to start and…

---

## [Any way to delete an object and free memory?](https://discourse.julialang.org/t/any-way-to-delete-an-object-and-free-memory/53600)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 5\
**Last updated:** [January 19, 2021, 2:19pm UTC](https://discourse.julialang.org/t/any-way-to-delete-an-object-and-free-memory/53600 "2021-01-19T14:19:50Z")

</div>

Hi, I have a Monte Carlo simulation code that uses instances of a mutable struct that contain arrays. These arrays can be really large when the number of particles in the simulation increase. In the code, I have one ins…

---

## [Functions of GPUArrays in ODEs and scheduling on GPU](https://discourse.julialang.org/t/functions-of-gpuarrays-in-odes-and-scheduling-on-gpu/53304)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 11\
**Last updated:** [January 15, 2021, 11:31am UTC](https://discourse.julialang.org/t/functions-of-gpuarrays-in-odes-and-scheduling-on-gpu/53304 "2021-01-15T11:31:57Z")

</div>

I have a totally noob question here. I know that there are GPUArrays for which broadcasting and various linear algebra stuff is overloaded, so it gets executed on GPU. Suppose, that I define a function which works with…

---

## [KernelError with Flux.tain! on GPU](https://discourse.julialang.org/t/kernelerror-with-flux-tain-on-gpu/52989)

<div class="topic-metadata">

**Author:** [@Geoffrey](https://discourse.julialang.org/u/Geoffrey)\
**Replies:** 4\
**Last updated:** [January 15, 2021, 8:42am UTC](https://discourse.julialang.org/t/kernelerror-with-flux-tain-on-gpu/52989 "2021-01-15T08:42:31Z")

</div>

Hi, I’m trying to train denoising autoencoder for data imputation and I manage to get it work on CPU but I get a KernelError when trying to go on GPU. However, I checked that my loss function don’t produce error when us…

---

## [DiffEqFlux GPU example slow](https://discourse.julialang.org/t/diffeqflux-gpu-example-slow/53336)

<div class="topic-metadata">

**Author:** [@acse-ogb119](https://discourse.julialang.org/u/acse-ogb119)\
**Replies:** 3\
**Last updated:** [January 14, 2021, 1:53pm UTC](https://discourse.julialang.org/t/diffeqflux-gpu-example-slow/53336 "2021-01-14T13:53:11Z")

</div>

I copy and paste the DiffEqFlux.jl GPU example, slap in an @time on the sciml\_train call at the end and spin it up. The runtime is reported on my system as around 38 seconds. I then edit the example to be fully CPU, and…

---

## [CUDA.jl Differentiation Error](https://discourse.julialang.org/t/cuda-jl-differentiation-error/53011)

<div class="topic-metadata">

**Author:** [@Honza9723](https://discourse.julialang.org/u/Honza9723)\
**Replies:** 5\
**Last updated:** [January 12, 2021, 1:28pm UTC](https://discourse.julialang.org/t/cuda-jl-differentiation-error/53011 "2021-01-12T13:28:17Z")

</div>

Dear All, while working on my project (epidemic model, solved using PINN), I tried to port my code to GPU. While function (loss function of my neural network) works and delivers reasonable speed up, while computing grad…

---

## [Can't compile a GPU kernel function for =\>](https://discourse.julialang.org/t/cant-compile-a-gpu-kernel-function-for/53100)

<div class="topic-metadata">

**Author:** [@Stephan\_Meyn](https://discourse.julialang.org/u/Stephan_Meyn)\
**Replies:** 2\
**Last updated:** [January 11, 2021, 10:36am UTC](https://discourse.julialang.org/t/cant-compile-a-gpu-kernel-function-for/53100 "2021-01-11T10:36:55Z")

</div>

I’m trying to persuade CUDA.jl to compile a kernel function. After reducing the issue I have come to this sample code using CUDA x=Float32(2.0) knots =CuArray{Float32,1}(\[1.2, 2.0, 3.0\]) mapOp(v::Float32)::Int = v \>= x…

---

## [Errors during test CUDA](https://discourse.julialang.org/t/errors-during-test-cuda/53142)

<div class="topic-metadata">

**Author:** [@youeh1](https://discourse.julialang.org/u/youeh1)\
**Replies:** 0\
**Last updated:** [January 11, 2021, 6:09am UTC](https://discourse.julialang.org/t/errors-during-test-cuda/53142 "2021-01-11T06:09:42Z")

</div>

Hi, I just format my labtop and install graphics drivers CUDA 11.2 julia (1.53) I added CUDA.jl and downloaded cuDNN111 via artifact and had no errors by here. I ran Pkg\> test CUDA, now I got errors ┌ Error: Excep…

---

## [Cuda cg + ilu?](https://discourse.julialang.org/t/cuda-cg-ilu/53069)

<div class="topic-metadata">

**Author:** [@Omega-xyZac](https://discourse.julialang.org/u/Omega-xyZac)\
**Replies:** 4\
**Last updated:** [January 9, 2021, 12:38am UTC](https://discourse.julialang.org/t/cuda-cg-ilu/53069 "2021-01-09T00:38:24Z")

</div>

Hi all, I’m looking to use a GPU CG method with an ILU preconditioner. I’m currently using a CPU CG method through IterativeSolvers and ILU through IncompleteLU.jl . The CG method from IterativeSolvers is easily extende…

---

## [Finding index and value of largest two elements in a CuArray](https://discourse.julialang.org/t/finding-index-and-value-of-largest-two-elements-in-a-cuarray/52110)

<div class="topic-metadata">

**Author:** [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Replies:** 11\
**Last updated:** [January 5, 2021, 4:36pm UTC](https://discourse.julialang.org/t/finding-index-and-value-of-largest-two-elements-in-a-cuarray/52110 "2021-01-05T16:36:24Z")

</div>

I need to find the indices and values of the two largest elements in a 2D array. I whipped up a foldl-based solution for the CPU that’s much faster than Base.findmax and Base.partialsortperm, but it runs like molasses on…

---

## [Use of static array in a kernel function](https://discourse.julialang.org/t/use-of-static-array-in-a-kernel-function/52852)

<div class="topic-metadata">

**Author:** [@youngdae](https://discourse.julialang.org/u/youngdae)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 11:12pm UTC](https://discourse.julialang.org/t/use-of-static-array-in-a-kernel-function/52852 "2021-01-04T23:12:11Z")

</div>

Can I use StaticArrays in a kernel function? I wanted to use registers allocated for each thread. I thought that SVector would do that for me so I tried the following simple function. But, it says the kernel is returning…

---

## [Overcoming Slow Scalar Operations on GPU Arrays](https://discourse.julialang.org/t/overcoming-slow-scalar-operations-on-gpu-arrays/49554)

<div class="topic-metadata">

**Author:** [@sazio](https://discourse.julialang.org/u/sazio)\
**Replies:** 19\
**Last updated:** [January 4, 2021, 5:00pm UTC](https://discourse.julialang.org/t/overcoming-slow-scalar-operations-on-gpu-arrays/49554 "2021-01-04T17:00:29Z")

</div>

Hi all, I’ve been trying to exploit GPU capabilities for solving a NeuralPDE with GalacticOptim.solve, but I’ve been stumbling into a problem related to scalar operations on GPU arrays. In line 123 I use the |\> gpu ope…

---

## [Map Performance with CuArrays](https://discourse.julialang.org/t/map-performance-with-cuarrays/33497)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 15\
**Last updated:** [January 4, 2021, 7:29am UTC](https://discourse.julialang.org/t/map-performance-with-cuarrays/33497 "2021-01-04T07:29:48Z")

</div>

I’m trying to benchmark different methods of calling the same in-place function on subsets of a large data block using CuArrays. I’m using fft as an example function because I can baseline against planning an fft over on…

---

## [Sum is very slow (and I can't figure out why)](https://discourse.julialang.org/t/sum-is-very-slow-and-i-cant-figure-out-why/52791)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 4\
**Last updated:** [January 4, 2021, 7:25am UTC](https://discourse.julialang.org/t/sum-is-very-slow-and-i-cant-figure-out-why/52791 "2021-01-04T07:25:42Z")

</div>

Hi, I’m building up a Monte Carlo code in CUDA that, as intermediate steps, needs to perform sums of several thousand Floats. The fact is that the numbers are produced by a function V(r,dip) where r is vector of floats …

---

## [CUDA does not successfully initialise](https://discourse.julialang.org/t/cuda-does-not-successfully-initialise/52661)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 2\
**Last updated:** [January 4, 2021, 7:20am UTC](https://discourse.julialang.org/t/cuda-does-not-successfully-initialise/52661 "2021-01-04T07:20:24Z")

</div>

I installed CUDA by \]add CUDA and tried to test it by test CUDA. However, I encountered the below error message. CUDA initialisation error ERROR: LoadError: CUDA.jl did not successfully initialize, and is not usable. I…

---

## [Create a simple CUDA.sum kernel](https://discourse.julialang.org/t/create-a-simple-cuda-sum-kernel/52797)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 3\
**Last updated:** [January 3, 2021, 10:09pm UTC](https://discourse.julialang.org/t/create-a-simple-cuda-sum-kernel/52797 "2021-01-03T22:09:23Z")

</div>

Hi again, as you can see, I’m trying to understand some basic CUDA kernel programming under julia, so please try not to be too rough with me… :slight\_smile: This time I want to build up a kernel that takes a bunch of …

---

## [Best route for academic purchases of current-gen GPU components (non data-center parts)](https://discourse.julialang.org/t/best-route-for-academic-purchases-of-current-gen-gpu-components-non-data-center-parts/52539)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 1\
**Last updated:** [December 29, 2020, 11:31am UTC](https://discourse.julialang.org/t/best-route-for-academic-purchases-of-current-gen-gpu-components-non-data-center-parts/52539 "2020-12-29T11:31:18Z")

</div>

Our procurement people use KFS to order this kind of stuff via purchase-orders on cdw, newegg, etc. Needless to say current-gen components (stuff like RTX 3xxx cards) are extremely hard to find at these outlets because …

---

## [ERROR: LoadError: CUDNNError: CUDNN\_STATUS\_EXECUTION\_FAILED (code 8)](https://discourse.julialang.org/t/error-loaderror-cudnnerror-cudnn-status-execution-failed-code-8/52528)

<div class="topic-metadata">

**Author:** [@vkv](https://discourse.julialang.org/u/vkv)\
**Replies:** 0\
**Last updated:** [December 28, 2020, 6:35pm UTC](https://discourse.julialang.org/t/error-loaderror-cudnnerror-cudnn-status-execution-failed-code-8/52528 "2020-12-28T18:35:23Z")

</div>

I’m not able to get this code running on a GPU, but it works on CPU. I’ve tried different versions of CUDA, Nvidia drivers and Julia versions. Every time it ended up with the same error. As the code runs, the memory cons…

---

## [Is it possible to use @static to distinguish CPU or GPU call in CUDA?](https://discourse.julialang.org/t/is-it-possible-to-use-static-to-distinguish-cpu-or-gpu-call-in-cuda/52366)

<div class="topic-metadata">

**Author:** [@HaoxuanGuo](https://discourse.julialang.org/u/HaoxuanGuo)\
**Replies:** 2\
**Last updated:** [December 26, 2020, 7:37am UTC](https://discourse.julialang.org/t/is-it-possible-to-use-static-to-distinguish-cpu-or-gpu-call-in-cuda/52366 "2020-12-26T07:37:38Z")

</div>

As we all know, some codes can not run on GPU. But there will be some alternative way to solve it. For example, sqrt can not run on GPU due to a \_fpow error. But CUDA.sqrt is an alternative solution. In this condition, …

---

## [CUDA.jl vs. ArrayFire.jl on Windows 10 VM running on VMWare VSphere](https://discourse.julialang.org/t/cuda-jl-vs-arrayfire-jl-on-windows-10-vm-running-on-vmware-vsphere/52078)

<div class="topic-metadata">

**Author:** [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Replies:** 1\
**Last updated:** [December 23, 2020, 4:27pm UTC](https://discourse.julialang.org/t/cuda-jl-vs-arrayfire-jl-on-windows-10-vm-running-on-vmware-vsphere/52078 "2020-12-23T16:27:29Z")

</div>

We need to speed up some double-precision calculations that are mainly just complex array calculations and FFT/IFFT. We were using NVIDIA Geforce RTX 2080 Ti on a PC and the speedup vs CPU is very good but not sufficient…

---

## [Mapreduce of Softmax-ed array can't be differentiated on GPU](https://discourse.julialang.org/t/mapreduce-of-softmax-ed-array-cant-be-differentiated-on-gpu/52013)

<div class="topic-metadata">

**Author:** [@kmaile](https://discourse.julialang.org/u/kmaile)\
**Replies:** 0\
**Last updated:** [December 17, 2020, 10:40pm UTC](https://discourse.julialang.org/t/mapreduce-of-softmax-ed-array-cant-be-differentiated-on-gpu/52013 "2020-12-17T22:40:11Z")

</div>

In an MWE of my use case below, I am trying to output a softmax-weighted sum of multiple layers on the same input. The output needs to be differentiable with respect to both the weights within the layers as well as the s…

---

## [Efficient and CuArray compatible implementation of \`StatsBase.\_compute\_extrema\`](https://discourse.julialang.org/t/efficient-and-cuarray-compatible-implementation-of-statsbase-compute-extrema/51671)

<div class="topic-metadata">

**Author:** [@sdewaele](https://discourse.julialang.org/u/sdewaele)\
**Replies:** 5\
**Last updated:** [December 17, 2020, 8:25pm UTC](https://discourse.julialang.org/t/efficient-and-cuarray-compatible-implementation-of-statsbase-compute-extrema/51671 "2020-12-17T20:25:10Z")

</div>

For this PR to StatsBase.jl, I am looking for a way to compute extrema that is both efficient for regular arrays and CuArrays. This implementation is efficient for regular arrays: function \_compute\_extrema\_A(X; dims) …

---

## [Fast CNN inference](https://discourse.julialang.org/t/fast-cnn-inference/51761)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 3\
**Last updated:** [December 14, 2020, 8:01am UTC](https://discourse.julialang.org/t/fast-cnn-inference/51761 "2020-12-14T08:01:22Z")

</div>

Hi, I’m currently using Knet and Flux for doing alphazero like calculations. As the botlleneck is the many inferences needed i was wondering if it would be possible to wrap TensorRT like https://github.com/zerollzeng/ti…

---

## [AMDGPU install errors](https://discourse.julialang.org/t/amdgpu-install-errors/51492)

<div class="topic-metadata">

**Author:** [@saltchunkmary](https://discourse.julialang.org/u/saltchunkmary)\
**Replies:** 12\
**Last updated:** [December 13, 2020, 1:25pm UTC](https://discourse.julialang.org/t/amdgpu-install-errors/51492 "2020-12-13T13:25:59Z")

</div>

Hi, first time poster here… not that that means anything… in need of a little help. Whilst building AMDGPU I am getting errors as below: ┌ Error: Error building AMDGPU: │ WARNING: redefinition of constant config\_path.…

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

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