这是indexloc提供的服务,不要输入任何密码
Skip to content

long initialization overhead for GPU TEE cuda init #113

@blossomin

Description

@blossomin

here is my test program, it simply called the cuInit(0);. but this function call takes cuInit time: 6557046 us. this call should be about 500ms for a normal GPU. @rnertney , do you know where the overhead comes from for this heavy initialization?

#include <iostream>
#include <cuda.h>
#include <chrono>

int main() {
    int gpu_count = 0;
    CUresult status;

    auto start = std::chrono::high_resolution_clock::now();
    status = cuInit(0);
    auto end = std::chrono::high_resolution_clock::now();
    auto duration_cuInit = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();

    if (status != CUDA_SUCCESS) {
        std::cerr << "cuInit failed: " << status << std::endl;
        return 1;
    }
    std::cout << "cuInit time: " << duration_cuInit << " us" << std::endl;
    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions