# Mathematical calculations accelerated by GPU

**URL:** <https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607>\
**Category:** GPU\
**Tags:** question, hardware\
**Created:** [January 14, 2022, 11:25am UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607 "2022-01-14T11:25:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Minumsand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/minumsand/32/32533_2.png) [@Minumsand](https://discourse.julialang.org/u/Minumsand)\
**Post date:** [January 14, 2022, 11:25am UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/1 "2022-01-14T11:25:03Z")

</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 is **not my goal** , but **only** number crunching for mathematical calculations accelerated by a GPU in conjunction with Julia.

Such a PCI-Express graphic card with GPU should have which specifations as an absolute minimum for the mentioned number crunching?

What is your input for me regarding this?

Michael

---

<div class="post-metadata">

**Author:** ![KZiemian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kziemian/32/9020_2.png) [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Post date:** [January 14, 2022, 12:48pm UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/2 "2022-01-14T12:48:35Z")

</div>

I can only guide you to [_GPU programming in Julia_](https://www.youtube.com/watch?v=Hz9IMJuW5hU) workshop form JuliaCon 2021 for more information.

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [January 14, 2022, 2:08pm UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/3 "2022-01-14T14:08:18Z")

</div>

If you go with the recommendation of NVida & Cuda then you can choose from one of 100s of NVidia models

> **[CUDA GPUs - Compute Capability](https://developer.nvidia.com/cuda-gpus)**
>
> Explore your GPU compute capability and CUDA-enabled products.

[https://juliagpu.org/](https://juliagpu.org/)

Or for some applications

AMD’s ROCm

> **[GitHub - RadeonOpenCompute/ROCm: AMD ROCm™ Platform - GitHub Home](https://github.com/RadeonOpenCompute/ROCm#hardware-and-software-support)**
>
> AMD ROCm™ Platform - GitHub Home. Contribute to RadeonOpenCompute/ROCm development by creating an account on GitHub.

But even some integrated Intel GPUs can be used

[https://juliagpu.org/oneapi/](https://juliagpu.org/oneapi/)

on one of their supported cards

> **[GitHub - intel/compute-runtime: Intel® Graphics Compute Runtime for oneAPI...](https://github.com/intel/compute-runtime)**
>
> Intel® Graphics Compute Runtime for oneAPI Level Zero and OpenCL™ Driver - GitHub - intel/compute-runtime: Intel® Graphics Compute Runtime for oneAPI Level Zero and OpenCL™ Driver

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 14, 2022, 8:43pm UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/4 "2022-01-14T20:43:18Z")

</div>

I would suggest for example nvidia quadro rtx 2060 or gtx 1050. I have a much cheaper nvidia graphics card (Quadro P400) which works with Julia, but it is slower than the CPU and thats probably not what you want. De facto the choice is very small because most cards are sold out these days…  
The GTX 1050 might be the cheapest option that provides a significant acceleration compared to the CPU. But it also depends a lot on the amount of RAM needed for your problem and on the question which floating point size is needed.  
Also check: [CUDA Benchmarks - Geekbench Browser](https://browser.geekbench.com/cuda-benchmarks)

CUDA.jl currently also requires a CUDA-capable GPU with **compute capability 3.5** (Kepler) or higher, and an accompanying NVIDIA driver with support for **CUDA 10.1** or newer.

---

<div class="post-metadata">

**Author:** ![Minumsand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/minumsand/32/32533_2.png) [@Minumsand](https://discourse.julialang.org/u/Minumsand)\
**Post date:** [January 19, 2022, 8:14am UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/5 "2022-01-19T08:14:46Z")

</div>

> [@ufechner7](#):
>
> But it also depends a lot on the amount of RAM needed for your problem and on the question which floating point size is needed.

I am thinking about large numerical series and the calculations to get the values are only integer math.  
All four basic arithmetic operations are only done with integer numbers, and from the division results there will be only kept the integral values.  
How does this influence the decision which graphics card with which GPU is recommended?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 19, 2022, 6:36pm UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/6 "2022-01-19T18:36:51Z")

</div>

Integer operations are often slower than floating point operations on consumer grade GPUs:

> **[Forward looking GPU integer performance](https://forums.developer.nvidia.com/t/forward-looking-gpu-integer-performance/43553/2)**
>
> My hobby CUDA projects revolve around this topic so you gave me an excuse to post; \[url\]https://sites.google.com/site/cudapermutations/\[/url\] Yes 64 bit integer math is slow on consumer GPUs, but both of the above problems do a great deal of 64...

And 64 bit is a lot worse than 32 bit. Which size of integers do you need?

---

<div class="post-metadata">

**Author:** ![Minumsand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/minumsand/32/32533_2.png) [@Minumsand](https://discourse.julialang.org/u/Minumsand)\
**Post date:** [January 20, 2022, 8:50am UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/7 "2022-01-20T08:50:53Z")

</div>

> [@ufechner7](#):
>
> And 64 bit is a lot worse than 32 bit. Which size of integers do you need?

Thanks for providing that NVIDIA integer performance link 👍 !  
I need at least 32 bit for the size of integers in the calculation, but a bigger size would be much more interesting, so 64 bit integers are very tempting.

---

<div class="post-metadata">

**Author:** ![Minumsand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/minumsand/32/32533_2.png) [@Minumsand](https://discourse.julialang.org/u/Minumsand)\
**Post date:** [January 29, 2022, 9:03am UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/8 "2022-01-29T09:03:12Z")

</div>

> [@ufechner7](#):
>
> I would suggest for example nvidia quadro rtx 2060 or gtx 1050. I have a much cheaper nvidia graphics card (Quadro P400) which works with Julia, but it is slower than the CPU and thats probably not what you want.

Just for interest and if it’s not too private for you, the performance of the Quadro P400 did you compare against which CPU?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 29, 2022, 2:10pm UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/9 "2022-01-29T14:10:42Z")

</div>

Intel® Core™ i7-7700K CPU

---

<div class="post-metadata">

**Author:** ![Minumsand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/minumsand/32/32533_2.png) [@Minumsand](https://discourse.julialang.org/u/Minumsand)\
**Post date:** [January 29, 2022, 4:28pm UTC](https://discourse.julialang.org/t/mathematical-calculations-accelerated-by-gpu/74607/10 "2022-01-29T16:28:47Z")

</div>

Thanks, Uwe.  
My Desktop-PC has an Intel® Core™ i7-8700 CPU.

Regarding the graphics card, the nvidia quadro rtx 2060 is - at least at the moment - a little too pricy. I could get hold of a GeForce GTX 1650, but I have to look for two criteria you mentioned: the compute capability of that GTX 1650 and which CUDA version its driver supports.
