[PATCH] D42642: [CUDA] Detect installation in PATH

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 11:08:32 PST 2018


tra added a comment.

I've thought a bit more about this and there's another quirk -- symlinks.

What if we've found /usr/bin/ptxas and is a symlink pointing to the real ptxas in the CUDA installation? If we add /usr to the list of candidates it will not help us at all. We should probably find the real path and add another candidate path derived from it.



================
Comment at: lib/Driver/ToolChains/Cuda.cpp:206
     // -nocudalib hasn't been specified.
-    if (LibDeviceMap.empty() && !Args.hasArg(options::OPT_nocudalib))
+    if (CheckLibDevice && LibDeviceMap.empty())
       continue;
----------------
Hahnfeld wrote:
> tra wrote:
> > I think this may be too strict.
> > 
> > Checking directory structure for the purposes of detecting CUDA SDK should work well enough to weed out false detection for 'split' CUDA installation and we've verified libdevice directory presence above. 
> > 
> > Checking for libdevice bitcode is somewhat orthogonal to this. IMO, regardless of how we've found the installation directory, whether we have suitable libdevice version there should not matter if user explicitly passed -nocudalib. Insisting on libdevice presence in this situation would be somewhat surprising. 
> > 
> > 
> > 
> > 
> > 
> So you are suggesting to revert the change to this line, right?
Yes, if you agree with my reasoning.



https://reviews.llvm.org/D42642





More information about the cfe-commits mailing list