Skip to content

Add /usr/lib64 as a valid path to open libamdsmi.so #10

@zhguo01

Description

@zhguo01

Binary amd-smi will search /usr/lib/ and current folder for loading libamdsmi.so:

#cat smi-lib/cli/cpp/src/host/smi_cli_api_host.cpp
...
#elif __linux__
	amdSmiLibHandle = dlopen("/usr/lib/libamdsmi.so", RTLD_NOW | RTLD_GLOBAL);
	if (amdSmiLibHandle == NULL) {
		amdSmiLibHandle = dlopen("./libamdsmi.so", RTLD_NOW | RTLD_GLOBAL);
	}
#endif

However, if we want to package gim driver, libamdsmi.so and amd-smi together into a rhel rpm, I think path /usr/lib64/ needs to be included into smi_cli_api_host.cpp, thus in the rpm spec file I could use the desired way for packaging:

mkdir -p %{buildroot}%{_libdir}
install -m 755 smi-lib/build/amdsmi/package/Release/amdsmi/libamdsmi.so %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
install -m 755 smi-lib/cli/cpp/build/amd-smi %{buildroot}%{_bindir}

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