How do I run a Python program that imports Tensorflow on my AMD GPU today?
How do I run a Python program that imports Tensorflow on my AMD GPU today?
If you are installing TF from source, then it becomes your job. TF docs should help you here, and TF's build-system should be able to guide you through what you need to install.
No that's bullshit and it shows you never have done it.
Tensorflow is CUDA only and does not run over AMD GPU. Because CUDA is proprietary and has a monopoly on GPGPU for now.
It is such a big deal that AMD had to fork tensorflow and try to make their own version it in order to make it "partially" run over HIP. This naturally makes it behind upstream, buggy and partially updated [^1]
CUDA is not portable and will never be.
The sad truth is that, due to CUDA, a big majority of GPGPU programs are now vendor lock-in on Nvidia hardware. That is unacceptable, but it is like that.
[^1]: https://github.com/ROCmSoftwarePlatform/tensorflow-upstream
That's because HIP requires changes to the program source code, but AMD has managed to upstream those patches to other projects. If they haven't done that for Tensorflow, that's kind of their problem.
Clang can compile CUDA code, and it has an AMDGpu backend. AMD could compile that CUDA code to SPIRV if they wanted. Intel and PGI do compile CUDA to x86-64 using LLVM without problems.
https://rocm-documentation.readthedocs.io/en/latest/Deep_lea...
“ AMD ROCm is validated for GPU compute hardware such as AMD Radeon Instinct GPUs. Other AMD cards may work, however, they are not officially supported at this time. We appreciate your feedback and we will consider it for future versions of ROCm.”
https://github.com/RadeonOpenCompute/ROCm/issues/887#issueco...
> "Vega 10" chips, such as on the AMD Radeon RX Vega 64 and Radeon Instinct MI25
But if you’re using the current consumer product line, it’s hit or miss.