File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ namespace cuda {
2323 * a single process is hosting more than one cuda session. This arena hosts cuda memory pool
2424 * which has some tunable parameters to control its memory usage and de-allocates memory back to
2525 * the device according to the specified params. This is opposite to the BFCArena which only
26- * attempts to free memory on Shrink() at the end of the run.
26+ * attempts to free memory on Shrink() if configured at the end of the run.
2727 *
2828 * ### Behavior
2929 * - Creates a **process-local** CUDA mempool for a specific device (from `OrtMemoryInfo`).
Original file line number Diff line number Diff line change @@ -52,6 +52,23 @@ static bool IsCudaMemPoolSupported() {
5252 return false ;
5353 }
5454
55+ // Creating a cuda mempool in some pipelines fails with
56+ // CUDA failure 801: operation not supported ; GPU=0 ; hostname=af14bbb1c000000 ;
57+ // Even though CUDA version may be 12.8 possibly due to the driver.
58+ cudaMemPoolProps props{};
59+ // Pinned is not the same as pinned allocator, cudaMemLocationTypeDevice actually does not exist
60+ // even though is present in some internet docs.
61+ props.allocType = cudaMemAllocationTypePinned;
62+ props.handleTypes = cudaMemHandleTypeNone; // local to process
63+ props.location .type = cudaMemLocationTypeDevice; // Device memory
64+ props.location .id = 0 ; // test device 0
65+ cudaMemPool_t pool;
66+ auto cuda_error = cudaMemPoolCreate (&pool, &props);
67+ if (cuda_error != cudaSuccess) {
68+ return false ;
69+ }
70+ cuda_error = cudaMemPoolDestroy (pool);
71+
5572 return true ;
5673}
5774
You can’t perform that action at this time.
0 commit comments