cuda malloc managed fails

Hi,

I am trying to run some applications that use cuda malloc managed. and I get an error that is not supported. What is the issue? Pascal should support this as per nvidia documentation

Maybe I am compiling with wrong arch sm flag and it is not generating the correct binary. What is the arch sm flag for jetson tx2?

Hi trinayan

For TX2 Pascal GPU architecture, the Compute Capability is 6.2.

Thanks

Hello,

I’m trying to build and run the first CUDA application from https://devblogs.nvidia.com/even-easier-introduction-cuda/

I have an MX150 GPU, in combination with Intel GPU. Windows 10 told the signature of the installed driver would be incorrect, so I reverted to the previous Windows driver, but this only as a side note.

Now I’m trying to build and run this first CUDA app, and I found that x and y are NULL after the execution of cudaMallocManaged. I changed the code of the main method to:


std::cout << "Test started " << std::endl;

int N = 1 << 20; // 1M elements

float *x, *y;
cudaMallocManaged(&x, N * sizeof(float));
cudaMallocManaged(&y, N * sizeof(float));

std::cout << "Test started2 " << (x!=NULL?"x present":"x missing") << "," << (y!=NULL?"y present":"y missing") << " 0x" << x <<" 0x" << y << std::endl;

// initialize x and y arrays on the host
for (int i = 0; i < N; i++) {
	x[i] = 1.0f;
	y[i] = 2.0f;
}

std::cout << "Values have been set" << std::endl;

// Run kernel on 1M elements on the GPU
add<<<1, 1>>>(N, x, y);
std::cout << "Add started on GPU " << std::endl;

// Wait for GPU to finish before accessing on host
cudaDeviceSynchronize();
std::cout << "Add finished on GPU " << std::endl;

// Check for errors (all values should be 3.0f)
float maxError = 0.0f;
for (int i = 0; i < N; i++)
	maxError = fmax(maxError, fabs(y[i] - 3.0f));
std::cout << "Max error: " << maxError << std::endl;

// Free memory
cudaFree(x);
cudaFree(y);

return 0;

The execution log:

Test started
Test started2 x missing,y missing 0x0000000000000000 0x0000000000000000

Any Ideas?

Ok, I found that I need a new driver from the nvidia drivers page, not the one that was provided by the device manufacturer and not the one that comes with CUDA toolkit on the page https://developer.nvidia.com/cuda-downloads

With the WHQL driver it works. Just wanted to tell you…