Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 792477 - sys-apps/hwloc-2.3.0[-cuda,nvml]: configure: Specified --enable-nvml switch, but could not find appropriate support
Summary: sys-apps/hwloc-2.3.0[-cuda,nvml]: configure: Specified --enable-nvml switch, ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-05-27 12:46 UTC by Charlie Gehlin
Modified: 2025-01-10 19:27 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Sandbox log (sandbox.log,571 bytes, text/x-log)
2023-12-13 15:52 UTC, Todd Walter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Gehlin 2021-05-27 12:46:56 UTC
checking for final PCIACCESS support... yes
checking nvml.h usability... no
checking nvml.h presence... no
checking for nvml.h... no
configure: WARNING: Specified --enable-nvml switch, but could not
configure: WARNING: find appropriate support
configure: error: Cannot continue

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/sys-apps/hwloc-2.3.0/work/hwloc-2.3.0-abi_x86_64.amd64/config.log
 * ERROR: sys-apps/hwloc-2.3.0::gentoo failed (configure phase):
 *   econf failed


Reproducible: Always

Steps to Reproduce:
1.USE="-cuda nvml"
2.emerge hwloc
3.
Actual Results:  
Works when USE="cuda nvml"

Expected Results:  
USE="nvml" should also require USE="cuda" in ebuild?
Comment 1 Ionen Wolkens gentoo-dev 2021-05-27 17:38:21 UTC
It'd be good to still include logs and emerge --info when reporting build failures, but indeed:

/opt/cuda/include/nvml.h

with USE=cuda:
  configure:25792: checking nvml.h presence
  configure:25792: x86_64-pc-linux-gnu-gcc -E  -I/opt/cuda/include conftest.c
  configure:25792: $? = 0
  configure:25792: result: yes

without:
  configure:25792: x86_64-pc-linux-gnu-gcc -E  conftest.c
  conftest.c:121:10: fatal error: nvml.h: No such file or directory
Comment 2 Charlie Gehlin 2021-05-27 18:46:16 UTC
(In reply to Ionen Wolkens from comment #1)
> It'd be good to still include logs and emerge --info when reporting build
> failures, but indeed:
> 
> /opt/cuda/include/nvml.h
> 
> with USE=cuda:
>   configure:25792: checking nvml.h presence
>   configure:25792: x86_64-pc-linux-gnu-gcc -E  -I/opt/cuda/include conftest.c
>   configure:25792: $? = 0
>   configure:25792: result: yes
> 
> without:
>   configure:25792: x86_64-pc-linux-gnu-gcc -E  conftest.c
>   conftest.c:121:10: fatal error: nvml.h: No such file or directory

Seemed very redundant given the referring bug.
Comment 3 Alessandro Barbieri 2021-07-12 06:05:48 UTC
quoting
> the NVIDIA Management Library (NVML) for NVML device discovery.
> It is included in CUDA since version 8.0.
> Older NVML releases were available within the NVIDIA GPU Deployment Kit
Comment 4 B. Gazotti 2021-11-01 14:09:39 UTC
Still present in version 2.6.0, as of today.
Comment 5 Todd Walter 2023-12-13 15:52:28 UTC
Created attachment 879007 [details]
Sandbox log
Comment 6 Todd Walter 2023-12-13 15:52:53 UTC
Still present in 2.9.2
Comment 7 Andrew John Hughes 2025-01-10 19:27:16 UTC
Hit this yesterday and has taken a while to work out what is going on.

Without the cuda USE flag enabled, hwloc does not depend on nvidia-cuda-toolkit which provides nvml.h:

# equery f nvidia-cuda-toolkit|grep nvml\.h
/opt/cuda/targets/x86_64-linux/include/nvml.h

It also will not add /opt/cuda to the compile paths to find it:

    if use cuda ; then
        append-cflags "-I${ESYSROOT}/opt/cuda/include"
        append-cppflags "-I${ESYSROOT}/opt/cuda/include"

        local -x LDFLAGS="${LDFLAGS}"
        append-ldflags "-L${ESYSROOT}/opt/cuda/$(get_libdir)"
    fi

so, even if you work out that nvidia-cuda-toolkit is needed and emerge it, it still fails with the above if USE="cuda" is not enabled.

There is a further problem on stable profiles where the cuda USE flag is masked. This suggests that, not only should the nvml USE flag require cuda, but the nvml USE flag should also be masked on stable, as with other examples in package.use.stable.mask (e.g. cudnn for media-libs/opencv)