NVIDIA / NVIDIA/TensorRT

In trt plugin' consturctor, cuModuleLoadData occasionally fails because of illegal address.

Open
#4,638 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module:Plugins
Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

In tensorrt plugin's consturctor, here is the code as follow:

FaPlugin::FaPlugin(std::string asset_prefix ):asset_prefix_(asset_prefix)
{
setPluginNamespace(kTfTrtPluginNamespace);
cudaGetDevice(&device_id_);
cudaDeviceSynchronize();

auto ptx = read_ptx(ptx_path);
CUmodule mod = nullptr;
CUresult code = cuModuleLoadData(&mod, ptx.c_str());

if (code != CUDA_SUCCESS)
{
    const char *str;
    cuGetErrorString(code, &str);
    char err[1024] = {0};
    strcat(err, str);
    std::cerr << "Error Code: " << code
              << "\n\tMessage: " << err
              << "\n\tAt " << file << ":" << line << std::endl;

}

}
}

Occasionally, cuModuleLoadData returns illegal address error, but most of the time it runs normally.
I want to ask why this occurs occasionally, and how to solve it, should i init some context or something else before
the function cuModuleLoadData ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is identified. Start by inspecting the FaPlugin constructor around read_ptx, cudaGetDevice, cudaDeviceSynchronize, and cuModuleLoadData, then investigate the intermittent illegal-address result and define a reproducible initialization or loading sequence that prevents it.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.