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

Unset TMPDIR as to Avoid Conflict with libpam-tmpdir Package #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lucbruni-amd
Copy link

@lucbruni-amd lucbruni-amd commented Jan 6, 2025

This PR addresses ROCm issue 4204 (ROCm/ROCm#4204)

Following a deep dive into amdgpu-dkms, it seems there is a incompatibility (bug?) in DKMS module's amd/dkms/configure script, which (when libpam-tmpdir is active) generates an incorrect amd/dkms/config/config.h file that won't compile.

In particular, when the configure script runs test compilations, it creates a temporary build directory a la:

build_dir=$(mktemp -d -t build_XXXXXXXX -p $build_dir_root)
.. where $build_dir_root is /var/lib/dkms/amdgpu/6.10.5-2095006.24.04/build (or similar, depending on your system).

The problem is that, according to mktemp --help, the presence of the -d switch in the call to mktemp means that the -p $build_dir_root argument is ignored in favor of the TMPDIR environment variable, if it exists. Setting TMPDIR, meanwhile, is the entire purpose of the libpam-tmpdir pam module.

In some test compilations, however, the ./configure script adds -I../tiny_wrapper/include to CFLAGS, meaning correct results are contingent on $build_dir being a subdirectory of $build_dir_root.

False negatives in these test compilations lead to several macros not being defined in config.h, which causes the inclusion of code that won't compile, leading to the errors seen in ROCm/ROCm#4164.

Steps to reproduce:
Install libpam-tmpdir package
Run sudo pam-auth-update and enable "per-user temp directories" (if not already enabled)
Log out, or reboot to ensure the TMPDIR env var is set.
Follow instructions at https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html

Credit for find: @mvastola

Copy link

@mvastola mvastola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine for me now. Thanks!

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.

2 participants