Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 684392 - dev-util/nvidia-cuda-toolkit-10.1.105 mangles CUDA file structure
Summary: dev-util/nvidia-cuda-toolkit-10.1.105 mangles CUDA file structure
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-04-26 03:11 UTC by Nathan Lewis
Modified: 2019-04-29 13:29 UTC (History)
1 user (show)

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


Attachments
patch proposal (0001-fix-binary-installation-for-nvidia-cuda-toolkit-10.1.patch,1.33 KB, patch)
2019-04-26 04:11 UTC, Nathan Lewis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Lewis 2019-04-26 03:11:48 UTC
updated dev-utils/nvidia-cuda-toolkit from 10.0.140 to 10.1.105

Version 10.1.105 seems to mangle to cuda file structure. Upon installing, $CUDA_HOME/bin/crt/link.stub and $CUDA_HOME/bin/crt/prelink.stub have been moved into $CUDA_HOME/bin, which breaks nvcc.

> nlewis-desktop ~ » nvcc /tmp/test.cu
> gcc: error: /opt/cuda/bin/crt/link.stub: No such file or directory
> gcc: warning: ‘-x c++’ after last input file has no effect
> gcc: fatal error: no input files
> compilation terminated.

The directories for $CUDA_HOME/include and $CUDA_HOME/lib64 were also empty. These are supposed to be symlinks which point at $CUDA_HOME/targets/<machine>-linux/include and $CUDA_HOME/targets/<machine>-linux/lib respectively.

Doing a clean install (unmerge, rm -rf /opt/cuda, then emerge again) of the package had the symlinks to be created correctly, but doing the update seems to cause them to be empty folders. However, the link.stub and prelink.stub files are still not in the bin/crt folder, but rather in the bin folder. "ebuild nvidia-cuda-toolkit-10.1.105 configure" creates the correct folder hierarchy, but somewhere between there and being installed moves the files out of crt.
Comment 1 Nathan Lewis 2019-04-26 03:38:44 UTC
I suspect that the following is flattening the bin folders:

    dodir ${cudadir} || die
    # Install binaries separately to amke sure the X permission is set
    into ${cudadir} || die
    dobin $(find bin nvvm/bin -type f) || die
    find bin nvvm/bin -type f -delete || die

    # Install the rest
    insinto ${cudadir} || die
    doins -r * || die

compared with the previous ebuild (10.0.130)

    dodir ${cudadir}
    mv * "${ED%/}${cudadir}" || die
Comment 2 Nathan Lewis 2019-04-26 03:46:14 UTC
*it also has the side effect of moving $CUDA_HOME/nvvm/bin/cicc to $CUDA_HOME/bin/cicc, but I don't know if this is intended behavior or not.
Comment 3 Nathan Lewis 2019-04-26 04:11:38 UTC
Created attachment 574164 [details, diff]
patch proposal
Comment 4 Larry the Git Cow gentoo-dev 2019-04-29 13:29:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae90e7d8c2d34aed7961f2de107959cb8605559c

commit ae90e7d8c2d34aed7961f2de107959cb8605559c
Author:     Jason Zaman <perfinion@gentoo.org>
AuthorDate: 2019-04-29 13:22:00 +0000
Commit:     Jason Zaman <perfinion@gentoo.org>
CommitDate: 2019-04-29 13:28:45 +0000

    dev-util/nvidia-cuda-toolkit-10.1.105: Fix installation location of executables
    
    Fixes failures when invoking nvcc. link.stub and prelink.stub need to be
    in crt subdirectory otherwise nvcc fails to find them.
    Also extras/demo_suite were not executable.
    
    Thanks to Jan Vesely and Nathaniel R. Lewis, this fix was derived from
    patches from them.
    
    Closes: https://github.com/gentoo/gentoo/pull/11735
    Closes: https://bugs.gentoo.org/684392
    Signed-off-by: Jason Zaman <perfinion@gentoo.org>
    Package-Manager: Portage-2.3.62, Repoman-2.3.11

 ....ebuild => nvidia-cuda-toolkit-10.1.105-r1.ebuild} | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)