[BUG]: std::bad_alloc: out_of_memory: CUDA error

Running this example LP and MILP Examples — NVIDIA cuOpt (25.08)
I get this error

Setting parameter time_limit to 6.000000e+01
Problem status: NoTermination
Solving a problem with 2 constraints 2 variables (2 integers) and 4 nonzeros
Objective offset -0.000000 scaling_factor -1.000000
After trivial presolve updated 2 constraints 2 variables. Objective offset 0.000000
Error in solve_mip: std::bad_alloc: out_of_memory: CUDA error (failed to allocate 2400000000 bytes) at: /__w/rmm/rmm/cpp/include/rmm/mr/device/cuda_memory_resource.hpp:62: cudaErrorMemoryAllocation out of memory

Running on WLS

Anyone can help me?

Seems like you are out of memory while allocating GPU resources while running. cuOpt tried to acquire 2.5 GB and there wasn’t enough space left.

Are you by any chance running any other programs which are consuming GPU. If not, then in that case the bottle neck is insufficient GPU memory.

This shouldn’t happen because I should have 16GB of memory end the error is telling that the code cannot allocate 2,4 GB

I see that the GPU dedicated memory dimension is 4GB and the shared memory dimension is 16GB. Could the error be related to the dedicated memory dimension?

FYI, these lines solved my problem

import rmm
pool = rmm.mr.PoolMemoryResource(
rmm.mr.ManagedMemoryResource(),
initial_pool_size=“1GiB”,
maximum_pool_size=“16GiB”
)
rmm.mr.set_current_device_resource(pool)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.