* Use CXX_FOR_CUDA to determine the compiler to pass to nvcc
* Add support for setting CMAKE_CUDA_ARCHITECTURES based on
the CUDA_ARCHITECTURES variable
Signed-off-by: Matt Madison <matt@madison.systems>
* Ran convert-overrides.py to generate the initial changes
* Manual cleanup afterwards (which was a lot, due to our
extensive use of overrides).
Signed-off-by: Matt Madison <matt@madison.systems>
Prepend our copy of the CUDA toolkit's bin directory to PATH,
rather than appending, so that build systems that search for
nvcc find our copy first for cross builds.
And for CMake, export CUDACXX to point to our copy of nvcc;
CMake will use that environment variable before looking in
the PATH.
Signed-off-by: Matt Madison <matt@madison.systems>
Fix the quoting used in the cmake toolchain files so that variable references
are interpreted by CMake rather than bitbake, and so that the resultant
value is a list rather than a single space-separated string.
Signed-off-by: Matt Madison <matt@madison.systems>
The dependency on the GPU driver is really in the libraries
provided by the tegra-libraries package, since it applies to
the libEGL_nvidia library as well as the libcuda library.
So move the RRECOMMENDS on the kernel driver to that package,
and drop it from cuda.bbclass.
Signed-off-by: Matt Madison <matt@madison.systems>
Note that a patch is required for meson 0.55 to
fix an issue with identifying CUDA compiler when
cross-building (see #409).
Signed-off-by: Matt Madison <matt@madison.systems>
cuda-toolkit includes the compiler and command-line tools, which
should *not* be required on the target; only the cuda-libraries
packages should be needed for building and running CUDA apps.
However, there are assumptions in the CUDA packages about the way
the CUDA SDK is normally packaged - with host and target files
co-located. In particular, there are host-side header files in
the cuda-nvcc package that need to be available in the target's
include tree so they can be found without explicitly including
the host-side include tree (something that isn't easy to do
when include paths get discovered via pkg-config).
To resolve this, the cuda-nvcc-headers recipe is added, which
packages just the header files from cuda-nvcc. Appropriate
dependencies are added to ensure that those headers are
available when needed.
Also included here are some variable updates to add in
the host-side includes, and some updates to the SDK
environment, particularly for CMake support, so that
it works properly with the new structure.
Signed-off-by: Matt Madison <matt@madison.systems>
This is mostly cleanup to align with the CUDA language
support that has been in CMake since version 3.8 - setting
the correct environment variables with the correct values
makes CMake's auto-discovery work better, so we can
remove much of the toolchain config file settings that
were there as workarounds.
The settings related to using FindCUDA are kept, for now.
Signed-off-by: Matt Madison <matt@madison.systems>
It is possible to build the nvgpu driver into the kernel,
instead of leaving it as a separate module, so don't cause
build failures in that case.
Signed-off-by: Matt Madison <matt@madison.systems>
Add kernel-module-nvgpu to CUDA run-time dependencies. Without
it CUDA 10 is not properly working and CUDA-capable devices are
NOT detected.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
cmake 3.8 and later have built-in language support for CUDA,
replacing the FindCUDA package finder. Add settings to support
this for Tegra cross-compilation.
[For #83 and #138]
Signed-off-by: Matt Madison <matt@madison.systems>
- rename target-specific flags CUDA_NVCC_ARCH_FLAGS
- add CUDA_NVCC_COMPAT_FLAGS for compiler-compatibility flags
- add CUDA_NVCC_EXTRA_FLAGS for recipes to use where needed
Signed-off-by: Matt Madison <matt@madison.systems>
for setting variables. The python expressions previously
used did not interact well with BBCLASSEXTEND, causing
build failures that were difficult to work around.
(Fixes#45)
Signed-off-by: Matt Madison <matt@madison.systems>
and just use bb.utils.contains in variable settings.
And switch back to using a machine override for setting
PACKAGE_ARCH, since doing that via the conditional is
proving to be problematic in some cases.
Signed-off-by: Matt Madison <matt@madison.systems>