Hi –
I have two Fermis in a 64-bit Linux machine using cuda 4.0b with driver 270.27 and I would like to try out the peer-to-peer memory access feature with them.
I wrote a simple program that checks the device unified addressing property and the does a cudaDeviceCanAccessPeer(). As expected, the unified addressing device property is returned positive, but cudaDeviceCanAccessPeer() returns a 0. This is my code, followed by output:
#include <stdio.h>
#include <string.h>
#include <cuda_runtime_api.h>
int main(int argc, char* argv) {
int deviceCount;
cudaGetDeviceCount(&deviceCount);
int device;
for (device = 0; device < deviceCount; ++device) {
cudaDeviceProp deviceProp;
cudaGetDeviceProperties(&deviceProp, device);
if (device == 0) {
if (deviceProp.major == 9999 && deviceProp.minor == 9999)
printf(“There is no device supporting CUDA.\n”);
else if (deviceCount == 1)
printf(“There is 1 device supporting CUDA\n”);
else printf(“There are %d devices supporting CUDA\n”, deviceCount);
}
printf(“deviceProp.unifiedAdressing %s\n”, deviceProp.unifiedAddressing ? “Yes” : “No”);
}
cudaSetDevice(0);
int can_acc;
if (cudaDeviceCanAccessPeer(&can_acc,0,1)!=cudaSuccess) printf(“Unsuccessful\n”);
printf(“Can Access Peer %d\n”,can_acc);
}
(output)
There are 2 devices supporting CUDA
deviceProp.unifiedAdressing Yes
deviceProp.unifiedAdressing Yes
Can Access Peer 0
I would appreciate it if someone could tell me what am I doing wrong or leaving out.
Thanks–