# list support bucket ❯ scoop bucket known main extras versions nirsoft sysinternals php nerd-fonts nonportable java games # list bucket local ❯ scoop bucket list
Name Source Updated Manifests ---- ------ ------- --------- main https://github.com/ScoopInstaller/Main 2024/8/6 12:29:26 1337 extras https://gitee.com/scoop-bucket/extras.git 2024/8/6 8:35:51 2053
Name Version Source Updated Info ---- ------- ------ ------- ---- 7zip 24.07 main 2024-06-20 21:02:13 bat 0.24.0 main 2023-11-29 20:48:29 bottom 0.10.2 main 2024-08-06 15:21:29 broot 1.41.1 main 2024-08-05 10:24:13 cacert 2024-07-02 main 2024-07-03 10:43:22 cmake 3.30.2 main 2024-08-04 12:29:32 curl 8.9.1_1 main 2024-08-04 12:29:37 dark 3.14 main 2024-07-19 13:40:25 delta 0.17.0 main 2024-03-18 14:19:35 duf 0.8.1 main 2023-12-09 16:24:31 dust 1.1.1 main 2024-07-18 11:34:03 eza 0.18.24 main 2024-08-04 12:29:42 fastfetch 2.21.0 main 2024-08-05 16:54:07 fd 10.1.0 main 2024-05-10 10:55:01 file 5.45 main 2023-12-28 11:53:11 fzf 0.54.3 main 2024-08-04 12:29:48 gcc 13.2.0 main 2024-08-05 22:11:32 gdu 5.29.0 main 2024-07-16 15:09:31 git 2.46.0 main 2024-07-30 17:48:02 glow 1.5.1 main 2024-06-22 13:37:17 go 1.22.5 main 2024-07-03 10:44:28 grex 1.4.5 main 2024-03-09 13:16:11 gsudo 2.5.1 main 2024-05-31 15:47:23 helix 24.07 main 2024-07-15 11:32:41 hyperfine 1.18.0 main 2023-12-09 17:08:18 imagemagick 7.1.1-36 main 2024-08-02 10:41:01 innounp 0.50 main 2024-06-16 18:35:29 jq 1.7.1 main 2023-12-27 16:15:36 keyviz 1.0.6 extras 2024-06-16 18:35:35 lazygit 0.43.1 extras 2024-07-14 12:15:12 less 661 main 2024-07-01 20:00:40 llvm 18.1.8 main 2024-08-05 22:12:57 lua 5.4.7-2 main 2024-07-27 11:33:03 luarocks 3.11.1 main 2024-07-16 01:04:19 make 4.4.1 main 2023-11-29 21:01:44 miller 6.12.0 main 2024-06-22 13:41:01 miniconda3 24.5.0-0 extras 2024-07-19 13:49:32 mpv 0.38.0 extras 2024-06-19 21:20:39 neovide 0.13.3 extras 2024-07-18 11:34:07 neovim 0.10.1 main 2024-07-27 12:15:40 ninja 1.12.1 main 2024-05-18 13:33:50 nodejs 22.5.1 main 2024-07-21 17:02:34 onefetch 2.21.0 extras 2024-06-27 16:02:02 ouch 0.5.1 main 2024-06-22 13:43:50 poppler 24.07.0-0 main 2024-07-27 22:41:12 procs 0.14.6 main 2024-07-30 17:51:00 ripgrep 14.1.0 main 2024-01-09 20:52:55 ruby 3.3.4-1 main 2024-07-12 11:28:59 rust-analyzer 2024-08-05 main 2024-08-05 16:54:10 scoop-search 1.5.0 main 2024-07-10 10:40:35 sd 1.0.0 main 2023-12-09 16:55:11 starship 1.20.1 main 2024-07-27 22:42:34 tealdeer 1.6.1 main 2023-12-09 16:26:07 tokei 12.1.2 main 2023-11-29 20:46:57 tree-sitter 0.22.6 main 2024-05-10 10:55:49 unar 1.8.1 main 2023-12-27 16:15:44 wezterm 20240203-110809-5046fc22 extras 2024-03-06 17:29:06 wget 1.21.4 main 2023-11-29 22:29:31 which 2.20 main 2023-12-02 14:27:18 whkd 0.2.1 extras 2024-04-11 16:23:03 yarn 1.22.22 main 2024-05-25 22:07:31 zoxide 0.9.4 main 2024-02-22 12:17:08
❯ which nvcc /opt/nvidia/hpc_sdk/Linux_x86_64/24.7/compilers/bin/nvcc ❯ nvc -V
nvc 24.7-0 64-bit target on x86-64 Linux -tp alderlake NVIDIA Compilers and Tools Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. ❯ nvc++ -V
nvc++ 24.7-0 64-bit target on x86-64 Linux -tp alderlake NVIDIA Compilers and Tools Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. ❯ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Thu_Jun__6_02:18:23_PDT_2024 Cuda compilation tools, release 12.5, V12.5.82 Build cuda_12.5.r12.5/compiler.34385749_0 ❯ nvfortran -V
nvfortran 24.7-0 64-bit target on x86-64 Linux -tp alderlake NVIDIA Compilers and Tools Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
❯ nvcc main.cu In file included from /opt/nvidia/hpc_sdk/Linux_x86_64/24.7/cuda/12.5/include/cuda_runtime.h:82, from <command-line>: /opt/nvidia/hpc_sdk/Linux_x86_64/24.7/cuda/12.5/include/crt/host_config.h:143:2: error: #error - - unsupported GNU version! gcc versions later than 13 are not supported! The nvcc flag '-allow-u nsupported-compiler' can be used to override this version check; however, using an unsupported h ost compiler may cause compilation failure or incorrect run time execution. Use at your own risk . 143 | #error -- unsupported GNU version! gcc versions later than 13 are not supported! The nvc c flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
nvcc -ccbin gcc-13 main.cu ./a.out hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU!
也可以直接用nvc++编译(如果下载的有hpc-sdk的话):
1 2 3 4 5 6 7 8 9 10 11 12
❯ nvc++ main.cu ❯ ./a.out hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU!
#include<cuda_runtime.h> #include<stdio.h> #include<iostream> __global__ voidcuda_hello(){ printf("hello world from GPU!\n"); }
automain() -> int { cuda_hello<<<1, 10>>>(); cudaDeviceReset();
std::cout << "Hello world from CPU use STL!" << std::endl;
return0; }
此时继续编译会报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
❯ nvcc -ccbin gcc-13 main.cu /usr/sbin/ld: /tmp/tmpxft_0001c412_00000000-11_main.o: warning: relocation again st `_ZSt4cout' in read-only section `.text' /usr/sbin/ld: /tmp/tmpxft_0001c412_00000000-11_main.o: infunction `main': tmpxft_0001c412_00000000-6_main.cudafe1.cpp:(.text+0xa6): undefined reference to `std::cout' /usr/sbin/ld: tmpxft_0001c412_00000000-6_main.cudafe1.cpp:(.text+0xae): undefine d reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator << <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /usr/sbin/ld: tmpxft_0001c412_00000000-6_main.cudafe1.cpp:(.text+0xb5): undefine d reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<cha r, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' /usr/sbin/ld: tmpxft_0001c412_00000000-6_main.cudafe1.cpp:(.text+0xc0): undefine d reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' /usr/sbin/ld: warning: creating DT_TEXTREL in a PIE collect2: error: ld returned 1 exit status
加上-lstdc++命令之后成功:
1 2 3 4 5 6 7 8 9 10 11 12 13
❯ nvcc -ccbin gcc-13 main.cu -lstdc++ ❯ ./a.out hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! Hello world from CPU use STL!
cmake .. && make -j -- The CUDA compiler identification is NVIDIA 12.5.82 -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Check for working CUDA compiler: /opt/cuda/bin/nvcc - skipped -- Detecting CUDA compile features -- Detecting CUDA compile features - done -- Configuring done (3.7s) -- Generating done (0.0s) -- Build files have been written to: /home/mafu/Documents/cuda/0/build [ 33%] Building CUDA object CMakeFiles/test.dir/main.cu.o [ 66%] Linking CUDA device code CMakeFiles/test.dir/cmake_device_link.o [100%] Linking CUDA executable test [100%] Built target test ./test hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU! hello world from GPU!
cmake .. && make -j CMake Error at /usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake:838 (message): Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
❯ cmake .. && make -j -- The CUDA compiler identification is NVIDIA 12.5.82 -- The CXX compiler identification is GNU 14.2.1 -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Check for working CUDA compiler: /opt/cuda/bin/nvcc - skipped -- Detecting CUDA compile features -- Detecting CUDA compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/sbin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done (4.7s) -- Generating done (0.0s) -- Build files have been written to: /home/mafu/Documents/cuda/test/build [ 40%] Building CUDA object CMakeFiles/cuda_project.dir/kernel1.cu.o [ 40%] Building CXX object CMakeFiles/cuda_project.dir/main.cpp.o [ 60%] Building CUDA object CMakeFiles/cuda_project.dir/kernel2.cu.o [ 80%] Linking CUDA device code CMakeFiles/cuda_project.dir/cmake_device_link.o [100%] Linking CXX executable cuda_project [100%] Built target cuda_project ❯ ./cuda_project Calling kernel1 Hello from kernel1 Calling kernel2 Hello from kernel2