How to make nvidia or AMD gfx card work on ARM based boards

I am looking for right place to ask and get answer for this question
How can I make nvidia or AMD gfx card work on ARM based boards?
for example on HiKey 960/970/khadas board or any other with pcie/m.2 connector on board
I know I will get just one pcie line but still.

M.2 ssd or network cards and many other devices 'just works"

I don’t think there should be any difference. Make sure that the kernel is build with the appropriate drivers for the device you are connecting, and that you have all the needed firmware in place.

That should work in theorie (and would be fun to see), you’ll need an adapater (something like for PCIe to M2 (check that M2 version/key is compatible) and to have a dedicated exteral power for the card… On software side, include the requested kernel driver and userspace components.

Related blog ticket:

I have all hw, but it isn’t working.
Some problem with pcie driver or I don’t know.
Anybody success with dw pcie driver + nvidia/amd open source drivers?

I’m afraid compability questions have to be more specific than just “Arm” and “dw pcie”. There is usually glue logic provided by the SoC vendor and it is very common for that glue logic to be validated only on WiFi or NVMe cards (which don’t use the same bus transaction widths).

For example I know the AMD Radeon R7 240D works on Arm but I also know that the same card cannot work on the Arm-based Developerbox due to a problem with wide transactions.