Unified Memory Access using Jetson TX2

Hi, I’m testing cuda program using Jetson TX2

But there is problem when I try to use ‘unified memory access’
(It occurs segmentation fault)

So, I query the property of Jetson TX2’s gpu, and I found that It doesn’t support ‘concurrentManagedAccess’ even though it is Pascal architecture.

How can I use unified memory access with ‘concurrentManagedAccess’ property

I’m using Jetpack 3.2 and cuda 9.0

Hi,

For TX2, unified memory requires exclusive access or will lead to a segmentation fault.
Please avoid concurrent CPU/GPU accesses with cudaDeviceSynchronize().

You can find more information in our document here:
http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-gpu-exclusive

Thanks.

Hello,
I’m also having this issue (Although with a Jetson TX1 rather than TX2).

The documentation states that cudaStreamSynchronize can also be used for synchronisation.

I still get the bus error using cudaStreamSynchronize, but I don’t get it using cudaDeviceSynchronize.

Unfortunately cudaDeviceSynchronize is not suitable for my application as I wish to update the CUDA buffer from a CPU thread while the GPU works on other streams.

(Note: I’m using the Driver API so the calls for me are actually cuCtxSynchronize and cuStreamSynchronize.)

Are there any other gotchas to be aware of?

Thanks
Russell

Just to update, I’ve managed to get it working with cuStreamSynchronize now.
I think it was just my call to cuMemAllocManaged needed the flag CU_MEM_ATTACH_HOST to be accessible from CPU.

Hi PeartreeStudios,

Could you please clarify whether you are able to access cuMemAllocaManaged buffer when GPU is still active ?

I am looking to understand meaning of what you said, vs what document says. For example

https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gb347ded34dc326af404aa02af5388a32

says -

"If CU_MEM_ATTACH_HOST is specified, then the allocation should not be accessed from devices that have a zero value for the device attribute CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS; an explicit call to cuStreamAttachMemAsync will be required to enable access on such devices. "

Did you also do a cuStreamAttachMemAsync() to enable concurrent access ?

Thanks