cuda directory

Dear all,

I have a linux machine (debian 9 stretch). I installed cuda via “apt install nvidia-cuda-toolkit”. It seems installation was successful. “nvcc --version” showed the version is 8.0.44.

Now I need to compile another program which asks me the path to cuda directory. However, it seems there is no specific cuda directory from my cuda installation. Please see the results of “dpkg -L nvidia-cuda-toolkit” below.

So my questiton: did I install cuda correctly and completely? which directory should be my “cuda directory”?

Thank you very much.

Michael

michael@hpz420:~$ dpkg -L nvidia-cuda-toolkit
/.
/etc
/etc/nvcc.profile
/usr
/usr/bin
/usr/bin/bin2c
/usr/bin/cuda-memcheck
/usr/bin/cudafe
/usr/bin/cudafe++
/usr/bin/cuobjdump
/usr/bin/fatbinary
/usr/bin/gpu-library-advisor
/usr/bin/nvcc
/usr/bin/nvdisasm
/usr/bin/nvlink
/usr/bin/nvprune
/usr/bin/ptxas
/usr/include
/usr/include/nvvm.h
/usr/lib
/usr/lib/nvidia-cuda-toolkit
/usr/lib/nvidia-cuda-toolkit/bin
/usr/lib/nvidia-cuda-toolkit/bin/cicc
/usr/lib/nvidia-cuda-toolkit/bin/crt
/usr/lib/nvidia-cuda-toolkit/bin/crt/link.stub
/usr/lib/nvidia-cuda-toolkit/bin/crt/prelink.stub
/usr/lib/nvidia-cuda-toolkit/bin/g++
/usr/lib/nvidia-cuda-toolkit/bin/gcc
/usr/lib/nvidia-cuda-toolkit/bin/nvcc
/usr/lib/nvidia-cuda-toolkit/libdevice
/usr/lib/nvidia-cuda-toolkit/libdevice/libdevice.compute_20.10.bc
/usr/lib/nvidia-cuda-toolkit/libdevice/libdevice.compute_30.10.bc
/usr/lib/nvidia-cuda-toolkit/libdevice/libdevice.compute_35.10.bc
/usr/lib/nvidia-cuda-toolkit/libdevice/libdevice.compute_50.10.bc
/usr/share
/usr/share/doc
/usr/share/doc/nvidia-cuda-toolkit
/usr/share/doc/nvidia-cuda-toolkit/NEWS.Debian.gz
/usr/share/doc/nvidia-cuda-toolkit/README.Debian
/usr/share/doc/nvidia-cuda-toolkit/changelog.Debian.gz
/usr/share/doc/nvidia-cuda-toolkit/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/nvidia-cuda-toolkit
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/cuda-binaries.1.gz
/usr/lib/nvidia-cuda-toolkit/bin/nvcc.profile
/usr/share/man/man1/cuda-memcheck.1.gz
/usr/share/man/man1/cuobjdump.1.gz
/usr/share/man/man1/nvcc.1.gz
/usr/share/man/man1/nvdisasm.1.gz
/usr/share/man/man1/nvprune.1.gz

NVIDIA doesn’t provide any packages called “nvidia-cuda-toolkit”

packages that start with “nividia-…” are generally created/provided by a third party repository, such as PPA

If you install CUDA using a NVIDIA-provided method and installer, the toolkit will be placed by default in

/usr/local/cuda-X.Y

directory on linux.

Your arrangement of directories with

/etc
/usr/bin
/usr/lib
/usr/share

is not typical for any NVIDIA-provided installer.

I wouldn’t be able to answer any questions about how to use CUDA in this 3rd-party install arrangement.

Thank you very much.

I just searched and it seems NVIDIA provides ubuntu installation version. Does it work for debian? or should I go with general linux version?

Another question: if I install NVIDIA version and leave the “nvidia-cuda-toolkit” version there, will there be any conflict? does NVIDIA version writes anything outside the default /usr/lical/cuda-X.Y directory?

Thanks again!

Michael

debian isn’t a supported environment for CUDA development work

So I will go with distribution-independent package.

Can you kindly comment on my second question? Will the package write anything outside the default installation directory?

Thank you very much.

If you install the GPU driver, it will definitely install things outside of /usr/local/cuda

If you only install the CUDA toolkit, I’m not aware of anything written to outside of that directory, but I don’t have an exhaustive list to be certain. Certainly the installer will write to your temp directory for installation purposes. Other than that I am not aware of anything.

I’m not sure what you mean by distribution-independent package. If you are referring to the runfile installer, that makes no claims to be distribution independent. Debian is officially unsupported whether you use a runfile install method or a package manager method.

Thank you very much. Yes I mean runfile package. From installation guide: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

The CUDA Toolkit can be installed using either of two different installation mechanisms: distribution-specific packages (RPM and Deb packages), or a distribution-independent package (runfile packages). The distribution-independent package has the advantage of working across a wider set of Linux distributions, but does not update the distribution’s native package management system.

If the runfile package works for ubuntu, I think it probably works for debian as well. Will try…