在Apple Silicon上进行GPGPU编程是否可能?

huangapple go评论68阅读模式
英文:

Is GPGPU programming on Apple Silicon possible?

问题

我正在学习计算机图形学,特别是OpenCL、OpenGL和Vulkan库。目前,我在一台装有Nvidia显卡的Windows 10机器上使用它们。

大部分的开发工作都会在那台机器上进行,但我想要购买一台新的MacBook Pro,用于个人事务,如财务等,偶尔也用它来开发一些GPGPU相关的内容。

我的目标是使我的代码尽可能具备跨平台能力,因为我使用的是OpenCL而不是CUDA等其他技术。

自从一段时间以来,苹果已经用他们自己的Apple Silicon芯片替换了他们计算机上的所有处理器。MacBook使用了M系列芯片。

在当前的Apple Silicon M系列芯片上是否可以使用这三个库?如果不行,有什么替代方案?

英文:

I'm in the process of learning computer graphics and in particular the OpenCL, OpenGL and Vulkan libraries. Currently, I use those on a Windows 10 machine with an Nvidia graphics card.

Most of the development will stay on that machine, but I would like to buy myself a new MacBook Pro, which I will use for personal stuff like finances etc. and occasionally use it to also develop some of the GPGPU stuff.

My aim is for my code to be as cross-platform capable as possible since I'm also using OpenCL instead of e.g. CUDA.

Apple has since a while now replaced all of the processors in their computers with their own Apple Silicon chips. The MacBooks use the M-Series chips.

Is it possible to use those three libraries on the current Apple Silicon M-Series chips? And if not, what are the alternatives?

答案1

得分: 3

OpenCL 和 OpenGL:

可用(它们可以工作),但已不再推荐使用(可能在未来更新中停止工作)。
苹果鼓励使用这些API的开发者切换到Metal(更低级,类似于Vulkan)或其他更高级的库。

Vulkan

不受官方支持,可以使用MoltenVK来将Vulkan调用转换为Metal。

本机API

苹果推动一切与GPU相关的事务都使用Metal,但也提供了其他更高级的框架,用于常见任务,这些任务利用GPU:

  • CoreML:用于机器学习任务的高级框架(从训练模型到在应用程序中使用它们)
  • SceneKit:用于2D和3D图形的高级框架(更像是一个图形引擎)

要利用CPU向量化,可以使用Accelerate框架。

目前,苹果似乎没有提供与OpenCL或CUDA完全相同的CPU和GPU上的同构计算框架。

英文:

OpenCL and OpenGL:

Available (they work) but deprecated (might stop working with future updates).
Apple encourages developers that use this APIs to switch to Metal (more low level, similar to Vulkan) or other higher level libraries.

Vulkan

Not officially supported, MoltenVK can be used to translate Vulkan calls to Metal.

Native APIs

Apple pushes for everything GPU related to use Metal, but also provides other higher level frameworks for common tasks that make use of the GPU:

  • CoreML: High level framework for machine learning tasks (from training models to using them in applications)
  • SceneKit: High level framework for 2D and 3D graphics (more like a graphics engine)

To exploit CPU vectorization the Accelerate framework can be used.

Right now Apple does not seem to offer a framework for homogeneous computing on CPU and GPU exactly like OpenCL or CUDA.

huangapple
  • 本文由 发表于 2023年6月19日 18:04:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/76505583.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定