Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure of nvidia-cuda-toolkit seems to have changed in Ubuntu 18.04 #54

Closed
ghost opened this issue Apr 21, 2018 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Apr 21, 2018

Just a heads up,

Tried to install the cuda package on Ubuntu 18.04 ahead of it's release. If you leave it to install with no CUDA_PATH set, it finds nvcc at /usr/bin/nvcc, then goes up a couple levels and can't find /usr/lib64. If I set CUDA_PATH to /usr/lib/cuda I get:

    checking for environment variable CUDA_PATH
    Path rejected: /usr/lib/cuda
    Does not exist: /usr/lib/cuda/include/cuda.h
    checking for nvcc compiler executable in PATH
    Path accepted: /usr
    Found CUDA toolkit at: /usr
    CallStack (from HasCallStack):
      die', called at /tmp/stack770/cuda-0.9.0.3/Setup.hs:149:26 in main:Main
    setup: Could not find path: ["/usr/lib64"]

(include and lib64 are empty, copied to /usr/include/ and /usr/lib/x86_64-linux-gnu/ instead)

Was the first time I installed 'nvidia-cuda-toolkit' from apt-get in a long time due to its lag in release (right now its current at 9.1), not sure if this structure changed just in 18.04.

I did try creating /usr/lib64 for fun, cuda compiled, but accelerate-llvm-ptx died not being able to find the nvvm directory and libdevice (nvvm/libdevice being located in /usr/lib/cuda), also strange because I thought nvvm was default off?

@tmcdonell
Copy link
Owner

Thanks for the heads up! I also haven't tried the package from apt in a long while because it always lagged so far behind. I guess I should try and make it work with that again.

I think that it is just the apt package which changes the directory structure... my cuda-9.1 install using the regular nvidia installer has the usual folder structure in /usr/local/cuda. We'll probably need a separate change to make accelerate-llvm-ptx understand the folder structure used by apt as well.

It is still looking for the nvvm directory because that is where the standard math library is located, which contains the implementations of sin(), cos(), etc.

@ghost
Copy link
Author

ghost commented Apr 24, 2018

Hey np!

So the initial structure of /usr/lib/cuda is:

/usr/lib/cuda$ ls
bin  include  lib64  nvvm  version.txt

bin, include, lib64 are all empty, nvvm contains libdevice
I set CUDA_PATH to be /usr/lib/cuda

I symlinked include as /usr/include and cuda built (because of missing cuda.h)

My simple executable compiled with accelerate-llvm-ptx, but wouldn't run because of missing ptxas at bin/ptxas so i symlinked bin as /usr/bin and everything ran.

Wasn't too bad

@tmcdonell
Copy link
Owner

I think this is fixed and can be closed with AccelerateHS/accelerate#444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant