Warning: THE VOID WIKI IS DEPRECATED. It is no longer being maintained, contains outdated and incorrect information, and will eventually be shut down. Please refer to the Void Handbook, https://docs.voidlinux.org/, for the official documentation. If you can't find the information you're seeking, please raise an issue at https://github.com/void-linux/void-docs/issues

Cuda

From Void Linux Wiki
Jump to navigation Jump to search

CUDA is a parallel computing platform and application programming interface (API) model created by Nvidia.

It's notorious for not working with current compilers.

The following procedure, while not very elegant, gets it to work with the following combination of versions (either available from the repository or Nvidia):

  • GCC 7.3.0 (from repository)
  • CUDA 9.1.85_387.26 (get the "runfile" from https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1704)
    • run as root with argument "--override", install both CUDA (to /opt/cuda-9.1) and the DKMS driver (the current nvidia drivers from repository won't suffice)
      • DKMS might have a few problems with this procedure, so be aware your Xorg might fail to start after rebooting, in which case you have to trigger it manually. check on the build log and handle as necessary.
    • comment out line 121 (the one throwing an error for unsupported GCC versions) in /opt/cuda-9.1/include/crt/host_config.h
  • add the following to /usr/include/bits/floatn.h after the preprocessor block defining __HAVE_FLOAT128:
#if CUDART_VERSION
#undef __HAVE_FLOAT128
#define __HAVE_FLOAT128 0
#endif
  • create /etc/profile.d/cuda.sh with the following contents:
export CUDA_BIN_PATH=/opt/cuda-9.1/bin
export PATH="$CUDA_BIN_PATH:$PATH"
  • reboot to load the new modules