Giter Club home page Giter Club logo

Comments (6)

pakmarkthub avatar pakmarkthub commented on June 21, 2024 1

You may use CUDA VMM instead of cudaMalloc. VMM always guarantees that CUDA VA is page aligned.

from gdrcopy.

pakmarkthub avatar pakmarkthub commented on June 21, 2024

Hi @hongbilu,

We don't provide such API. And the agreement of the pin and map API is within the buffer you pin and map. It is unsafe to assume that you can use the same CPU VA range from mapping CUDA buffer A to access CUDA buffer B.

from gdrcopy.

hongbilu avatar hongbilu commented on June 21, 2024

Hi @hongbilu,

We don't provide such API. And the agreement of the pin and map API is within the buffer you pin and map. It is unsafe to assume that you can use the same CPU VA range from mapping CUDA buffer A to access CUDA buffer B.

yes, but cudaMalloc cannot guarantee that memory address must be different page. In fact they might be same pretty much when allocating small data size which is a very common usage. The problem is that applications will take the management of all the cuda memory and check if cpu va is at same range with others, that is an additional work, too dirty and specific solution. what do you think?

from gdrcopy.

pakmarkthub avatar pakmarkthub commented on June 21, 2024

Let's say that you have two CUDA buffers A and B from cudaMalloc. You will be able to pin both A and B, but you may not be able to map them. gdr_map requires the start address (does not have to be at the beginning of the buffer) to be GPU BAR1 page aligned. cudaMalloc does not guarantee the alignment. If you want to use GDRCopy to create CPU VA of your buffers, you must manually adjust the alignment (see https://github.com/NVIDIA/gdrcopy/blob/master/tests/common.cpp#L46). Generally, this results in you allocating each buffer with size larger than GPU BAR1 page. Thus, the buffers should not be that small anyway.

basic_small_buffers_mapping is a unit test to ensure that we can do gdr_pin of two small contiguous buffers. But even if you can pin, you cannot map as the second buffer is not GPU BAR1 page aligned. It is probably not what you are looking for.

from gdrcopy.

hongbilu avatar hongbilu commented on June 21, 2024

thanks! so it need to allocate more buffers manually which means a not easily to use for clients

from gdrcopy.

hongbilu avatar hongbilu commented on June 21, 2024

very appreciate for remind! thanks

from gdrcopy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.