Skip to content

Instantly share code, notes, and snippets.

@nonchip
Last active October 9, 2023 03:30
Show Gist options
  • Save nonchip/2c93ff2d9bc1bf2cd12bc6e76010da0f to your computer and use it in GitHub Desktop.
Save nonchip/2c93ff2d9bc1bf2cd12bc6e76010da0f to your computer and use it in GitHub Desktop.

Cuda and current compilers

NVidia is archaic as f..., so they don't officially support any current compiler.

but I found a bunch of ugly hacks to make it work with:

  • gcc 7.3.0
  • cuda 9.1.85_387.26
    • install from the .run file with argument --override so it asks you if you're ok with having an unsupported system instead of failing because you're not using ages old ubuntu :P
    • install the CUDA toolkit, but not the (often older than OS provided) GPU driver and not the examples.
    • also install to /opt/cuda-9.1 because your're not your package manager and it doesn't belong into /usr/!
    • then comment out line 121 of /opt/cuda-9.1/include/crt/host_config.h (the one #erroring about unsupported gcc version)
  • ugly low level include file hack:
    • edit /usr/include/bits/floatn.h, adding the following after the #if/#else/#endif block that sets __HAVE_FLOAT128:
#if CUDART_VERSION
#undef __HAVE_FLOAT128
#define __HAVE_FLOAT128 0
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment