Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

environment variable APPDATA is not available in linux on default, in… #95

Closed
wants to merge 1 commit into from

Conversation

munubaykal
Copy link

…stead use /tmp folder

On most of linux distros, pPath = getenv("APPDATA") is returning null. When executing "Strncpy(m_cacheFilePath, pPath, sizeof(m_cacheFilePath));" in "Device::InitOutputPaths()", pPath is staying null. Because of that, m_cacheFilePath is receiving null value. That causes an issue as below.

In llpcCompiler.cpp:459,
const char *shaderCachePath = cl::ShaderCacheFileDir.c_str();

shaderCachePath is assigned as null which causes empty() to return true. On linux, it enters into llvm_unreachable...

f (cl::ShaderCacheFileDir.empty()) {
#ifdef WIN_OS
shaderCachePath = getenv("LOCALAPPDATA");
assert(shaderCachePath);
#else
llvm_unreachable("Should never be called!");
#endif
}

…stead use /tmp folder

On most of linux distros, pPath = getenv("APPDATA") is returning null.
When executing "Strncpy(m_cacheFilePath, pPath, sizeof(m_cacheFilePath));" in "Device::InitOutputPaths()",
pPath is staying null. Because of that, m_cacheFilePath is receiving null value.  That causes an issue as below.

In llpcCompiler.cpp:459,
const char *shaderCachePath = cl::ShaderCacheFileDir.c_str();

shaderCachePath is assigned as null which causes empty() to return true. On linux, it enters into llvm_unreachable...

f (cl::ShaderCacheFileDir.empty()) {
#ifdef WIN_OS
    shaderCachePath = getenv("LOCALAPPDATA");
    assert(shaderCachePath);
#else
    llvm_unreachable("Should never be called!");
#endif
  }
@amdvlk-admin
Copy link

Can one of the admins verify this patch?

@jinjianrong jinjianrong requested a review from a team January 9, 2024 12:37
@qiaojbao
Copy link
Collaborator

@munubaykal, thanks for the remind. We plan to integrate amdgpu+nulldevice into a single version of function and put it in device.cpp. We will finish internally ASAP.

@qiaojbao qiaojbao closed this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants