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:
export PYCUDA_DEFAULT_NVCC_FLAGS="--dont-use-profile -ldir=/usr/local/cuda/nvvm/libdevice" This offers a simple but effective way for PyCUDA to point nvcc in the right direction. 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! -David On Mon, Jan 19, 2015 at 12:00 PM, Andreas Kloeckner <[email protected] > wrote: > "David A. Markowitz" <[email protected]> writes: > > > Thanks again, Andreas. I'm really looking forward to getting started with > > PyCUDA. > > > > Unfortunately, I've already tried your suggested approach (updating > > nvcc.profile with NVVMIR_LIBRARY_DIR = > /usr/local/cuda-6.5/nvvm/libdevice, > > 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 > not > > 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: > > https://github.com/inducer/pycuda/blob/master/pycuda/compiler.py#L114 > > using this: > > https://github.com/inducer/pytools/blob/master/pytools/prefork.py#L34 > > https://docs.python.org/2.7/library/subprocess.html > > 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. > > Andreas >
_______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
