Skip to content

Out of memory even though the assigned gpu is free #7

@jiangjiechu

Description

@jiangjiechu

Notice that context buffer is created before gpu assignment:

unsigned scale = createContext(context, use_pbo, cameraInput.cameraType,
cameraInput.width,
cameraInput.height,
mode,
cameraInput.sampleNum,
maxPathLength,
rrBeginLength );
if(gpuIds.size() != 0){
std::cout<<"GPU Num: "<<gpuIds.size()<<std::endl;
context -> setDevices(gpuIds.begin(), gpuIds.end() );
}

This could induce serious memory harassment when there are other jobs running on a multi-GPU server. If any one gpu memory is used up, the program will throw out of memory exception and quit, despite that there are plenty of free devices.
The gpu should be set before the createBuffer() line in createContext():
Buffer outputBuffer = context -> createBuffer(RT_BUFFER_OUTPUT, RT_FORMAT_FLOAT3, bWidth, bHeight);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions