cuda - What's the difference between cuDeviceCanAccessPeer(...) and cuDeviceGetP2PAttribute(..., CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED, ...)? -


i don't have access multi-gpu system test this, in cuda.h found 2 things seems quite similar. first function

    curesult cudaapi cudevicecanaccesspeer(int *canaccesspeer, cudevice dev, cudevice peerdev); 

described as

returns in *canaccesspeer value of 1 if contexts on dev capable of directly accessing memory contexts on peerdev , 0 otherwise. if direct access of peerdev dev possible, access may enabled on 2 specific contexts calling ::cuctxenablepeeraccess().

and second 1

    curesult cudaapi cudevicegetp2pattribute(int* value, cudevice_p2pattribute attrib, cudevice srcdevice, cudevice dstdevice); 

described as

returns in *value the value of requested attribute attrib of link between srcdevice , dstdevice. supported attributes are:

::cu_device_p2p_attribute_performance_rank: relative value indicating performance of link between 2 devices.

::cu_device_p2p_attribute_access_supported p2:1` if p2p access enable.

::cu_device_p2p_attribute_native_atomic_supported: 1 if atomic operations on link supported.

the name cu_device_attrubute_access_supported suggest call cudevicecanaccesspeer same using cudevicegetp2pattribute attrib set ::cu_device_p2p_attribute_access_supported p2p, description "1 if p2p access enable" confuses me.

are same, or second 1 supposed test if link has been activated?

i don't believe same.

  • cudevicecanaccesspeer returns whether p2p access possible between 2 devices or not.
  • cudevicegetp2pattributereturns whether p2p access enabled between 2 devices.

without prior successful call cuctxenablepeeraccess, cudevicegetp2pattribute should return false when queried cu_device_p2p_attribute_access_supported attribute, if cudevicecanaccesspeer returns true.

note don't presently have access p2p enabled system check this.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -