Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Discovery fails if CUDA env vars are set to empty variable #87

Closed
maxpkatz opened this issue Aug 22, 2019 · 2 comments
Closed

Discovery fails if CUDA env vars are set to empty variable #87

maxpkatz opened this issue Aug 22, 2019 · 2 comments

Comments

@maxpkatz
Copy link

maxpkatz commented Aug 22, 2019

If I have CUDA_PATH in my environment but set as an empty variable, CUDA discovery will fail.

$ env | grep CUDA
CUDA_PATH=

In this case, find_toolkit() will return an empty list. This will then fail in find_toolkit_version() when building the CUDAnative package:

┌ Error: Error building `CUDAnative`:
│ ERROR: LoadError: CUDA toolkit at  doesn't contain nvcc

The problem is that the code that checks if these env vars exist will return immediately even if the env vars are empty:

https://github.com/JuliaGPU/CUDAapi.jl/blob/v1.0.1/src/discovery.jl#L230-L241

So this code block should check if the environment variables have a valid value, and if not, pass on to the remainder of the function to check the nvcc path and the default system paths.

@maleadt
Copy link
Member

maleadt commented Aug 23, 2019

Yeah, this should be fixed. Will have a look.

Is there any reason you have an empty CUDA_PATH set? Does it carry any meaning?

@maxpkatz
Copy link
Author

maxpkatz commented Aug 24, 2019

No, it was pure bad luck on my part -- my .bashrc file happens to set CUDA_PATH to something meaningful if I'm on a system where I know in advance that CUDA is installed, and (apparently) to an empty variable if not. On the system where I was running when I ran into this, I hadn't yet told this script where CUDA is installed on that system.

@maleadt maleadt closed this as completed in b5244c2 Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants