AMD vs Nvidia GPUs, Clarification about OpenCL Support

After digging as deep as I can as a layman, I think that there is no OpenCL support available with Nvidia, and there are no workarounds at the moment (please someone correct me if I'm wrong).

So in order to use some graphics intensive programs to their full potential, I feel compelled to purchase and AMD GPU. However, I have some questions regarding this as well, as it doesn't seem to be entirely straightforward that I can expect proper OpenCL support for new AMD GPUs either. This comment makes me believe that Mesa should generically support OpenCL for even newer AMD GPUs, but at the same time raises doubts, as it describes ROCm being a replacement OpenCL driver for AMD GPUs but not ported to FreeBSD.

Given that GPU drivers seem to be a bit convoluted, especially in relation to FreeBSD, I'm not confident that if I go out and purchase an expensive AMD GPU (due to everyone and their mother trying to GPU mine crypto nowadays); that it will actually have the support I need to enable OpenCL, and thus the functionality that I'm missing.

I realize that I could just buy an older AMD GPU from say 2018 as a means of ensuring that I have proper support, but I would prefer just to get something that should be top of the line for quite a few years.
 
After digging as deep as I can as a layman, I think that there is no OpenCL support available with Nvidia, and there are no workarounds at the moment (please someone correct me if I'm wrong).

So in order to use some graphics intensive programs to their full potential, I feel compelled to purchase and AMD GPU. However, I have some questions regarding this as well, as it doesn't seem to be entirely straightforward that I can expect proper OpenCL support for new AMD GPUs either. This comment makes me believe that Mesa should generically support OpenCL for even newer AMD GPUs, but at the same time raises doubts, as it describes ROCm being a replacement OpenCL driver for AMD GPUs but not ported to FreeBSD.

Given that GPU drivers seem to be a bit convoluted, especially in relation to FreeBSD, I'm not confident that if I go out and purchase an expensive AMD GPU (due to everyone and their mother trying to GPU mine crypto nowadays); that it will actually have the support I need to enable OpenCL, and thus the functionality that I'm missing.

I realize that I could just buy an older AMD GPU from say 2018 as a means of ensuring that I have proper support, but I would prefer just to get something that should be top of the line for quite a few years.
NVidia cards support OpenCL no problem. clpeak is a shining example of that.
graphics/drm-kmod provides /boot/modules/amdgpu.ko, which is what you need to get going with an AMD GPU.
ROCm is not a 'driver' per se, but a whole graphics stack for GPU computing. Some parts work under FreeBSD, some don't. To get started with a 'driver' that supports at least running a GPU kernel, start here: .

Be prepared to blow at least of $500 USD at this point. I'm waiting for prices to come down. FWIW, my approach is to teach myself to squeeze performance out of what I have (Asus RX 550 4GB, a Polaris card that is supposedly enabled for ROCm, but not officially supported). By 'not officially supported', ROCm devs mean that they don't spend time testing the code on that card, as in, 'We have not tested it, but it's similar enough, so we expect it to work, somehow, at least'.
 
NVidia cards support OpenCL no problem. clpeak is a shining example of that.

IIRC Nvidia implements OpenCL through CUDA, which still isn't available on FreeBSD.

That's what I get when checking my systems with nvidia GPUs:
Code:
root@hati:~ # uname -a
FreeBSD hati 12.2-RELEASE-p3 FreeBSD 12.2-RELEASE-p3 GENERIC  amd64
root@hati:~ # nvidia-smi -L
GPU 0: GeForce GTX 960 (UUID: GPU-029a228a-7c27-2036-7747-297b406d1e97)
root@hati:~ # clpeak
clGetPlatformIDs (-1001)
no platforms found
root@hati:~ # clinfo
Number of platforms                               0

Code:
root@hal9000:~ # uname -a
FreeBSD hal9000 13.0-RELEASE-p2 FreeBSD 13.0-RELEASE-p2 GENERIC amd64
root@hal9000:~ # nvidia-smi -L
GPU 0: GeForce GT 710 (UUID: GPU-1fd00883-0126-63cd-a1db-cb49c60c0e08)
root@hal9000:~ # clpeak
clGetPlatformIDs (-1001)
no platforms found
root@hal9000:~ # clinfo
Number of platforms                               0

Both systems are using the nvidia-driver from packages and 'Driver = "nvidia"' is set in /usr/local/etc/X11/xorg.conf.d/nvidia.conf.

However you *should* be able to use the integrated GPU of an Intel CPU for OpenCL (and e.g. transcoding) while using the Nvidia for "everything else"/graphics output via the x11/nvidia-hybrid-graphics driver. I wanted to test this for a while now, but never found the time...
 
sko : do you have graphics/mesa-libs installed? If you do, what does glxinfo output? That should work for NVidia cards.

FWIW, CUDA is plenty available on FreeBSD - I use ports to compile stuff related to GPU acceleration, and I have to be careful to actually avoid having deps pull in anything CUDA-related. That's because I have an AMD GPU, not NVidia.
 
Code:
% pkg info | grep mesa
mesa-dri-20.2.3_2              OpenGL hardware acceleration drivers for DRI2+
mesa-libs-20.2.3_1             OpenGL libraries that support GLX and EGL clients
334 sko@hal9000:~ % glxinfo | grep -i cuda
335 sko@hal9000:~ % glxinfo | grep -i opencl
336 sko@hal9000:~ % glxinfo | grep -i opengl
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GT 710/PCIe/SSE2
OpenGL core profile version string: 4.5.0 NVIDIA 460.84
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.0 NVIDIA 460.84
OpenGL shading language version string: 4.50 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 460.84
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

And no, CUDA is not available on FreeBSD as it is still not implemented by the Nvidia driver yet:

also where is this "plenty cuda stuff" that should be available?
Code:
% pkg search cuda
cudatext-gtk2-1.99.0_2         Cross-platform text editor, written in Lazarus
cudatext-qt5-1.99.0_2          Cross-platform text editor, written in Lazarus
 
As both you and I know, I caught you talking bullshit on this very topic a few times before. Please, stop.
I merely share my observations from trying to compile ports related to AMD GPU acceleration. And I'm not gonna drop $2500 on an RTX 3090 just to verify my claims.
Please reply and correct me if that's not the case. Besides, Nvidia's stuff has traditionally worked very well under FreeBSD, even better than AMD
 
Back
Top