<p>Double-precision operations have been a requirement of desktop OpenGL and GLSL since 4.0. GPUs don't &quot;emulate&quot; double precision, but that doesn't mean they operate at full-speed either. As with most things, Vulkan is a bit more fine-grained, as SPIR-V requires you to use the <code>Float64</code> if you want to use them, and the implementation must support the <code>shaderFloat64</code> feature.</p>

CC BY-SA 4.0
2023-04-29T10:24:39.883Z
So the program would run on any machine which supports opengl 4.0
Thomas
CC BY-SA 4.0
2023-04-29T00:18:41.177Z
2023-04-29T00:18:41.177Z
Nicol Bolas
<p>For scientific reasons, we have to use doubles in our shaders. We don't need to talk about trying to store data in floating point numbers and so on.
I know there is special GPU hardware for double precision to work faster than on regular GPUs.</p>
<p>We are writing some GPU based software that should work for standard GPUs (2015 - now).
Do OpenGL, Vulkan, CUDA and OpenCL support double precision?
In the case of using a GPU that is not designed to use doubles, do the APIs emulate them?
So would such software work on these hardware systems?</p>

CC BY-SA 4.0
2023-04-28T12:56:25.760Z
GLSL supports doubles in the language to check hardware support in OpenGL look up  the "GL_ARB_gpu_shader_fp64" extension. To check hardware support in Vulkan check the physical device limits `VkPhysicalDeviceProperties deviceProperties.limits.shaderDoublePrecision` Support is generally binary. If you do run into a driver that is somehow emulating doubles the performance will be blatantly clear.
pmw1234
CC BY-SA 4.0
2023-04-28T19:39:19.873Z
@YvesDaoust the doubles are used for physical accuracy... Not for displaying.
Thomas
CC BY-SA 4.0
2023-04-28T21:35:44.500Z
Why even debate the efficacy of existing functionality? The question is about if it is supported, which it is.
pmw1234
CC BY-SA 4.0
2023-04-29T10:21:26.553Z
GPU's are used for more then just generating pixel colors. Scientific applications can/should take advantage of all that floating point power and they often require high precision to get reasonable results. Take a look at the "Frontier" super computer, at ~1.7 *exaflops* it uses GPU's to generate all that floating point power.
pmw1234
<precision>
Graphics API and double precision
Thomas
# Graphics API and double precision

(Asked by: username_0 on 2023-04-28)

For scientific reasons, we have to use doubles in our shaders. We don't need to talk about trying to store data in floating point numbers and so on.
I know there is special GPU hardware for double precision to work faster than on regular GPUs.

We are writing some GPU based software that should work for standard GPUs (2015 - now).
Do OpenGL, Vulkan, CUDA and OpenCL support double precision?
In the case of using a GPU that is not designed to use doubles, do the APIs emulate them?
So would such software work on these hardware systems?

**Tags:** precision

> **Comments:**
> **username_1**: GLSL supports doubles in the language to check hardware support in OpenGL look up  the "GL_ARB_gpu_shader_fp64" extension. To check hardware support in Vulkan check the physical device limits `VkPhysicalDeviceProperties deviceProperties.limits.shaderDoublePrecision` Support is generally binary. If you do run into a driver that is somehow emulating doubles the performance will be blatantly clear.  
> **username_0**: @YvesDaoust the doubles are used for physical accuracy... Not for displaying.  
> **username_1**: Why even debate the efficacy of existing functionality? The question is about if it is supported, which it is.  
> **username_1**: GPU's are used for more then just generating pixel colors. Scientific applications can/should take advantage of all that floating point power and they often require high precision to get reasonable results. Take a look at the "Frontier" super computer, at ~1.7 *exaflops* it uses GPU's to generate all that floating point power.  

---

## 1 answers

### Answer by username_2 on 2023-04-29. Score: 2 | Accepted answer

Double-precision operations have been a requirement of desktop OpenGL and GLSL since 4.0. GPUs don't "emulate" double precision, but that doesn't mean they operate at full-speed either. As with most things, Vulkan is a bit more fine-grained, as SPIR-V requires you to use the `Float64` if you want to use them, and the implementation must support the `shaderFloat64` feature.

> **Comments:**
> **username_0**: So the program would run on any machine which supports opengl 4.0  

---

