# GPU

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

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

**Page:** 22

---

## [CUDA.rand() returns duplicate columns](https://discourse.julialang.org/t/cuda-rand-returns-duplicate-columns/63993)

<div class="topic-metadata">

**Author:** [@jpdoane](https://discourse.julialang.org/u/jpdoane)\
**Replies:** 2\
**Last updated:** [July 3, 2021, 8:51pm UTC](https://discourse.julialang.org/t/cuda-rand-returns-duplicate-columns/63993 "2021-07-03T20:51:34Z")

</div>

CUDA.rand() appears to return duplicate columns of complex numbers: julia\> CUDA.rand(ComplexF32, 512, 3) 512×3 CuArray{ComplexF32, 2}: 0.831271+0.460309im 0.831271+0.460309im 0.831271+0.460309im 0.0160654+0.0647…

---

## [Status of math intrinsics](https://discourse.julialang.org/t/status-of-math-intrinsics/63990)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 1\
**Last updated:** [July 3, 2021, 3:35pm UTC](https://discourse.julialang.org/t/status-of-math-intrinsics/63990 "2021-07-03T15:35:29Z")

</div>

Hi all, I would like to understand what is the status of math functions in CUDA.jl. In particular: Is it neccesary to write CUDA.sin? It looks to me that this calls are converted automatically when code is executed on…

---

## [Help needed with CUDA](https://discourse.julialang.org/t/help-needed-with-cuda/63923)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 2\
**Last updated:** [July 2, 2021, 6:31am UTC](https://discourse.julialang.org/t/help-needed-with-cuda/63923 "2021-07-02T06:31:39Z")

</div>

“Oups I did it again”, but I don’t really know what. Suddenly CUDA won’t compile anymore. I got a warning message: WARNING: both ExprTools and LLVM export “parameters”; uses of it in module CUDA must be qualified and …

---

## [First CUDA Program- Addressing Scalar Indexing](https://discourse.julialang.org/t/first-cuda-program-addressing-scalar-indexing/63396)

<div class="topic-metadata">

**Author:** [@loki](https://discourse.julialang.org/u/loki)\
**Replies:** 5\
**Last updated:** [June 28, 2021, 5:50am UTC](https://discourse.julialang.org/t/first-cuda-program-addressing-scalar-indexing/63396 "2021-06-28T05:50:41Z")

</div>

Hello, I am trying to get my feet wet in the world of CUDA programming. I started with some CPU code that I previously written but have been having some trouble with Scalar Indexing slowing down the computation. The prob…

---

## [Writing GPU Shaders in Julia](https://discourse.julialang.org/t/writing-gpu-shaders-in-julia/60669)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 4\
**Last updated:** [June 25, 2021, 12:14pm UTC](https://discourse.julialang.org/t/writing-gpu-shaders-in-julia/60669 "2021-06-25T12:14:53Z")

</div>

I was going over the GLAbstraction tutorials to learn how do do simple animations on the GPU, and things work fairly well. One pain point, however, is that the shaders needs to be written in a special language, meaning …

---

## [GC hitting hard](https://discourse.julialang.org/t/gc-hitting-hard/63102)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 9\
**Last updated:** [June 24, 2021, 7:35am UTC](https://discourse.julialang.org/t/gc-hitting-hard/63102 "2021-06-24T07:35:29Z")

</div>

Hi, I have a complicated function that if i call it twice in row with the exact same arguments, the second call is 50% slower. The function calls many kernels that execute on the gpu. I noticed that one of the sub-func…

---

## [CUDA with IJulia results in unexpected errors](https://discourse.julialang.org/t/cuda-with-ijulia-results-in-unexpected-errors/56917)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 7\
**Last updated:** [June 18, 2021, 4:56pm UTC](https://discourse.julialang.org/t/cuda-with-ijulia-results-in-unexpected-errors/56917 "2021-06-18T16:56:33Z")

</div>

Hey, I’m observing a strange bug. The code base is quite large and therefore I couldn’t really break it down. But what I observe: Calling my complex function (4D CUDA Arrays, FFT) the first time, results in this error…

---

## [Errors while writing in CuDeviceArray buffers](https://discourse.julialang.org/t/errors-while-writing-in-cudevicearray-buffers/63131)

<div class="topic-metadata">

**Author:** [@koehlerson](https://discourse.julialang.org/u/koehlerson)\
**Replies:** 5\
**Last updated:** [June 18, 2021, 11:07am UTC](https://discourse.julialang.org/t/errors-while-writing-in-cudevicearray-buffers/63131 "2021-06-18T11:07:07Z")

</div>

I have some function which is called by my kernel function foo(F, material, state, buffer,fiber,family) grid = material.convexstrategy.grid grid\_F = material.convexstrategy.grid\_F 𝐠 = material.convexstrategy…

---

## [Atomic operations stop working when upgrading to CUDA.jl version 3.3](https://discourse.julialang.org/t/atomic-operations-stop-working-when-upgrading-to-cuda-jl-version-3-3/63041)

<div class="topic-metadata">

**Author:** [@gatocor](https://discourse.julialang.org/u/gatocor)\
**Replies:** 4\
**Last updated:** [June 17, 2021, 9:41am UTC](https://discourse.julialang.org/t/atomic-operations-stop-working-when-upgrading-to-cuda-jl-version-3-3/63041 "2021-06-17T09:41:58Z")

</div>

I am developing a library and using CUDA. Because of the new capabilities of CUDA 3.3, I decided to upgrate to Julia 1.6 and now all the test I run fail in kernels depending on atomic operations. I tried to make the mos…

---

## [Division for Int128 not defined on GPU](https://discourse.julialang.org/t/division-for-int128-not-defined-on-gpu/62797)

<div class="topic-metadata">

**Author:** [@1115](https://discourse.julialang.org/u/1115)\
**Replies:** 3\
**Last updated:** [June 14, 2021, 2:43pm UTC](https://discourse.julialang.org/t/division-for-int128-not-defined-on-gpu/62797 "2021-06-14T14:43:19Z")

</div>

Here is a MWE. julia\> using CUDA julia\> x = widen.(CuArray(rand(Int64, 10))) 10-element CuArray{Int128, 1}: 7760362279116003288 1887985077088633303 -4343813946050421943 -3266615630613073703 2140177075751050950 …

---

## [Cross product with CUDA.jl](https://discourse.julialang.org/t/cross-product-with-cuda-jl/62734)

<div class="topic-metadata">

**Author:** [@lodygaw](https://discourse.julialang.org/u/lodygaw)\
**Replies:** 2\
**Last updated:** [June 11, 2021, 4:31pm UTC](https://discourse.julialang.org/t/cross-product-with-cuda-jl/62734 "2021-06-11T16:31:53Z")

</div>

Hello, I am looking for the way to compute cross product on a GPU. Basically something similar to this: function cross(w::CuArray{Float32,1}, u::CuArray{Float32,1}, v::CuArray{Float32,1}) w\[1\] = u\[2\] \* v\[3\] - u\[3\] \* v…

---

## [Store graph adjacency lists on GPU](https://discourse.julialang.org/t/store-graph-adjacency-lists-on-gpu/62735)

<div class="topic-metadata">

**Author:** [@aswanthkrishna](https://discourse.julialang.org/u/aswanthkrishna)\
**Replies:** 0\
**Last updated:** [June 11, 2021, 12:43pm UTC](https://discourse.julialang.org/t/store-graph-adjacency-lists-on-gpu/62735 "2021-06-11T12:43:39Z")

</div>

I want to represent a adjacency list of a graph on GPU. I need to store the adjacency list and access neighbours of different nodes from the kernel efficiently. how can i do this? I am new to julia and CUDA. Any pointers…

---

## [GPUs for Neural ODEs](https://discourse.julialang.org/t/gpus-for-neural-odes/62697)

<div class="topic-metadata">

**Author:** [@quantiota](https://discourse.julialang.org/u/quantiota)\
**Replies:** 2\
**Last updated:** [June 10, 2021, 10:28pm UTC](https://discourse.julialang.org/t/gpus-for-neural-odes/62697 "2021-06-10T22:28:04Z")

</div>

Hey I am building a GPU server, I have the possibility to buy 8 tesla k80 GDDR5 24GB for $300 each. Is it good for training a Neural ODE Network. Thanks

---

## [CUDA.jl finds CUDA installation but cannot execute any commands](https://discourse.julialang.org/t/cuda-jl-finds-cuda-installation-but-cannot-execute-any-commands/62368)

<div class="topic-metadata">

**Author:** [@crinders](https://discourse.julialang.org/u/crinders)\
**Replies:** 4\
**Last updated:** [June 4, 2021, 1:21pm UTC](https://discourse.julialang.org/t/cuda-jl-finds-cuda-installation-but-cannot-execute-any-commands/62368 "2021-06-04T13:21:29Z")

</div>

I have installed CUDA.jl . I have checked with JULIA\_DEBUG=CUDA and CUDA.version() that indeed the local CUDA install is being used. But to my chagrin, not even the most simple code works: julia\> using CUDA julia\> CUDA.…

---

## [Parallel prefix sum with CUDA.jl](https://discourse.julialang.org/t/parallel-prefix-sum-with-cuda-jl/62316)

<div class="topic-metadata">

**Author:** [@adam246](https://discourse.julialang.org/u/adam246)\
**Replies:** 2\
**Last updated:** [June 3, 2021, 12:08pm UTC](https://discourse.julialang.org/t/parallel-prefix-sum-with-cuda-jl/62316 "2021-06-03T12:08:24Z")

</div>

Is there a “parallel prefix sum” function implemented in CUDA.jl? If not, I’d offer to write one, but am relatively new to Julia and would need some examples/documentation on how to do that.

---

## [Help us understand our users!](https://discourse.julialang.org/t/help-us-understand-our-users/61932)

<div class="topic-metadata">

**Author:** [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Replies:** 11\
**Last updated:** [May 31, 2021, 2:26pm UTC](https://discourse.julialang.org/t/help-us-understand-our-users/61932 "2021-05-31T14:26:12Z")

</div>

Hi all! Once every while we need to pitch Julia’s GPU programming capabilities with vendors like NVIDIA. Doing so with technical arguments is easy enough, but companies are more easily convinced by an overview of note…

---

## [AlphaGPU: an alphazero implementation wholly on gpu](https://discourse.julialang.org/t/alphagpu-an-alphazero-implementation-wholly-on-gpu/60030)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 11\
**Last updated:** [May 28, 2021, 4:46pm UTC](https://discourse.julialang.org/t/alphagpu-an-alphazero-implementation-wholly-on-gpu/60030 "2021-05-28T16:46:33Z")

</div>

For those interested i made a fully cuda implementation of alphazero for connect 4. It can train a network to a very strong level in 2 to 3 hours on a single GPU, thanks to being able to play 32000 games in parallel. I…

---

## [Trying to understand the use of shared memory on GPUs](https://discourse.julialang.org/t/trying-to-understand-the-use-of-shared-memory-on-gpus/61240)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 3\
**Last updated:** [May 25, 2021, 5:47am UTC](https://discourse.julialang.org/t/trying-to-understand-the-use-of-shared-memory-on-gpus/61240 "2021-05-25T05:47:38Z")

</div>

Hi, I’m trying to learn how to use shared memory on the GPU by following the very nice write-up in https://jenni-westoby.github.io/Julia\_GPU\_examples/dev/Vector\_dot\_product/ however, I fail to understand basic things …

---

## [Extracting dense submatrix from sparse matrix](https://discourse.julialang.org/t/extracting-dense-submatrix-from-sparse-matrix/61242)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 2\
**Last updated:** [May 17, 2021, 10:50pm UTC](https://discourse.julialang.org/t/extracting-dense-submatrix-from-sparse-matrix/61242 "2021-05-17T22:50:19Z")

</div>

Hi, I’m new to GPU programming in general and julia-GPU in specific. So sorry if my question turns out to be naive. I have a largish sparse matrix; given a sorted array of indices I need to extract the corresponding sub…

---

## [How do I to transform mapreduce function to work well with CUDA?](https://discourse.julialang.org/t/how-do-i-to-transform-mapreduce-function-to-work-well-with-cuda/61084)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 5\
**Last updated:** [May 14, 2021, 9:00pm UTC](https://discourse.julialang.org/t/how-do-i-to-transform-mapreduce-function-to-work-well-with-cuda/61084 "2021-05-14T21:00:00Z")

</div>

Hellos I’m playing with CUDA.jl, and I just wish to perform a mapreduce faster. Here a minimal code: using CUDA using LinearAlgebra x = 100 N = ((x^2)÷2 - x÷2) n\_hat = rand(3) A = rand(3,N) b = rand(N) for p=1:10 …

---

## [Combine CartesianIndices for effective CUDA kernels](https://discourse.julialang.org/t/combine-cartesianindices-for-effective-cuda-kernels/60958)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 4\
**Last updated:** [May 11, 2021, 5:30pm UTC](https://discourse.julialang.org/t/combine-cartesianindices-for-effective-cuda-kernels/60958 "2021-05-11T17:30:46Z")

</div>

Suppose, I have a multidimensional array and I want to perform some operation along one of its axes. A sample generic code can look like this: s = (1, 2, 3, 4, 5) # shape of the array dim = 3 # dimension, along whic…

---

## [Dot-product of CuArray views is slow](https://discourse.julialang.org/t/dot-product-of-cuarray-views-is-slow/60953)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 10\
**Last updated:** [May 11, 2021, 4:37pm UTC](https://discourse.julialang.org/t/dot-product-of-cuarray-views-is-slow/60953 "2021-05-11T16:37:15Z")

</div>

I have fairly simple function that iterates over the columns of a 2-dimensional CuArray , takes inner products of these columns and writes them to another matrix. I noticed that running this code on the GPU gave no speed…

---

## [Memory is not freed with CUDA and two REPLs](https://discourse.julialang.org/t/memory-is-not-freed-with-cuda-and-two-repls/60706)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 8\
**Last updated:** [May 7, 2021, 5:03pm UTC](https://discourse.julialang.org/t/memory-is-not-freed-with-cuda-and-two-repls/60706 "2021-05-07T17:03:02Z")

</div>

Hey, I observed that on Julia 1.6.1 and CUDA 3.1.0 (and 2.6.3), I’m accumulating memory (with point wise multiplications) that I can only free when I close the REPL. I also track usage with nvidia-smi and initially ìt …

---

## [Need help with CUDA.jl installation](https://discourse.julialang.org/t/need-help-with-cuda-jl-installation/52786)

<div class="topic-metadata">

**Author:** [@maxfreu](https://discourse.julialang.org/u/maxfreu)\
**Replies:** 4\
**Last updated:** [May 10, 2021, 3:52pm UTC](https://discourse.julialang.org/t/need-help-with-cuda-jl-installation/52786 "2021-05-10T15:52:22Z")

</div>

Hi everybody! I had CUDA.jl installed and nicely running past summer, but somehow goofed it up (driver/cuda update?). It is probably not directly related to CUDA.jl. I crawled dmesg for errors, rebooted and nvidia-smi wo…

---

## [GPU on Macs?](https://discourse.julialang.org/t/gpu-on-macs/60732)

<div class="topic-metadata">

**Author:** [@Jojo\_Dad](https://discourse.julialang.org/u/Jojo_Dad)\
**Replies:** 4\
**Last updated:** [May 8, 2021, 2:13pm UTC](https://discourse.julialang.org/t/gpu-on-macs/60732 "2021-05-08T14:13:34Z")

</div>

Is there any Julia GPU support on Macs?

---

## [CUDNNError: CUDNN\_STATUS\_NOT\_INITIALIZED (code 1) during Pkg.test("CUDA")](https://discourse.julialang.org/t/cudnnerror-cudnn-status-not-initialized-code-1-during-pkg-test-cuda/60431)

<div class="topic-metadata">

**Author:** [@pfarndt](https://discourse.julialang.org/u/pfarndt)\
**Replies:** 5\
**Last updated:** [May 6, 2021, 2:37pm UTC](https://discourse.julialang.org/t/cudnnerror-cudnn-status-not-initialized-code-1-during-pkg-test-cuda/60431 "2021-05-06T14:37:38Z")

</div>

Using Julia v1.6.1 I get several error during testing the CUDA package (v3.1.0). Most of them go back to CUDNNError: CUDNN\_STATUS\_NOT\_INITIALIZED (code 1) - more details below. The corresponding test runs through witho…

---

## [Continuous view of CuArray using CartesianIndices does not return native CuArray](https://discourse.julialang.org/t/continuous-view-of-cuarray-using-cartesianindices-does-not-return-native-cuarray/60428)

<div class="topic-metadata">

**Author:** [@jpdoane](https://discourse.julialang.org/u/jpdoane)\
**Replies:** 2\
**Last updated:** [May 4, 2021, 12:44pm UTC](https://discourse.julialang.org/t/continuous-view-of-cuarray-using-cartesianindices-does-not-return-native-cuarray/60428 "2021-05-04T12:44:14Z")

</div>

views of CuArrays generally return a native CuArray object if the underlying data is contiguous. However, the does not seem to be the case if views are formed using CartesianIndices. example: sz = (8,4,2,2) x = CUDA.ra…

---

## [Zygote errors on simple operations with Complex CUDA Arrays](https://discourse.julialang.org/t/zygote-errors-on-simple-operations-with-complex-cuda-arrays/60515)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 0\
**Last updated:** [May 4, 2021, 12:23pm UTC](https://discourse.julialang.org/t/zygote-errors-on-simple-operations-with-complex-cuda-arrays/60515 "2021-05-04T12:23:42Z")

</div>

Hey, I recently raised an issue on GitHub for Zygote because I fail to get Zygote differentiating code where I apply a simple function on a complex CUDA array. I’m using CUDA 3.1.0, Julia 1.6.1 and Zygote 0.6.10. It…

---

## [Result of mean() is different for CuArray vs. regular Int64 array](https://discourse.julialang.org/t/result-of-mean-is-different-for-cuarray-vs-regular-int64-array/60497)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 1\
**Last updated:** [May 4, 2021, 5:35am UTC](https://discourse.julialang.org/t/result-of-mean-is-different-for-cuarray-vs-regular-int64-array/60497 "2021-05-04T05:35:21Z")

</div>

mean() is returning different results for CuArray vs regular Int64 array. using CUDA using Statistics INT = rand(Int64, 100000000) CUDA\_INT = CuArray(INT) I get 7.086957573875891e14 for mean(INT) and -2.814992433201059…

---

## [CuArrays using @views+mul!+transpose+slicing](https://discourse.julialang.org/t/cuarrays-using-views-mul-transpose-slicing/60289)

<div class="topic-metadata">

**Author:** [@albheim](https://discourse.julialang.org/u/albheim)\
**Replies:** 4\
**Last updated:** [April 30, 2021, 11:13am UTC](https://discourse.julialang.org/t/cuarrays-using-views-mul-transpose-slicing/60289 "2021-04-30T11:13:31Z")

</div>

Hi, had a problem when using CuArrays for a specific operation. It is optimized for CPU and it would be nice if it worked with the same code on GPU so there was no need to dispatch specifically on it. a = cu(randn(10, 1…

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

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