You are not logged in.

#1 2021-07-16 08:23:22

JamesWelchman
Member
Registered: 2018-12-12
Posts: 4

Compiler Error: Rust-cc and Cuda nvcc - “std::pair” is missing.

I'm trying to build a rust project which includes CUDA C components.

I asked the question on Stack Overflow: https://stackoverflow.com/questions/684 … is-missing

At the time of writing I have received one answer, which suggests that CUDA and GNU versions are incompatible?

Here are my versions:

$ pacman -Q cuda
cuda 11.3.1-1

pacman -Q gcc
gcc 11.1.0-1

Last edited by JamesWelchman (2021-07-16 08:24:30)

Offline

#2 2021-07-16 10:41:20

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,267
Website

Re: Compiler Error: Rust-cc and Cuda nvcc - “std::pair” is missing.

$ LANG=C pacman -Si cuda
Repository      : community
Name            : cuda
Version         : 11.3.1-1
Description     : NVIDIA's GPU programming toolkit
Architecture    : x86_64
URL             : https://developer.nvidia.com/cuda-zone
Licenses        : custom:NVIDIA
Groups          : None
Provides        : cuda-toolkit  cuda-sdk  libcudart.so=11.0-64  libcublas.so=11-64  libcublas.so=11-64  libcusolver.so=11-64  libcusolver.so=11-64  libcusparse.so=11-64  libcusparse.so=11-64
Depends On      : gcc10  gcc10-libs  opencl-nvidia  nvidia-utils  python
Optional Deps   : gdb: for cuda-gdb
                  glu: required for some profiling tools in CUPTI
Conflicts With  : None
Replaces        : cuda-toolkit  cuda-sdk  cuda-static
Download Size   : 1220.59 MiB
Installed Size  : 3512.80 MiB
Packager        : Konstantin Gizdov <arch@kge.pw>
Build Date      : Wed Jun 9 15:39:17 2021
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Depends On      : gcc10  gcc10-libs
So the deps are okay.
I suspect you need to tell cuda to use gcc10 in your respective tool chain.

Offline

#3 2021-07-16 11:45:27

JamesWelchman
Member
Registered: 2018-12-12
Posts: 4

Re: Compiler Error: Rust-cc and Cuda nvcc - “std::pair” is missing.

Thanks for your reply.

> Depends On      : gcc10  gcc10-libs

Curiously I was able to install cuda with pacman and it didn't pull the gcc10 dependency.
Should this happen?

I couldn't find any comments in the arch cuda package but the cuda guide wants gcc9.0.
https://docs.nvidia.com/cuda/cuda-insta … index.html

I've grabbed gcc10 and now I'm running this command.

$ CXX=/usr/bin/g++-10 cargo build --release --verbose

"cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.0.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.1.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.10.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.11.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.12.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.13.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.14.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.15.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.2.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.3.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.4.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.5.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.6.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.7.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.8.rcgu.o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.mnist.2jdlgxjm-cgu.9.rcgu.o" "-o" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963" "/home/james/code/mnist/target/release/deps/mnist-f9a81a831eb4a963.19tmlt04v5enqxs5.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/james/code/mnist/target/release/deps" "-L" "/home/james/code/mnist/target/release/build/mnist-74dea98666938639/out" "-L" "/home/james/code/mnist/target/release/build/openblas-src-28e7769193a69e07/out" "-L" "/opt/cuda/targets/x86_64-linux/lib" "-L" "/usr/lib" "-L" "/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0" "-L" "/opt/cuda/targets/x86_64-linux/lib" "-L" "/usr/lib" "-L" "/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0" "-L" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-lgpu" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-lstdc++" "-Wl,-Bstatic" "/home/james/code/mnist/target/release/deps/libndarray_rand-a84decaa45fc2b72.rlib" "/home/james/code/mnist/target/release/deps/librand_distr-98f4ad58fea5358a.rlib" "/home/james/code/mnist/target/release/deps/libndarray-1518e71d11dbbf04.rlib" "/home/james/code/mnist/target/release/deps/libmatrixmultiply-8ece0539805c5f7d.rlib" "/home/james/code/mnist/target/release/deps/libapprox-30d51eb6be9a35b5.rlib" "/home/james/code/mnist/target/release/deps/libnum_complex-8ef6ec5327cf7f9a.rlib" "/home/james/code/mnist/target/release/deps/libserde-4407c63dc5c4150e.rlib" "/home/james/code/mnist/target/release/deps/librand-5e6f67741034948d.rlib" "/home/james/code/mnist/target/release/deps/librand_chacha-d48dd00a88898fa3.rlib" "/home/james/code/mnist/target/release/deps/libppv_lite86-6d65781791a3d15c.rlib" "/home/james/code/mnist/target/release/deps/librand_core-ee360949046c2e28.rlib" "/home/james/code/mnist/target/release/deps/libgetrandom-0da57c2067c8325a.rlib" "/home/james/code/mnist/target/release/deps/libcfg_if-048c2fa9f5217d0e.rlib" "/home/james/code/mnist/target/release/deps/libnum_integer-c01debf63b4c9333.rlib" "/home/james/code/mnist/target/release/deps/libnum_traits-e24a2f9d82b8295a.rlib" "/home/james/code/mnist/target/release/deps/librawpointer-1090dcf607e22c5b.rlib" "/home/james/code/mnist/target/release/deps/libcblas_sys-c712fdb0d17f0f87.rlib" "/home/james/code/mnist/target/release/deps/liblibc-93c4f1fe058e2c07.rlib" "-Wl,--start-group" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-0a9489cf400f65e4.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-ff5dc44c66f8c479.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-3317c66a83501f9c.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-5d8dec11fc25537d.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-3af2a9328550e2a6.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-3092e2ecef0f49f1.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-29b776c021389465.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-e8873bd287db0d28.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-1171b49d77e47426.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-c29894d22dc88b51.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-796a7750df3d8218.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-ff7772d803d3e0de.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-dae3eac9cfa44200.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-0fa02f580e987af5.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-7f7254233be843ed.rlib" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-1395c6db3d116086.rlib" "-Wl,--end-group" "/home/james/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b4bd87926720b651.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
= note: /usr/bin/ld: /home/james/code/mnist/target/release/build/mnist-74dea98666938639/out/libgpu.a(conv.o): in function `__cudaUnregisterBinaryUtil()':
          tmpxft_00019b48_00000000-6_conv.cudafe1.cpp:(.text._ZL26__cudaUnregisterBinaryUtilv+0x8): undefined reference to `__cudaUnregisterFatBinary'
          /usr/bin/ld: /home/james/code/mnist/target/release/build/mnist-74dea98666938639/out/libgpu.a(conv.o): in function `__device_stub__Z4_sumPKfS0_Pfi(float const*, float const*, float*, int)':
          tmpxft_00019b48_00000000-6_conv.cudafe1.cpp:(.text._Z30__device_stub__Z4_sumPKfS0_PfiPKfS0_Pfi+0xa0): undefined reference to `__cudaPopCallConfiguration'
          /usr/bin/ld: tmpxft_00019b48_00000000-6_conv.cudafe1.cpp:(.text._Z30__device_stub__Z4_sumPKfS0_PfiPKfS0_Pfi+0xd3): undefined reference to `cudaLaunchKernel'
          /usr/bin/ld: /home/james/code/mnist/target/release/build/mnist-74dea98666938639/out/libgpu.a(conv.o): in function `sum':
          tmpxft_00019b48_00000000-6_conv.cudafe1.cpp:(.text.sum+0x35): undefined reference to `__cudaPushCallConfiguration'
          /usr/bin/ld: /home/james/code/mnist/target/release/build/mnist-74dea98666938639/out/libgpu.a(conv.o): in function `__sti____cudaRegisterAll()':
          tmpxft_00019b48_00000000-6_conv.cudafe1.cpp:(.text.startup._ZL24__sti____cudaRegisterAllv+0xc): undefined reference to `__cudaRegisterFatBinary'
          /usr/bin/ld: tmpxft_00019b48_00000000-6_conv.cudafe1.cpp:(.text.startup._ZL24__sti____cudaRegisterAllv+0x3d): undefined reference to `__cudaRegisterFunction'
          /usr/bin/ld: tmpxft_00019b48_00000000-6_conv.cudafe1.cpp:(.text.startup._ZL24__sti____cudaRegisterAllv+0x4d): undefined reference to `__cudaRegisterFatBinaryEnd'

Maybe the problem is that the linker isn't including -lcudart?

My main question now, is what do you mean by tool chain?
I assume the compiler/headers/libs tech stack but I'm unsure how to proceed and configure it.

Offline

#4 2021-07-16 12:00:29

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,267
Website

Re: Compiler Error: Rust-cc and Cuda nvcc - “std::pair” is missing.

JamesWelchman wrote:

Curiously I was able to install cuda with pacman and it didn't pull the gcc10 dependency.
Should this happen?

Unless you're doing partial upgrades, which you should not, or you're using f'ked up mirrors, this should not happen, no.

Last edited by schard (2021-07-16 12:00:43)

Offline

Board footer

Powered by FluxBB