Skip to content

Instantly share code, notes, and snippets.

@reneruhr
Created December 30, 2022 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reneruhr/9851aff7a5bde3feee082d04fb421985 to your computer and use it in GitHub Desktop.
Save reneruhr/9851aff7a5bde3feee082d04fb421985 to your computer and use it in GitHub Desktop.
Cuda on Fedora

Current Fedora 36 does not have/support the latest (open) nvidia drivers, which requires to use an older cuda version 11.8 instead of 12. However, the g++12 compiler with that fedora is too new for this older cuda, so a custom gcc11 install is required. Brew solution explained here: https://www.reddit.com/r/Fedora/comments/usnu0x/comment/ig0t9y7/?utm_source=share&utm_medium=web2x&context=3

  1. brew install 'gcc@11'
  2. sudo ln -s /home/linuxbrew/.linuxbrew/Cellar/gcc@11/11.3.0/bin/g++-11 /usr/local/cuda/bin/g++

At some point, this causes some trouble after dynamically linking to a different libstdc++, which can be solved by making nvcc pass a static linking flag:

--compiler-options=-static-libstdc++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment