Many thanks Andreas, I've solved the problem now. While digging through the
compiler.py code, I noticed a check for the PYCUDA_DEFAULT_NVCC_FLAGS
environment variable, which is then passed to nvcc. Ultimately I was able
to solve my problem by putting a file in /etc/profile.d/ with the contents:
This offers a simple but effective way for PyCUDA to point nvcc in the
I'm still not sure why I wasn't able to fix the "libdevice library not
found" error by modifying nvcc.profile directly, but the above is probably
a better solution regardless, because it doesn't require modifications to a
file that affects nvcc's operation in all use cases (i.e. even when it's
not called by PyCUDA). Since I've only encountered this problem using
PyCUDA, it makes sense that the solution should only kick in when nvcc is
called by PyCUDA.
I'm really looking forward to using this software package. Thank you for
all of your hard work putting it together!
On Mon, Jan 19, 2015 at 12:00 PM, Andreas Kloeckner <lists(a)informa.tiker.net
"David A. Markowitz"
Thanks again, Andreas. I'm really looking
forward to getting started with
Unfortunately, I've already tried your suggested approach (updating
nvcc.profile with NVVMIR_LIBRARY_DIR =
which contains libdevice.compute_35.10.bc in my
installation), but it did
not solve the problem. When I asked NVIDIA about this directly (hoping
to bother you further), they told me I should
never need to modify
nvcc.profile under any circumstances, which wasn't very helpful.
Is there some other line in nvcc.profile that I can modify so that nvcc
will be able to find the appropriate libdevice library when called by
PyCUDA's compiler script? e.g. perhaps I could append something to the
INCLUDES or LIBRARIES variables?
Is there an easy way for me to see which environment variables are
available when PyCUDA's compiler.py code calls nvcc? This might help
diagnose the problem.
The call happens here:
says that processes should inherit the parent's environment unless
otherwise specified (and it isn't), so it's not clear to me what would
override your variable... You can also use the 'keep=True' flag and try
and run nvcc yourself in the temp directory that PyCUDA creates. That's
perhaps the best way of figuring out what's up.