Only old, non-Retina iMacs can be used for Target Display Mode feature.
How to use your iMac as a display with Target Display Mode by Apple Repair Station Specialist in London, UK
applerepairstation.co.uk
I'm not sure if Big Sur still supports Target Display Mode for Thunderbolt iMacs.
As an alternative, you can use some hardware/software combo:
Shop all hardware products and accessories by Astropad.
shop.astropad.com
I believe it will use the DisplayPort signal generated by the Mac Pro GPU and transmit it to the iMac where software can display the image on the iMac screen.
Since the source is DisplayPort, it will not affect performance of the source computer, and there will be full GPU acceleration as if you were connecting a real display.
Since the output is USB or WiFi, there will be some latency (16 ms) and maybe some compression artifacts (I have not tried this product).
The output does not support 5K resolution.
Duet Display is a software only method which is not as capable. I don't think it works with a Mac as the display.
When considering on-the-go workspace solutions, Luna Display and Duet Display are two options to use your iPad as a second display. Software-simulated displays like Duet Displays are limited and offer an unreliable display experience. This guide outlines the benefits of a hardware solution so...
shop.astropad.com