Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: Hardcoded paths for cuda includes #25

Open
dlesnoff opened this issue Oct 20, 2024 · 1 comment
Open

Linux: Hardcoded paths for cuda includes #25

dlesnoff opened this issue Oct 20, 2024 · 1 comment

Comments

@dlesnoff
Copy link

On Archlinux, I wasn't able to compile the FFT example.
I made a specific config.nims file in the example directory from the nimble file and echo'ed all the pathes included.

It turns out that the current nimble file expects cuda to be installed under /usr/local.

Actually, on Archlinux, the CUDA library is installed under /opt/cuda. See GPGPU - ArchWiki
My config.nims file looks like the following:

var version=cuda12_6
--hints: off
--linedir: on
--stacktrace: on
--linetrace: on
--debuginfo
switch("cincludes", "/opt/cuda/targets/x86_64-linux/include")
switch("clibdir", "/opt/cuda/targets/x86_64-linux/lib")
switch("path", thisDir() / nimcudaSourceDir(version))
--run

As mentioned in the ArchWiki, one wants to setup environment variables by running a similar script to cuda.sh and using CUDA_PATH in place of the currently hardcoded paths in nimble.

export CUDA_PATH=/opt/cuda
append_path '/opt/cuda/bin'
append_path '/opt/cuda/nsight_compute'
append_path '/opt/cuda/nsight_systems/bin'
export PATH


# Set the default host compiler for nvcc. This will need to be switched back
# and forth between the latest and previous GCC version, whatever nvcc
# currently supports.
export NVCC_CCBIN='/usr/bin/g++-13'
@lilkeet
Copy link
Contributor

lilkeet commented Oct 20, 2024

Cuda install autodetection is a much needed feature! 😄

@dlesnoff dlesnoff changed the title Linux: Hardcoded pathes for cuda includes Linux: Hardcoded paths for cuda includes Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants