Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#62915 - [cuda] unable to build the samples

Attached to Project: Community Packages
Opened by Christian Heusel (gromit) - Sunday, 16 June 2019, 19:52 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 18 June 2019, 01:48 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

(Dont be too harsh please, first bug report)
Description:
I just recently started working with the CUDA package and noticed that you cannot build the examples provided by the package.
I tried fixing it by replacing the nvcc path in the Makefiles with sed, but afterwards there was still some kind of error, hence the bug report.

sed -i 's/\/usr\/local\/cuda/\/opt\/cuda\/bin\/nvcc /g' .//**/Makefile

Additional info:
* package version 10.1.168-1
* config and/or log files etc.

$ cuda/samples » make
make[1]: Entering directory '/opt/cuda/samples/0_Simple/simpleAssert'
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o simpleAssert.o -c simpleAssert.cu
make[1]: /usr/local/cuda/bin/nvcc: Command not found
make[1]: *** [Makefile:294: simpleAssert.o] Error 127
make[1]: Leaving directory '/opt/cuda/samples/0_Simple/simpleAssert'
make: *** [Makefile:51: 0_Simple/simpleAssert/Makefile.ph_build] Error 2


Steps to reproduce:
(Change to the cuda install dir and try to build the examples)
cd /opt/cuda/samples && make
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Tuesday, 18 June 2019, 01:48 GMT
Reason for closing:  Fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 17 June 2019, 10:59 GMT
Did you re-login? The package installs an /etc/profile.d/cuda.sh file which should be source by your shell on login. Alternatively, you can also just manually source that in your current session. Try that and report results.
Comment by Christian Heusel (gromit) - Monday, 17 June 2019, 14:57 GMT
Yes, I restarted my computer several times. (unrelatedly)
After sourcing nothing changes.

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/cuda/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/chris/.local/bin:/home/chris/.local/bin

I think you could have misunderstood my problem...
CUDA (or nvcc) works just fine for programs written by me, its just not possible to compile the examples shipped with the package itself at the moment.
It is not possible because the path to nvcc is hardcoded in the Makefiles. (see below)
A possible fix would be to add "export CUDA_PATH=/opt/cuda/" to /etc/profile.d/cuda.sh

chris@pioneer ~ » cat /opt/cuda/samples/0_Simple/asyncAPI/Makefile
[License]
################################################################################
#
# Makefile project only supported on Mac OS X and Linux Platforms)
#
################################################################################

# Location of the CUDA Toolkit
CUDA_PATH ?= /usr/local/cuda # <-- this here
[...]

Thank you for your help & work you put into Arch Linux!
Comment by Sven-Hendrik Haase (Svenstaro) - Tuesday, 18 June 2019, 01:48 GMT
Ok, thanks. I actually straight up implemented your suggestion and it seems to work just fine.

Well written report, by the way.

Loading...