Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualsamoth

Posted 23 November 2012 - 06:29 AM

So CUDA and Compute Shader are two different things (hardware)? But both are GPGPU technologies?

No, and yes. They generally both run on the same kind of hardware in your computer, the GPU. But that is only half of the truth.

CUDA ("Compute Unified Device Architecture") is not really a GPU API. It is vNidia's API/architecture for running compute tasks (whatever they are) on nVidia devices (whatever they are). This includes GPUs, but it also includes e.g. non-GPU Tesla racks. CUDA is also the backbone of OpenCL on nVidia cards (OpenCL on nVidia is secretly transformed into CUDA by the compiler) much like Cg is the backbone for OpenGL shaders on nVidia.

OpenGL 4 compute shader functionality and its DirectX counterpart are likely also secretly transformed into CUDA on nVidia systems. This is not documented anywhere, but it's my bet that this is just what happens (it's at least plausible). These are a vendor-independent compute task (not graphics!) API built into the DirectX and OpenGL graphics APIs. They are not required to, but factually use the same hardware (shader units in the GPU) as the graphics pipeline.

Maybe CUDA uses the same SMs as Compute Shader but it is approched differently in software?

That's true, it uses the exact same shader units on the same GPU(s), just with a different API and language (though in reality it's still a bit more complicated, as the driver config panel lets you dedicate GPUs for graphics and for compute tasks, so if you have more than one card and dedicate one to compute tasks, it may be "generally the same" but "factually different ones").

OpenCL (first mentioned by Bacterius above) is a different beast insofar as it has a greatly different design philosophy. Incidentially, it runs on the GPU on your computer too, but that is not necessarily so.

OpenCL is a framework for running compute tasks on "some hardware". It is not exactly specified what that hardware is, or even whether it is homogenous. For example, it is in principle entirely allowable to have tasks run on the CPU, the GPU, or a special "accelerator card". Or, a combination of these, all at the same time.

So much for the theory. In practice, OpenCL runs on your graphics card if you have a nVidia or AMD/ATI graphics card in your computer, and on the CPU otherwise, if you're lucky (or, not at all). And if you want to share objects (e.g. images) between OpenCL and OpenGL without doing an explicit round-trip, you must create the CL context from a valid GL context, which necessarily means they run on the same GPU.

AMD has released a SSE-accelerated CPU implementation of OpenCL as part of their computing SDK some years ago, and Intel has been talking about it, though I've never seen it being real (did they release something in the mean time?). Those are in any case not normally present on an end-user computer, though.

PhysX, as already explained above, is a totally different thing. As the name gives away, it does "physics" (such as simulating rigid bodies), it does not do "general computation". Insofar it is something that's much more "high level".

#2samoth

Posted 23 November 2012 - 06:22 AM

So CUDA and Compute Shader are two different things (hardware)? But both are GPGPU technologies?

No, and yes. They generally both run on the same kind of hardware in your computer, the GPU. But that is only half of the truth.

CUDA ("Compute Unified Device Architecture") is not really a GPU API. It is vNidia's API/architecture for running compute tasks (whatever they are) on nVidia devices (whatever they are). This includes GPUs, but it also includes e.g. non-GPU Tesla racks. CUDA is also the backbone of OpenCL on nVidia cards (OpenCL on nVidia is secretly transformed into CUDA by the compiler) much like Cg is the backbone for OpenGL shaders on nVidia.

OpenGL 4 compute shader functionality and its DirectX counterpart are likely also secretly transformed into CUDA on nVidia systems. This is not documented anywhere, but it's my bet that this is just what happens (it's at least plausible). These are a vendor-independent compute task (not graphics!) API built into the DirectX and OpenGL graphics APIs. They are not required to, but factually use the same hardware (shader units in the GPU) as the graphics pipeline.

Maybe CUDA uses the same SMs as Compute Shader but it is approched differently in software?

That's true, it uses the exact same shader units on the same GPU(s), just with a different API and language (though in reality it's still a bit more complicated, as the driver config panel lets you dedicate GPUs for graphics and for compute tasks, so it may be "generally the same" but "factually different ones").

OpenCL (first mentioned by Bacterius above) is a different beast insofar as it has a greatly different design philosophy. Incidentially, it runs on the GPU on your computer too, but that is not necessarily so.

OpenCL is a framework for running compute tasks on "some hardware". It is not exactly specified what that hardware is, or even whether it is homogenous. For example, it is in principle entirely allowable to have tasks run on the CPU, the GPU, or a special "accelerator card". Or, a combination of these, all at the same time.

So much for the theory. In practice, OpenCL runs on your graphics card if you have a nVidia or AMD/ATI graphics card in your computer, and on the CPU otherwise, if you're lucky (or, not at all). And if you want to share objects (e.g. images) between OpenCL and OpenGL without doing an explicit round-trip, you must create the CL context from a valid GL context, which necessarily means they run on the same GPU.

AMD has released a SSE-accelerated CPU implementation of OpenCL as part of their computing SDK some years ago, and Intel has been talking about it, though I've never seen it being real (did they release something in the mean time?). Those are in any case not normally present on an end-user computer, though.

#1samoth

Posted 23 November 2012 - 06:21 AM

So CUDA and Compute Shader are two different things (hardware)? But both are GPGPU technologies?

No, and yes. They generally both run on the same kind of hardware in your computer, the GPU. But that is only half of the truth.

CUDA ("Compute Unified Device Architecture") is not really a GPU API. It is vNidia's API/architecture for running compute tasks (whatever they are) on nVidia devices (whatever they are). This includes GPUs, but it also includes e.g. non-GPU Tesla racks. CUDA is also the backbone of OpenCL on nVidia cards (OpenCL on nVidia is secretly transformed into CUDA by the compiler) much like Cg is the backbone for OpenGL shaders on nVidia.

OpenGL 4 compute shader functionality and its DirectX counterpart are likely also secretly transformed into CUDA on nVidia systems. This is not documented anywhere, but it's my bet that this is just what happens (it's at least plausible). These are a vendor-independent compute task (not graphics!) API built into the DirectX and OpenGL graphics APIs. They are not required to, but factually use the same hardware (shader units in the GPU) as the graphics pipeline.

Maybe CUDA uses the same SMs as Compute Shader but it is approched differently in software?

That's true, it uses the exact same shader units on the same GPU(s), just with a different API and language (though in reality it's still a bit more complicated, as the driver config panel lets you dedicate GPUs for graphics and for compute tasks, so it may be "generally the same" but "factually different ones").

OpenCL (first mentioned by Bacterius above) is a different beast insofar as it has a greatly different design philosophy. Incidentially, it runs on the GPU on your computer too, but that is not necessarily so.

OpenCL is a framework for running compute tasks on "some hardware". It is not exactly specified what that hardware is, or even whether it is homogenous. For example, it is in principle entirely allowable to have tasks run on the CPU, the GPU, or a special "accelerator card". Or, a combination of these, all at the same time.

So much for the theory. In practice, OpenCL runs on your graphics card if you have a nVidia or AMD/ATI graphics card in your computer, and on the CPU otherwise, if you're lucky (or, not at all). And if you want to share objects (e.g. images) between OpenCL and OpenGL without doing an explicit round-trip, you must create the CL context from a valid GL context, which necessarily means they run on the same GPU.

AMD has released a SSE-accelerated CPU implementation of OpenCL as part of their computing SDK some years ago, and Intel has been talking about it, though I've never seen it being real (did they release something in the mean time?). Those are in any case not normally present on an end-user computer, though.

PARTNERS