Cuda Compiler Not Working with Gcc 4.5 +

Cuda compiler not working with GCC 4.5 +

Doing some research online shows several methods for accomplishing this task. I just tested the method found here: http://www.vectorfabrics.com/blog/item/cuda_4.0_on_ubuntu_11.04 and it worked like a charm for me. It steps you through installing gcc 4.4 and creating scripts to run that version with nvcc. If you prefer trying the method mentioned in your post I'd recommend following that first link to install gcc4.4 and then create symbolic links as mentioned in your post. Creating symbolic links in Linux is accomplished by using the 'ln' command.

For example:

 ln -s [source file/folder path] [linkpath]

This link gives a few examples of creating symbolic links on both Ubuntu and Windows: http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/. Hopefully that points you in the right direction.

CUDA incompatible with my gcc version

As already pointed out, nvcc depends on gcc 4.4. It is possible to configure nvcc to use the correct version of gcc without passing any compiler parameters by adding softlinks to the bin directory created with the nvcc install.

The default cuda binary directory (the installation default) is /usr/local/cuda/bin, adding a softlink to the correct version of gcc from this directory is sufficient:

sudo ln -s /usr/bin/gcc-4.4 /usr/local/cuda/bin/gcc

CUDA 5.0 on a Slackware64 current with gcc 4.7

The steps used to get this working were:

  1. Install gcc-4.4.7 to a different location
  2. Install CUDA 5.0 to it's default location
  3. Install Samples and SDK to your home directory
  4. Add gcc-4.4.7 to your path (overwrite gcc-4.7.1)
  5. Add LD_LIBRARY_PATH to your path
  6. Add nvcc (/usr/local/cuda-5.0/bin) to your path
  7. Compile (make) samples

Cuda Clang and OS X Mavericks

The issue with 10.9 is that gcc is actually clang. Please try latest CUDA toolkit and explicitely point NVCC to use /usr/bin/clang (nvcc -ccbin /usr/bin/clang). This way NVCC will know it's dealing with clang.

CMAKE_CUDA_COMPILER flag is false despite cuda being found

Okay, I found the issue. Every CUDA version only supports a specific gcc version. Compatibility can be found here: https://stackoverflow.com/a/46380601/9299366

After installation of CUDA at some point I changed my default gcc version resulting in this odd behaviour of cmake not being able to detect cuda despite nvcc and nvidia-smi properly working. I purged CUDA and the Nvidia driver completely, set a valid gcc version and reinstalled CUDA + driver. It seems to be working fine now.



Related Topics



Leave a reply



Submit