简体   繁体   English

当我们有 2 个带有 NVLink 硬件组件的 NVIDIA/CUDA GPU 卡时如何正确使用 -Xnvlink 编译器选项

[英]How to properly use the -Xnvlink compiler options when we have 2 NVIDIA/CUDA GPU cards with NVLink hardware component

On Debian 10, I have 2 GPU cards RTX A6000 with NVlink hardware component and I would like to benefit of the potential combined power of both cards.在 Debian 10 上,我有 2 个带有 NVlink 硬件组件的 GPU 卡 RTX A6000,我希望受益于这两张卡的潜在组合功能。

Currently, I have the following magma.make invoked by a Makefile :目前,我有以下由 Makefile 调用的 magma.make :

CXX = nvcc -std=c++17 -O3
LAPACK = /opt/intel/oneapi/mkl/latest
LAPACK_ANOTHER=/opt/intel/mkl/lib/intel64
MAGMA = /usr/local/magma
INCLUDE_CUDA=/usr/local/cuda/include
LIBCUDA=/usr/local/cuda/lib64

SEARCH_DIRS_INCL=-I${MAGMA}/include -I${INCLUDE_CUDA} -I${LAPACK}/include
SEARCH_DIRS_LINK=-L${LAPACK}/lib/intel64 -L${LAPACK_ANOTHER} -L${LIBCUDA} -L${MAGMA}/lib

CXXFLAGS = -c -DMAGMA_ILP64 -DMKL_ILP64 -m64 ${SEARCH_DIRS_INCL}

LDFLAGS = ${SEARCH_DIRS_LINK} -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lcuda -lcudart -lcublas -lmagma -lpthread -lm -ldl -Xnvlink

SOURCES = main_magma.cpp XSAF_C_magma.cpp
EXECUTABLE = main_magma.exe

As you can see, I have use the last flag -Xnvlink but it generates the following error at compilation :如您所见,我使用了最后一个标志-Xnvlink但它在编译时生成以下错误:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:10: main_magma.exe] Error 1

How to use the right flag or options to include in the executable the combined power calls of 2 GPU with NVLink ?如何使用正确的标志或选项将 2 GPU 与 NVLink 的组合电源调用包含在可执行文件中?

I have use the last flag -Xnvlink ...我使用了最后一个标志 -Xnvlink ...

Let's consult some documentation :让我们查阅一些文档

The following table lists some useful nvlink options which can be specified with nvcc option --nvlink-options.

4.2.9.2.1. --disable-warnings (-w)
Inhibit all warning messages.

4.2.9.2.2. --preserve-relocs (-preserve-relocs)
Preserve resolved relocations in linked executable.

4.2.9.2.3. --verbose (-v)
Enable verbose mode which prints code generation statistics.

4.2.9.2.4. --warning-as-error (-Werror)
Make all warnings into errors.

4.2.9.2.5. --suppress-arch-warning (-suppress-arch-warning)
Suppress the warning that otherwise is printed when object does not contain code for target arch.

4.2.9.2.6. --suppress-stack-size-warning (-suppress-stack-size-warning)
Suppress the warning that otherwise is printed when stack size cannot be determined.

4.2.9.2.7. --dump-callgraph (-dump-callgraph)
Dump information about the callgraph and register usage.

It should be obvious from that text this option is for controlling the device linker behaviour during compilation, and that none of this has anything to do with NVLINK , which is a hardware interconnect technology.从该文本中可以明显看出,该选项用于在编译期间控制设备链接器的行为,而这与硬件互连技术NVLINK没有任何关系。

How to use the right flag or options to include in the executable the combined power calls of 2 GPU with NVLink ?如何使用正确的标志或选项将 2 GPU 与 NVLink 的组合电源调用包含在可执行文件中?

There is no flag or option.没有标志或选项。 There is no compiler assisted multi-gpu support.没有编译器辅助的多 GPU 支持。 You have to write your own multi-gpu code, or use a library where someone wrote it for you.您必须编写自己的多 GPU 代码,或者使用有人为您编写的库。 If such multi-gpu code is present in your executable, it will work without the need for any special compiler options or flags during compilation.如果您的可执行文件中存在这样的多 GPU 代码,则它可以在编译期间无需任何特殊的编译器选项或标志即可工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 包含时的编译器错误 <chrono> 在CUDA程序中-即使使用--std = c ++ 11 - Compiler error when including <chrono> in a CUDA program - even with --std=c++11 CMAKE - 如何为单个文件设置不同的编译器选项 - CMAKE - How to set different compiler options for a single file 尝试使用释放方法时发生编译器错误 - Compiler error when trying to use release method 使用Nvidia GPU计算工具包和Cygwin和Eclipse编译错误 - Compile errors using Nvidia GPU Computing toolkit and Cygwin with Eclipse CUDA 编译器无法编译出简单的测试程序 - CUDA compiler is unable to compile a simple test program Visual Studio 2002中的编译器选项? - Compiler options in Visual Studio 2002? ifort 中 linux 框上的编译器选项 - compiler options on linux box in ifort 我在使用编译器时遇到问题。 当我运行代码以剥离一串特殊字符时,它在一个编译器中运行,但不在另一个编译器中运行? - I have a situation with compiler. When i run the code to strip a string of special characters it runs in one compiler but doesn't in another? CUDA编译器不会在同一项目中编译C文件 - CUDA compiler doesn't compile C files in same project 编译 CUDA 程序时出错:一元“*”的类型参数无效(具有“int”) - Error when compiling a CUDA program: invalid type argument of unary ‘*’ (have ‘int’)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM