# GPU

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

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

**Page:** 19

---

## [Matrix Exponential of GPU matrix](https://discourse.julialang.org/t/matrix-exponential-of-gpu-matrix/77228)

<div class="topic-metadata">

**Author:** [@Michael\_Birk](https://discourse.julialang.org/u/Michael_Birk)\
**Replies:** 2\
**Last updated:** [March 1, 2022, 3:13pm UTC](https://discourse.julialang.org/t/matrix-exponential-of-gpu-matrix/77228 "2022-03-01T15:13:21Z")

</div>

I am trying to calculate the matrix exponent of a matrix stored on the GPU (via CUDA), but I get the error: ERROR: ArgumentError: cannot take the CPU address of a CuArray{Float32, 2, CUDA. Mem.DeviceBuffer} Minimal …

---

## [CUDA doesn't work](https://discourse.julialang.org/t/cuda-doesnt-work/75596)

<div class="topic-metadata">

**Author:** [@vietanh.do](https://discourse.julialang.org/u/vietanh.do)\
**Replies:** 3\
**Last updated:** [February 24, 2022, 9:20am UTC](https://discourse.julialang.org/t/cuda-doesnt-work/75596 "2022-02-24T09:20:54Z")

</div>

Hi there. I want to train the data through GPU. CUDA.jl ist installed, but when I check the Cuda function like has\_cuda(), it returns false. I have done these following things: all the drivers and programms updated (C…

---

## [Passing CuArray to PyTorch Tensor](https://discourse.julialang.org/t/passing-cuarray-to-pytorch-tensor/23067)

<div class="topic-metadata">

**Author:** [@gdestouet](https://discourse.julialang.org/u/gdestouet)\
**Replies:** 7\
**Last updated:** [February 22, 2022, 12:01am UTC](https://discourse.julialang.org/t/passing-cuarray-to-pytorch-tensor/23067 "2022-02-22T00:01:37Z")

</div>

Hello everyone, I am actually using this to pass CuArrays to PyTorch Tensor : using PyCall tc = pyimport("torch") using CuArrays x=cu(randn(1024,1024)) @time tc.from\_numpy(Array(x)).cuda() 0.025017 seconds (62 alloca…

---

## [Limitation in Union types with CUDA.jl?](https://discourse.julialang.org/t/limitation-in-union-types-with-cuda-jl/76494)

<div class="topic-metadata">

**Author:** [@peremato](https://discourse.julialang.org/u/peremato)\
**Replies:** 12\
**Last updated:** [February 18, 2022, 12:40pm UTC](https://discourse.julialang.org/t/limitation-in-union-types-with-cuda-jl/76494 "2022-02-18T12:40:02Z")

</div>

I am trying to pass to a kernel a vector of Union type. It seems to work if I limit the number of types in the Union to 3, but using 4 it fails with unsupported call to an unknown function (call to gpu\_gc\_pool\_alloc). Th…

---

## [nVidia A100 vs RTX A6000 (what to choose)](https://discourse.julialang.org/t/nvidia-a100-vs-rtx-a6000-what-to-choose/76660)

<div class="topic-metadata">

**Author:** [@anon28281882](https://discourse.julialang.org/u/anon28281882)\
**Replies:** 0\
**Last updated:** [February 17, 2022, 11:55pm UTC](https://discourse.julialang.org/t/nvidia-a100-vs-rtx-a6000-what-to-choose/76660 "2022-02-17T23:55:11Z")

</div>

Hi, I have to make a choice for a VM (Virtual Machine). One is equipped with nVidia A100, the other with RTX A6000. I’d like to ask for an advice. Most of my planned use is Julia AI training on Linux (RHEL 8 / Ubuntu Fo…

---

## [Can you force CUDA to find an existing artifacts?](https://discourse.julialang.org/t/can-you-force-cuda-to-find-an-existing-artifacts/76575)

<div class="topic-metadata">

**Author:** [@jmair](https://discourse.julialang.org/u/jmair)\
**Replies:** 1\
**Last updated:** [February 17, 2022, 5:15pm UTC](https://discourse.julialang.org/t/can-you-force-cuda-to-find-an-existing-artifacts/76575 "2022-02-17T17:15:47Z")

</div>

I tend to jump around projects a lot, most of which need the CUDA package. Everytime I “add CUDA” to my project and then go to use it, it always seems to download a new artifact. Is there anyway to force CUDA to look for…

---

## [Random numbers in KernelAbstractions](https://discourse.julialang.org/t/random-numbers-in-kernelabstractions/76476)

<div class="topic-metadata">

**Author:** [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Replies:** 4\
**Last updated:** [February 15, 2022, 7:00pm UTC](https://discourse.julialang.org/t/random-numbers-in-kernelabstractions/76476 "2022-02-15T19:00:25Z")

</div>

Cuda has random numbers CUDA.rand(2) but I can’t see how/if I can create them inside a @kernel. I need x,y pairs in a specific range and x^2 + y^ \<= 1 I used just plain rand() and got ... resulted in invalid LLVM IR …

---

## [Could cuda.jl support @view in Kernel programming](https://discourse.julialang.org/t/could-cuda-jl-support-view-in-kernel-programming/76298)

<div class="topic-metadata">

**Author:** [@FkerYJ](https://discourse.julialang.org/u/FkerYJ)\
**Replies:** 1\
**Last updated:** [February 14, 2022, 7:09am UTC](https://discourse.julialang.org/t/could-cuda-jl-support-view-in-kernel-programming/76298 "2022-02-14T07:09:55Z")

</div>

Is it possible to create a new array by seting an offset parameter indicating how many bytes to add to the base array pointer? To achieve the function of view in Kernel programming

---

## [Profiling Julia CUDA code missing 'CUDA HW'](https://discourse.julialang.org/t/profiling-julia-cuda-code-missing-cuda-hw/76061)

<div class="topic-metadata">

**Author:** [@torrance](https://discourse.julialang.org/u/torrance)\
**Replies:** 7\
**Last updated:** [February 9, 2022, 9:46am UTC](https://discourse.julialang.org/t/profiling-julia-cuda-code-missing-cuda-hw/76061 "2022-02-09T09:46:17Z")

</div>

I’m attempting to profile a custom CUDA kernel using NVIDIA’s nsight-systems (ie. nsys), as recommended by the CUDA.jl project. nsys correctly gives me profiling results for nvcc compiled code, however when I run it aga…

---

## [Failed in test CUDA v3.8.0](https://discourse.julialang.org/t/failed-in-test-cuda-v3-8-0/75642)

<div class="topic-metadata">

**Author:** [@Jie](https://discourse.julialang.org/u/Jie)\
**Replies:** 8\
**Last updated:** [February 7, 2022, 1:17pm UTC](https://discourse.julialang.org/t/failed-in-test-cuda-v3-8-0/75642 "2022-02-07T13:17:13Z")

</div>

I have add CUDA. When I test CUDA, it failed Testing Running tests… ┌ Info: System information: │ CUDA toolkit 11.6, artifact installation │ NVIDIA driver 470.82.1, for CUDA 11.4 │ CUDA driver 11.6 │ │ Libraries: …

---

## [Reporting allocations per stream in multithread CUDA.jl application](https://discourse.julialang.org/t/reporting-allocations-per-stream-in-multithread-cuda-jl-application/75866)

<div class="topic-metadata">

**Author:** [@jpdoane](https://discourse.julialang.org/u/jpdoane)\
**Replies:** 1\
**Last updated:** [February 7, 2022, 9:50am UTC](https://discourse.julialang.org/t/reporting-allocations-per-stream-in-multithread-cuda-jl-application/75866 "2022-02-07T09:50:32Z")

</div>

Is there a reliable way to monitor CUDA.jl allocations for each stream in a multithreaded application? In trying to track down the source of some excessive allocations using @CUDA.time macros, I am seeing some operations…

---

## [CUDA AES implementation help: Parallelizing execution on Array{UInt8, 16} type inputs](https://discourse.julialang.org/t/cuda-aes-implementation-help-parallelizing-execution-on-array-uint8-16-type-inputs/75732)

<div class="topic-metadata">

**Author:** [@Nightshade\_Lemonade](https://discourse.julialang.org/u/Nightshade_Lemonade)\
**Replies:** 6\
**Last updated:** [February 3, 2022, 8:13pm UTC](https://discourse.julialang.org/t/cuda-aes-implementation-help-parallelizing-execution-on-array-uint8-16-type-inputs/75732 "2022-02-03T20:13:37Z")

</div>

I’m trying to do AES on the GPU. My latest attempt looks something like this: # AES has a similar function signature to this function blockAdd(b::Array{UInt8, 16})::Array{UInt8, 16} a = UInt8\[0 for i in 1:16\] fo…

---

## [FFT'ing lots of short vectors on GPU](https://discourse.julialang.org/t/ffting-lots-of-short-vectors-on-gpu/75529)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 3\
**Last updated:** [January 31, 2022, 9:28pm UTC](https://discourse.julialang.org/t/ffting-lots-of-short-vectors-on-gpu/75529 "2022-01-31T21:28:22Z")

</div>

I am wondering if there is a way to Fourier-transform lots of short vectors on GPU. I have more than 10,000 vectors. The lengths of all vectors are the same and around 2^12. Each vector is not long enough to get a sig…

---

## [Mathematical calculations accelerated by GPU](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607)

<div class="topic-metadata">

**Author:** [@Minumsand](https://discourse.julialang.org/u/Minumsand)\
**Replies:** 9\
**Last updated:** [January 29, 2022, 4:28pm UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607 "2022-01-29T16:28:47Z")

</div>

Hello dear GPU-interested Julia members Although I am still far away from being familiar enough with Julia, I am making plans to utilise a GPU for future number crunching. I want to underline: mining with graphic cards …

---

## [Computing QR decomposition many times in parallel](https://discourse.julialang.org/t/computing-qr-decomposition-many-times-in-parallel/75241)

<div class="topic-metadata">

**Author:** [@coviktor](https://discourse.julialang.org/u/coviktor)\
**Replies:** 2\
**Last updated:** [January 27, 2022, 4:53pm UTC](https://discourse.julialang.org/t/computing-qr-decomposition-many-times-in-parallel/75241 "2022-01-27T16:53:49Z")

</div>

I’m new to GPU programming and don’t understand many details. Let’s say I have 2 matrices A1 = CUDA.rand(1000,1000) A2 = CUDA.rand(1000,1000) and I would like to compute their QR decompositions on GPU in parallel (usin…

---

## [How to use ForwardDiff with CuArrays](https://discourse.julialang.org/t/how-to-use-forwarddiff-with-cuarrays/39542)

<div class="topic-metadata">

**Author:** [@clinton](https://discourse.julialang.org/u/clinton)\
**Replies:** 11\
**Last updated:** [January 26, 2022, 3:55am UTC](https://discourse.julialang.org/t/how-to-use-forwarddiff-with-cuarrays/39542 "2022-01-26T03:55:13Z")

</div>

I want to use CuArrays to accelerate a Jacobian calculation for a function \\Re^m \\mapsto \\Re^n where n\>\>m, which seems like a pretty good use case for ForwardDiff. I saw some usage of ForwardDiff in the tests for CuArray…

---

## [Monitoring GPU utilization and memory usage](https://discourse.julialang.org/t/monitoring-gpu-utilization-and-memory-usage/74958)

<div class="topic-metadata">

**Author:** [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Replies:** 2\
**Last updated:** [January 21, 2022, 8:05am UTC](https://discourse.julialang.org/t/monitoring-gpu-utilization-and-memory-usage/74958 "2022-01-21T08:05:25Z")

</div>

While training Flux models, I would like to monitor the (Nvidia) GPU utilization and memory usage. Is there an alternative to dump output from nvidia-smi to a file and read and plot the data in Julia?

---

## [Several questions about KernelAbstractions](https://discourse.julialang.org/t/several-questions-about-kernelabstractions/74740)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 6\
**Last updated:** [January 18, 2022, 7:54am UTC](https://discourse.julialang.org/t/several-questions-about-kernelabstractions/74740 "2022-01-18T07:54:55Z")

</div>

Hello, I have several questions about KernelAbstractions package: What is the current status of KernelAbstractions in the Julia GPU ecosystem? Is it being seen as an exploration package to try out some possible direc…

---

## [How to access device memory from the host whilst a kernel is running](https://discourse.julialang.org/t/how-to-access-device-memory-from-the-host-whilst-a-kernel-is-running/74472)

<div class="topic-metadata">

**Author:** [@johntrinder](https://discourse.julialang.org/u/johntrinder)\
**Replies:** 5\
**Last updated:** [January 12, 2022, 8:40am UTC](https://discourse.julialang.org/t/how-to-access-device-memory-from-the-host-whilst-a-kernel-is-running/74472 "2022-01-12T08:40:10Z")

</div>

I have allocated memory on the device and have passed it to a kernel function. Is it possible to read that memory from the host before the kernel finishes its execution? If it is possible could you please put me on the …

---

## [Julia: How to set and use CUDA/Host Global memory](https://discourse.julialang.org/t/julia-how-to-set-and-use-cuda-host-global-memory/74247)

<div class="topic-metadata">

**Author:** [@johntrinder](https://discourse.julialang.org/u/johntrinder)\
**Replies:** 3\
**Last updated:** [January 10, 2022, 5:42pm UTC](https://discourse.julialang.org/t/julia-how-to-set-and-use-cuda-host-global-memory/74247 "2022-01-10T17:42:35Z")

</div>

I want to poll a global flag inside of a kernel in CUDA so as to shut down the kernel gracefully via the Host. How do I set up a Global flag in the host (I have tried abort=CuArray(\[false\]) ) Do I pass ‘abort’ as an ar…

---

## [What are the "limitations" of CUDA.jl relative to CPU code and where are they rooted](https://discourse.julialang.org/t/what-are-the-limitations-of-cuda-jl-relative-to-cpu-code-and-where-are-they-rooted/74256)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 1\
**Last updated:** [January 9, 2022, 9:41pm UTC](https://discourse.julialang.org/t/what-are-the-limitations-of-cuda-jl-relative-to-cpu-code-and-where-are-they-rooted/74256 "2022-01-09T21:41:05Z")

</div>

Recently got my hands on an entry-level Nvidia GPU, so I started reading through the CUDA.jl docs and some related (and possibly outdated) articles. I definitely noticed that it can get very different from CPU code, and …

---

## [How to add CUDA as optional dependency?](https://discourse.julialang.org/t/how-to-add-cuda-as-optional-dependency/73077)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 19\
**Last updated:** [January 5, 2022, 3:44pm UTC](https://discourse.julialang.org/t/how-to-add-cuda-as-optional-dependency/73077 "2022-01-05T15:44:46Z")

</div>

Suppose I have a package and that I am interested in providing an option to end users to speed up their calculations in the presence of a NVIDIA GPU. Not everyone will benefit from this option and so I can’t add CUDA as …

---

## [CUDA on Julia 1.7 giving wrong results](https://discourse.julialang.org/t/cuda-on-julia-1-7-giving-wrong-results/73997)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 5\
**Last updated:** [January 3, 2022, 9:31pm UTC](https://discourse.julialang.org/t/cuda-on-julia-1-7-giving-wrong-results/73997 "2022-01-03T21:31:47Z")

</div>

Hi all, I have a fairly complex code that has worked well with julia 1.5 - 1.6. I have tried to run this with te latest julia 1.7, and the code runs, but produces wrong results. This is the list of packages used, in cas…

---

## [Flux "60 minute blitz" weird error when using GPU](https://discourse.julialang.org/t/flux-60-minute-blitz-weird-error-when-using-gpu/73537)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 10\
**Last updated:** [December 29, 2021, 8:58am UTC](https://discourse.julialang.org/t/flux-60-minute-blitz-weird-error-when-using-gpu/73537 "2021-12-29T08:58:26Z")

</div>

I’m running the following Flux code, which comes directly from the Flux “60 Minute Blitz” tutorial. I get a weird error when using the |\> gpu construct, but not when the code runs on the CPU. I’ve posted this as a bug to…

---

## [CUDA porting to shift-inverse eigenvalues](https://discourse.julialang.org/t/cuda-porting-to-shift-inverse-eigenvalues/73691)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 0\
**Last updated:** [December 28, 2021, 12:26am UTC](https://discourse.julialang.org/t/cuda-porting-to-shift-inverse-eigenvalues/73691 "2021-12-28T00:26:22Z")

</div>

The Arpack eigenvalues solver is very fast. With a 100000x100000 sparse matrix, I can get a few eigenvalues with the shift-invert method in 20-30 seconds approximately! Since I always want the best performances, I wonde…

---

## [Trying to understand CUDA benchmark](https://discourse.julialang.org/t/trying-to-understand-cuda-benchmark/73639)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.julialang.org/u/Jakub_Mitura)\
**Replies:** 1\
**Last updated:** [December 28, 2021, 8:33am UTC](https://discourse.julialang.org/t/trying-to-understand-cuda-benchmark/73639 "2021-12-28T08:33:30Z")

</div>

I am benchmarking my kernel that is relatively simple it iterates over 2 arrays of the same size and accumulates in local variables times both arrays agree or not warp reduction of local variables thread block reductio…

---

## [Simple Vulkan tutorial? Ideally integrated with CImGUI.jl](https://discourse.julialang.org/t/simple-vulkan-tutorial-ideally-integrated-with-cimgui-jl/73267)

<div class="topic-metadata">

**Author:** [@claforte](https://discourse.julialang.org/u/claforte)\
**Replies:** 1\
**Last updated:** [December 18, 2021, 6:36am UTC](https://discourse.julialang.org/t/simple-vulkan-tutorial-ideally-integrated-with-cimgui-jl/73267 "2021-12-18T06:36:31Z")

</div>

Is anyone aware of an existing tutorial that combines Vulkan.jl and ideally CImGUI.jl? If not, I might bite the bullet during the Christmas vacations and try to do it myself, and if so, keep posting to this discussion (i…

---

## [Weird error with CUDA.jl on Julia1.7. Cannot rewrite unknown use of function](https://discourse.julialang.org/t/weird-error-with-cuda-jl-on-julia1-7-cannot-rewrite-unknown-use-of-function/73183)

<div class="topic-metadata">

**Author:** [@Alexandre\_Chen](https://discourse.julialang.org/u/Alexandre_Chen)\
**Replies:** 2\
**Last updated:** [December 16, 2021, 10:45am UTC](https://discourse.julialang.org/t/weird-error-with-cuda-jl-on-julia1-7-cannot-rewrite-unknown-use-of-function/73183 "2021-12-16T10:45:36Z")

</div>

julia\> a = CuArray(randn(32,32)) 32×32 CuArray{Float64, 2, CUDA.Mem.DeviceBuffer}: -1.18274 0.255296 -0.638661 -0.360422 1.36684 1.33303 -0.0344325 -2.70717 0.781341 0.288144 0.0181823 …

---

## [Factorial on GPU](https://discourse.julialang.org/t/factorial-on-gpu/73116)

<div class="topic-metadata">

**Author:** [@jeremiedb](https://discourse.julialang.org/u/jeremiedb)\
**Replies:** 1\
**Last updated:** [December 15, 2021, 6:07am UTC](https://discourse.julialang.org/t/factorial-on-gpu/73116 "2021-12-15T06:07:23Z")

</div>

I wanted to perform a factorial calculation within a kernel for implementing a statistical measure (Poisson likelihood) on GPU, It turns out like factorial isn’t supported on GPU: using CUDA function gpu\_fac(y, x) …

---

## [CUDA Matrix inverse](https://discourse.julialang.org/t/cuda-matrix-inverse/53341)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 13\
**Last updated:** [December 7, 2021, 6:47am UTC](https://discourse.julialang.org/t/cuda-matrix-inverse/53341 "2021-12-07T06:47:23Z")

</div>

Hello! I try to inverse large matrix on GPU and try to use this code: using CUDA, LinearAlgebra function cuinv(m::Matrix{T}) where T if size(m, 1) != size(m, 2) throw(ArgumentError("Matrix not square.")) end A …

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

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