Skip to content

Linux: Hardcoded paths for cuda includes  #25

@dlesnoff

Description

@dlesnoff

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions