# OpenCL Support For NVidia and AMD GPUs?



## fr33bsd (Aug 20, 2021)

Hi people,

does FreeBSD 13 provide OpenCL support for NVidia and AMD GPUs?


----------



## monwarez (Aug 22, 2021)

For AMD GPUs, there is lang/clover but since I don't own an AMD GPU I cannot test it.

For NVidia GPUs it is up to them to port their driver, you can see on their forums people asking to implement certain function.









						CUDA and /(nv_(un|)register|os_(un|)lock)_user_pages/
					

Please, consider implementing nv_register_user_pages/nv_unregister_user_pages/os_lock_user_pages/os_unlock_user_pages in the FreeBSD driver. Those functions are apparently being called on CUDA initialization and that’s the bit that prevents CUDA from working on FreeBSD. Well, at least as far as...




					forums.developer.nvidia.com


----------



## Vull (Aug 22, 2021)

I was able to get this working with clover on my AMD APU with Radeon graphics, and there seems to be support for some, but not all, other AMD chipsets. Here are a couple of related threads:

Thread segmentation-fault-gpu.78825

Thread using-opencl-on-freebsd.81451


----------



## shkhln (Aug 22, 2021)

monwarez said:


> For NVidia GPUs it is up to them to port their driver, you can see on their forums people asking to implement certain function.


Asking to implement it _upstream_ — it's not that difficult to DIY, but putting a complex patch it in the x11/nvidia-driver port is a bit too risky, the maintainer will never agree to it.


----------

