Skip to content

cargo install hvm gives error if CUDA 11.x is installed in parallel with CUDA 12.x #440

@atrithakar

Description

@atrithakar

Reproducing the behavior

I have CUDA 12.6 and 11.8 installed simultaneously in my system and when I ran cargo install hvm command, it gave this error:

PS C:\work_of_atri\bendlang> cargo install hvm
    Updating crates.io index
  Downloaded hvm v2.0.22
  Downloaded 1 crate (620.8KiB) in 0.40s
  Installing hvm v2.0.22
    Updating crates.io index
     Locking 30 packages to latest compatible versions
  Downloaded TSPL v0.0.13
  Downloaded num_cpus v1.17.0
  Downloaded highlight_error v0.1.1
  Downloaded cc v1.2.30
  Downloaded 4 crates (141.4KiB) in 0.23s
   Compiling windows_x86_64_msvc v0.52.6
   Compiling anstyle v1.0.11
   Compiling utf8parse v0.2.2
   Compiling once_cell_polyfill v1.70.1
   Compiling is_terminal_polyfill v1.70.1
   Compiling colorchoice v1.0.4
   Compiling shlex v1.3.0
   Compiling num_cpus v1.17.0
   Compiling clap_lex v0.7.5
   Compiling strsim v0.11.1
   Compiling highlight_error v0.1.1
   Compiling anstyle-parse v0.2.7
   Compiling cc v1.2.30
   Compiling TSPL v0.0.13
   Compiling hvm v2.0.22
   Compiling windows-targets v0.52.6
   Compiling windows-sys v0.59.0
   Compiling anstyle-wincon v3.0.9
   Compiling anstyle-query v1.1.3
   Compiling anstream v0.6.19
   Compiling clap_builder v4.5.41
   Compiling clap v4.5.41
warning: [email protected]: WARNING: Failed to compile/run.c: ToolExecError: command did not execute successfully (status code exit code: 2): "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-DTPC_L2=4" "-DIO" "-FoC:\\Users\\atri\\AppData\\Local\\Temp\\cargo-installuUIfpC\\release\\build\\hvm-ababa356e230b58e\\out\\ea708c7824d36062-run.o" "-c" "src/run.c"
warning: [email protected]: Ignoring/run.c and proceeding with build. The C runtime will not be available.
warning: [email protected]: Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU
warning: [email protected]: Compiler family detection failed due to error: ToolFamilyMacroNotFound: Expects macro `__clang__`, `__GNUC__` or `__EMSCRIPTEN__`, `__VXWORKS__` or accepts cl style flag `-?`, but found none
warning: [email protected]: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include\crt/host_config.h(153): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc 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.
error: failed to run custom build command for `hvm v2.0.22`

Caused by:
  process didn't exit successfully: `C:\Users\atri\AppData\Local\Temp\cargo-installuUIfpC\release\build\hvm-acbcee40d697617a\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-changed=src/run.c
  cargo:rerun-if-changed=src/hvm.c
  cargo:rerun-if-changed=src/run.cu
  cargo:rerun-if-changed=src/hvm.cu
  cargo:rustc-link-arg=-rdynamic
  OUT_DIR = Some(C:\Users\atri\AppData\Local\Temp\cargo-installuUIfpC\release\build\hvm-ababa356e230b58e\out)
  TARGET = Some(x86_64-pc-windows-msvc)
  cargo:rerun-if-env-changed=VCINSTALLDIR
  VCINSTALLDIR = None
  cargo:rerun-if-env-changed=VSTEL_MSBuildProjectFullPath
  VSTEL_MSBuildProjectFullPath = None
  cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE
  VSCMD_ARG_VCVARS_SPECTRE = None
  cargo:rerun-if-env-changed=WindowsSdkDir
  WindowsSdkDir = None
  cargo:rerun-if-env-changed=WindowsSDKVersion
  WindowsSDKVersion = None
  cargo:rerun-if-env-changed=LIB
  LIB = None
  PATH = Some(C:\Users\atri\AppData\Local\Temp\cargo-installuUIfpC\release\deps;C:\Users\atri\AppData\Local\Temp\cargo-installuUIfpC\release;C:\Users\atri\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Python313\Scripts\;C:\Python313\;C:\Program Files\NVIDIA\CUDNN\v9.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include;C:\ProgramData\chocolatey\bin;C:\Program Files\CMake\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2024.3.2\;C:\work_of_atri\yt\cul_video\project_cul\dist;C:\CUL;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Program Files\MongoDB\Server\8.0\bin;C:\Program Files\mongosh;C:\Program Files\7-Zip;C:\yt-dlp;C:\Program Files (x86)\cloudflared\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\PostgreSQL\17\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\work_of_atri\drogon\cmake-4.1.0-rc1-windows-x86_64\bin;C:\work_of_atri\drogon\drogon\build\drogon_ctl\Release;;C:\Program Files\NVIDIA Corporation\NVIDIA App\NvDLISR;C:\Users\atri\.cargo\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\atri\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\atri\AppData\Local\Programs\Python\Python312\;C:\Users\atri\AppData\Local\Microsoft\WindowsApps;C:\Users\atri\AppData\Local\Programs\Microsoft VS Code\bin;;C:\Users\atri\AppData\Local\Programs\Ollama;C:\Users\atri\AppData\Roaming\npm;C:\Program Files\mongosh\;C:\Users\atri\.dotnet\tools;C:\Program Files\JetBrains\RustRover 2025.1.5\bin;;C:\Users\atri\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin)
  cargo:rerun-if-env-changed=INCLUDE
  INCLUDE = None
  HOST = Some(x86_64-pc-windows-msvc)
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
  CC_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
  CC_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(cmpxchg16b,fxsr,sse,sse2,sse3)
  DEBUG = Some(false)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
  CFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
  CFLAGS_x86_64-pc-windows-msvc = None
  CARGO_ENCODED_RUSTFLAGS = Some()
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  run.c
  src/run.c(1): fatal error C1083: Cannot open include file: 'dlfcn.h': No such file or directory
  cargo:warning=WARNING: Failed to compile/run.c: ToolExecError: command did not execute successfully (status code exit code: 2): "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-DTPC_L2=4" "-DIO" "-FoC:\\Users\\atri\\AppData\\Local\\Temp\\cargo-installuUIfpC\\release\\build\\hvm-ababa356e230b58e\\out\\ea708c7824d36062-run.o" "-c" "src/run.c"
  cargo:warning=Ignoring/run.c and proceeding with build. The C runtime will not be available.
  cargo:rustc-link-search=native=/usr/local/cuda/lib64
  OUT_DIR = Some(C:\Users\atri\AppData\Local\Temp\cargo-installuUIfpC\release\build\hvm-ababa356e230b58e\out)
  OPT_LEVEL = Some(3)
  TARGET = Some(x86_64-pc-windows-msvc)
  cargo:rerun-if-env-changed=VCINSTALLDIR
  VCINSTALLDIR = None
  cargo:rerun-if-env-changed=VSTEL_MSBuildProjectFullPath
  VSTEL_MSBuildProjectFullPath = None
  cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE
  VSCMD_ARG_VCVARS_SPECTRE = None
  cargo:rerun-if-env-changed=WindowsSdkDir
  WindowsSdkDir = None
  cargo:rerun-if-env-changed=WindowsSDKVersion
  WindowsSDKVersion = None
  cargo:rerun-if-env-changed=LIB
  LIB = None
  PATH = Some(C:\Users\atri\AppData\Local\Temp\cargo-installuUIfpC\release\deps;C:\Users\atri\AppData\Local\Temp\cargo-installuUIfpC\release;C:\Users\atri\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Python313\Scripts\;C:\Python313\;C:\Program Files\NVIDIA\CUDNN\v9.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include;C:\ProgramData\chocolatey\bin;C:\Program Files\CMake\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2024.3.2\;C:\work_of_atri\yt\cul_video\project_cul\dist;C:\CUL;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Program Files\MongoDB\Server\8.0\bin;C:\Program Files\mongosh;C:\Program Files\7-Zip;C:\yt-dlp;C:\Program Files (x86)\cloudflared\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\PostgreSQL\17\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\work_of_atri\drogon\cmake-4.1.0-rc1-windows-x86_64\bin;C:\work_of_atri\drogon\drogon\build\drogon_ctl\Release;;C:\Program Files\NVIDIA Corporation\NVIDIA App\NvDLISR;C:\Users\atri\.cargo\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\atri\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\atri\AppData\Local\Programs\Python\Python312\;C:\Users\atri\AppData\Local\Microsoft\WindowsApps;C:\Users\atri\AppData\Local\Programs\Microsoft VS Code\bin;;C:\Users\atri\AppData\Local\Programs\Ollama;C:\Users\atri\AppData\Roaming\npm;C:\Program Files\mongosh\;C:\Users\atri\.dotnet\tools;C:\Program Files\JetBrains\RustRover 2025.1.5\bin;;C:\Users\atri\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin)
  cargo:rerun-if-env-changed=INCLUDE
  INCLUDE = None
  HOST = Some(x86_64-pc-windows-msvc)
  cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-msvc
  CXX_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_msvc
  CXX_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=NVCC_x86_64-pc-windows-msvc
  NVCC_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=NVCC_x86_64_pc_windows_msvc
  NVCC_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_NVCC
  HOST_NVCC = None
  cargo:rerun-if-env-changed=NVCC
  NVCC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler family detection failed since it does not define `__clang__`, `__GNUC__`, `__EMSCRIPTEN__` or `__VXWORKS__`, also does not accept cl style flag `-?`, fallback to treating it as GNU
  cargo:warning=Compiler family detection failed due to error: ToolFamilyMacroNotFound: Expects macro `__clang__`, `__GNUC__` or `__EMSCRIPTEN__`, `__VXWORKS__` or accepts cl style flag `-?`, but found none
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(cmpxchg16b,fxsr,sse,sse2,sse3)
  DEBUG = Some(false)
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc
  CXXFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc
  CXXFLAGS_x86_64-pc-windows-msvc = None
  CARGO_ENCODED_RUSTFLAGS = Some()
  cargo:warning=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include\crt/host_config.h(153): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc 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.
  run.cu

  --- stderr


  error occurred in cc-rs: command did not execute successfully (status code exit code: 2): "nvcc" "-ccbin=C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64\\cl.exe" "-Xcompiler" "-nologo" "-Xcompiler" "-MD" "-Xcompiler" "-O2" "-Xcompiler" "-Brepro" "-Xcompiler" "-W4" "-diag-suppress=177" "-diag-suppress=550" "-diag-suppress=20039" "-DIO" "-o" "C:\\Users\\atri\\AppData\\Local\\Temp\\cargo-installuUIfpC\\release\\build\\hvm-ababa356e230b58e\\out\\ccaff89d6479c741-run.o" "-c" "src/run.cu"


error: failed to compile `hvm v2.0.22`, intermediate artifacts can be found at `C:\Users\atri\AppData\Local\Temp\cargo-installuUIfpC`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

But when I temporarily deleted the CUDA 11.8, it worked without any errors.

System Settings

  • OS: Windows 11 24H2 26100.4652
  • CPU: Intel i7-13620H
  • GPU: RTX 4060
  • Cuda Version: 12.6 AND 11.8

Additional context

No response

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