Discussion:
GPU programming?
(too old to reply)
Steve Kargl
2024-02-04 19:02:38 UTC
Permalink
Is anyone aware of work towards GPU programming on FreeBSD?

Here, I am not interested in using a GPU while playing a
video game or rendering graphics on a video monitor. I'm
interested in offloading single and double precision
floating-point computations to a GPU via OpenACC or OpenMP
(ala HPC).

Although using a high-end AMD Instinct MI300 would be great,
I'm looking for something a bit more affordable such as an
AMD RX 6700 XT. AFAICT, this may require either porting
AMD ROCm software to FreeBSD or running it under the
linuxlator.

https://www.amd.com/en/products/software/rocm.html
--
Steve


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
B. E.
2024-02-04 20:16:05 UTC
Permalink
gcc (and gfortran) has supported OpenMP for a very long time via their GOMP
(pthreads underneath), not sure about LLVM based support or offloading (via
the latest supported OpenMP specification) to accelerators on FreeBSD per
se. What are you looking for in terms of OS support?

Cheers,
Brett
Post by Steve Kargl
Is anyone aware of work towards GPU programming on FreeBSD?
Here, I am not interested in using a GPU while playing a
video game or rendering graphics on a video monitor. I'm
interested in offloading single and double precision
floating-point computations to a GPU via OpenACC or OpenMP
(ala HPC).
Although using a high-end AMD Instinct MI300 would be great,
I'm looking for something a bit more affordable such as an
AMD RX 6700 XT. AFAICT, this may require either porting
AMD ROCm software to FreeBSD or running it under the
linuxlator.
https://www.amd.com/en/products/software/rocm.html
--
Steve
B. E.
2024-02-05 02:06:20 UTC
Permalink
Sorry, I guess I was not clear on what you were asking. Maybe OpenCL (from
Kronos/OpenGL folks) is helpful. Good luck.

https://www.freshports.org/devel/opencl/

Cheers,
Brett
See the second paragraph of my initial post. AMD provides
ROCm and Nvidia supplies CUDA. These appear to be available
for Windows and Linux. Are there any software/hardware drivers
required to actually accomplish the offloading?
--
steve
Post by B. E.
gcc (and gfortran) has supported OpenMP for a very long time via their
GOMP
Post by B. E.
(pthreads underneath), not sure about LLVM based support or offloading
(via
Post by B. E.
the latest supported OpenMP specification) to accelerators on FreeBSD per
se. What are you looking for in terms of OS support?
Cheers,
Brett
On Sun, Feb 4, 2024 at 1:02 PM Steve Kargl <
Post by Steve Kargl
Is anyone aware of work towards GPU programming on FreeBSD?
Here, I am not interested in using a GPU while playing a
video game or rendering graphics on a video monitor. I'm
interested in offloading single and double precision
floating-point computations to a GPU via OpenACC or OpenMP
(ala HPC).
Although using a high-end AMD Instinct MI300 would be great,
I'm looking for something a bit more affordable such as an
AMD RX 6700 XT. AFAICT, this may require either porting
AMD ROCm software to FreeBSD or running it under the
linuxlator.
https://www.amd.com/en/products/software/rocm.html
--
Steve
--
Steve
Alexander Leidinger
2024-02-05 07:55:58 UTC
Permalink
See the second paragraph of my initial post. AMD provides
ROCm and Nvidia supplies CUDA. These appear to be available
for Windows and Linux. Are there any software/hardware drivers
required to actually accomplish the offloading?
CUDA: requires parts (at least some libs) from NVidia which are not
ported to FreeBSD. I have seen reports that at least parts of the linux
parts work in the linuxulator
(https://github.com/verm/freebsd-stable-diffusion). If you want to use a
FreeBSD system to do that, I would suggest to use a VM with linux and
give it raw access to the card. Not nice (from a FreeBSD side of
things), but most probably the most pragmatic solution to get all what
is needed in a easy way.

ROCm: No idea. I have not seen any report about it working or even being
tried. But there was at least some discussion about it:
https://github.com/ROCm/ROCm/issues/138
https://github.com/ROCm/ROCm/issues/1913

Intel: Maybe. We have spirv ports in the tree, and my limited
understanding is, that SPIR-V comes into play when someone wants to do
GPU compute there. CCing Jan as the port maintainer for the two spirv
ports. Maybe he can shed some light on this part.

Bye,
Alexander.
--
http://www.Leidinger.net ***@Leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org ***@FreeBSD.org : PGP 0x8F31830F9F2772BF
Steve Kargl
2024-02-05 17:09:31 UTC
Permalink
Post by Jan Beich
Post by Alexander Leidinger
ROCm: No idea. I have not seen any report about it working or even
https://github.com/ROCm/ROCm/issues/138
https://github.com/ROCm/ROCm/issues/1913
- ROCm requires amdkfd.ko which drm-kmod doesn't provide since
https://github.com/freebsd/drm-kmod/commit/a381f46adf8b
- ROCm has poor *consumer* GPU support thus unattractive for
volunteers/community to spend time porting
Post by Alexander Leidinger
Intel: Maybe. We have spirv ports in the tree, and my limited
understanding is, that SPIR-V comes into play when someone wants to do
GPU compute there. CCing Jan as the port maintainer for the two spirv
ports. Maybe he can shed some light on this part.
- Vulkan Compute works fine on every modern GPU (used at least by ncnn)
- OpenCL works fine on Intel + AMD via Rusticl (Mesa), see
https://cgit.freebsd.org/ports/commit/?id=d8990eff958b
- OpenCL + oneAPI Level Zero via lang/intel-compute-runtime requires userptr, see
https://github.com/FreeBSDDesktop/kms-drm/issues/197
As a volunteer I've burned out porting Intel stuff, so hopefully Rusticl
kills Intel NEO (intel-compute-runtime) while Vulkan Video kills VA-API
(libva-intel-media-driver) and QuickSyncVideo (intel-media-sdk + onevpl)
Related https://www.phoronix.com/news/David-Airlie-oneAPI-Meetup
Alexander, Jan,

Thanks for the info. I'll check out the various links.
This somewhat confirms my suspicion that little is being
done with scientific numerical GPU computing in the FreeBSD.
--
Steve


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mehmet Erol Sanliturk
2024-02-04 20:36:40 UTC
Permalink
On Sun, Feb 4, 2024 at 11:21 PM Steve Kargl <
Post by Steve Kargl
Is anyone aware of work towards GPU programming on FreeBSD?
Here, I am not interested in using a GPU while playing a
video game or rendering graphics on a video monitor. I'm
interested in offloading single and double precision
floating-point computations to a GPU via OpenACC or OpenMP
(ala HPC).
Although using a high-end AMD Instinct MI300 would be great,
I'm looking for something a bit more affordable such as an
AMD RX 6700 XT. AFAICT, this may require either porting
AMD ROCm software to FreeBSD or running it under the
linuxlator.
https://www.amd.com/en/products/software/rocm.html
--
Steve
If you search

GPU programming

in all of Github , you may get 1.8k results .


A Google search is also useful :

https://www.google.com/search?q=GPU+programming&sca_esv=8cd01c0eb9e4bd98&sxsrf=ACQVn0-hf1I29ds68J-H82jhzUaYKKBomw%3A1707078684290&source=hp&ei=HPS_ZaG-D-2_xc8Pne2tsAo&iflsig=ANes7DEAAAAAZcACLL5JyxgL0gJp1U0IaVFZYAR0N2hI&ved=0ahUKEwihvNDUw5KEAxXtX_EDHZ12C6YQ4dUDCA0&uact=5&oq=GPU+programming&gs_lp=Egdnd3Mtd2l6Ig9HUFUgcHJvZ3JhbW1pbmcyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAESLbOAVAAWMm9AXABeACQAQCYAZ4BoAGQDqoBBDAuMTa4AQPIAQD4AQHCAgoQIxiABBiKBRgnwgIEECMYJ8ICBRAuGIAE&sclient=gws-wiz
GPU programming


With my best wishes for all .


Mehmet Erol Sanliturk
Jan Beich
2024-02-05 11:17:57 UTC
Permalink
Post by Alexander Leidinger
ROCm: No idea. I have not seen any report about it working or even
https://github.com/ROCm/ROCm/issues/138
https://github.com/ROCm/ROCm/issues/1913
AFAIU (never owned an AMD GPU):
- ROCm requires amdkfd.ko which drm-kmod doesn't provide since
https://github.com/freebsd/drm-kmod/commit/a381f46adf8b
- ROCm has poor *consumer* GPU support thus unattractive for
volunteers/community to spend time porting
Post by Alexander Leidinger
Intel: Maybe. We have spirv ports in the tree, and my limited
understanding is, that SPIR-V comes into play when someone wants to do
GPU compute there. CCing Jan as the port maintainer for the two spirv
ports. Maybe he can shed some light on this part.
- Vulkan Compute works fine on every modern GPU (used at least by ncnn)
- OpenCL works fine on Intel + AMD via Rusticl (Mesa), see
https://cgit.freebsd.org/ports/commit/?id=d8990eff958b
- OpenCL + oneAPI Level Zero via lang/intel-compute-runtime requires userptr, see
https://github.com/FreeBSDDesktop/kms-drm/issues/197

As a volunteer I've burned out porting Intel stuff, so hopefully Rusticl
kills Intel NEO (intel-compute-runtime) while Vulkan Video kills VA-API
(libva-intel-media-driver) and QuickSyncVideo (intel-media-sdk + onevpl)

Related https://www.phoronix.com/news/David-Airlie-oneAPI-Meetup


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
B. E.
2024-02-06 00:29:50 UTC
Permalink
Not surprising since most academic HPCs and HPC-enabled clouds (Oracle,
Azure) are generally running some version of RHEL. The former is where the
largest GPU resources are available to most folks (e.g., TACC), as I am
sure you already know. OTOH, someone doing with FreeBSD is likely just
wanting it for a workstation or some single node, many-core server they
picked up cheap off of eBay or an e-cycler; (basically me, but I focus on
OpenMP and standard CPU SMP). If you're doing AI related things, then a lot
of sites are starting to spring up that sell GPU heavy single box builds,
but those are also assuming some kind of Linux.

Brett

On Mon, Feb 5, 2024 at 11:10 AM Steve Kargl <
Post by Jan Beich
Post by Jan Beich
Post by Alexander Leidinger
ROCm: No idea. I have not seen any report about it working or even
https://github.com/ROCm/ROCm/issues/138
https://github.com/ROCm/ROCm/issues/1913
- ROCm requires amdkfd.ko which drm-kmod doesn't provide since
https://github.com/freebsd/drm-kmod/commit/a381f46adf8b
- ROCm has poor *consumer* GPU support thus unattractive for
volunteers/community to spend time porting
Post by Alexander Leidinger
Intel: Maybe. We have spirv ports in the tree, and my limited
understanding is, that SPIR-V comes into play when someone wants to do
GPU compute there. CCing Jan as the port maintainer for the two spirv
ports. Maybe he can shed some light on this part.
- Vulkan Compute works fine on every modern GPU (used at least by ncnn)
- OpenCL works fine on Intel + AMD via Rusticl (Mesa), see
https://cgit.freebsd.org/ports/commit/?id=d8990eff958b
- OpenCL + oneAPI Level Zero via lang/intel-compute-runtime requires
userptr, see
Post by Jan Beich
https://github.com/FreeBSDDesktop/kms-drm/issues/197
As a volunteer I've burned out porting Intel stuff, so hopefully Rusticl
kills Intel NEO (intel-compute-runtime) while Vulkan Video kills VA-API
(libva-intel-media-driver) and QuickSyncVideo (intel-media-sdk + onevpl)
Related https://www.phoronix.com/news/David-Airlie-oneAPI-Meetup
Alexander, Jan,
Thanks for the info. I'll check out the various links.
This somewhat confirms my suspicion that little is being
done with scientific numerical GPU computing in the FreeBSD.
--
Steve
Thierry Thomas
2024-02-12 18:44:15 UTC
Permalink
Post by Jan Beich
Post by Alexander Leidinger
ROCm: No idea. I have not seen any report about it working or even
https://github.com/ROCm/ROCm/issues/138
https://github.com/ROCm/ROCm/issues/1913
- ROCm requires amdkfd.ko which drm-kmod doesn't provide since
https://github.com/freebsd/drm-kmod/commit/a381f46adf8b
- ROCm has poor *consumer* GPU support thus unattractive for
volunteers/community to spend time porting
I just read that it is now possible to run CUDA code on Radeon:

AMD Quietly Funded A Drop-In CUDA Implementation Built On ROCm: It's Now
Open-Source
<https://www.phoronix.com/review/radeon-cuda-zluda>

This should make it interesting!
--
Th. Thomas.
Loading...