Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HVM install issue on Windows 11 #292

Open
Ryalith opened this issue May 18, 2024 · 1 comment
Open

HVM install issue on Windows 11 #292

Ryalith opened this issue May 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Ryalith
Copy link

Ryalith commented May 18, 2024

hvm v2.0.8 installation fails on latest Windows 11 release

Steps to reproduce the behavior:

  1. Running command cargo +nightly install hvm as per README.md
  2. Error message :
error: failed to run custom build command for `hvm v2.0.8`

Caused by:
  process didn't exit successfully: `C:\Users\Anon\AppData\Local\Temp\cargo-installFM9MXi\release\build\hvm-9e64cdef384dbb66\build-script-build` (exit code: 1)
  --- stderr

  error occurred: Command "nvcc" "-ccbin=C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\cl.exe" "-Xcompiler" "-nologo" "-Xcompiler" "-MD" "-Xcompiler" "-O2" "-Xcompiler" "-Brepro" "-Xcompiler" "-W4" "-o" "C:\\Users\\Anon\\AppData\\Local\\Temp\\cargo-installFM9MXi\\release\\build\\hvm-dc525ed22444a051\\out\\2e40c9e35e9506f4-hvm.o" "-c" "src/hvm.cu" with args nvcc did not execute successfully (status code exit code: 2).

  • OS: [Windows 11]
  • CPU: [AMD Ryzen 7 6800H with Radeon Graphics]
  • GPU: [RTX 3060]
  • Cuda Version [release 11.8, V11.8.89]

Additionnal context:
Note that ccbin is set to a path that seems to use Visual Studio despite the fact that i've never used visual studio with rust or CUDA.

See full error message with context below:

PS C:\Users\Anon> cargo --version
cargo 1.80.0-nightly (4de0094ac 2024-05-09)

PS C:\Users\Anon> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

PS C:\Users\Anon> cargo +nightly install hvm
    Updating crates.io index
  Installing hvm v2.0.8
    Updating crates.io index
     Locking 29 packages to latest compatible versions
   Compiling windows_x86_64_msvc v0.52.5
   Compiling utf8parse v0.2.1
   Compiling anstyle v1.0.7
   Compiling colorchoice v1.0.1
   Compiling is_terminal_polyfill v1.70.0
   Compiling cc v1.0.97
   Compiling num_cpus v1.16.0
   Compiling clap_lex v0.7.0
   Compiling strsim v0.11.1
   Compiling highlight_error v0.1.1
   Compiling anstyle-parse v0.2.4
   Compiling TSPL v0.0.12
   Compiling windows-targets v0.52.5
   Compiling windows-sys v0.52.0
   Compiling anstyle-query v1.0.3
   Compiling anstyle-wincon v3.0.3
   Compiling anstream v0.6.14
   Compiling clap_builder v4.5.2
   Compiling hvm v2.0.8
   Compiling clap v4.5.4
The following warnings were emitted during compilation:

warning: [email protected]: Compiler family detection failed due to error: ToolExecError: Command "nvcc" "-E" "C:\\Users\\Anon\\AppData\\Local\\Temp\\cargo-installFM9MXi\\release\\build\\hvm-dc525ed22444a051\\out\\4756301994413220595detect_compiler_family.c" with args nvcc did not execute successfully (status code exit code: 1).

error: failed to run custom build command for `hvm v2.0.8`

Caused by:
  process didn't exit successfully: `C:\Users\Anon\AppData\Local\Temp\cargo-installFM9MXi\release\build\hvm-9e64cdef384dbb66\build-script-build` (exit code: 1)
  --- stderr


  error occurred: Command "nvcc" "-ccbin=C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\cl.exe" "-Xcompiler" "-nologo" "-Xcompiler" "-MD" "-Xcompiler" "-O2" "-Xcompiler" "-Brepro" "-Xcompiler" "-W4" "-o" "C:\\Users\\Anon\\AppData\\Local\\Temp\\cargo-installFM9MXi\\release\\build\\hvm-dc525ed22444a051\\out\\2e40c9e35e9506f4-hvm.o" "-c" "src/hvm.cu" with args nvcc did not execute successfully (status code exit code: 2).


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

@sepcnt
Copy link

sepcnt commented May 18, 2024

I managed to get it works on Windows 11.
Things got a little tricky:

  • /experimental:c11atomics and -std=c11 is required for stdatomic
  • Extremely large array (>=2GB) is not allowed on Windows so we have to use a pointer instead
  • CUDA also needs some work for allocation
  • threads.h rather than pthreads.h for compatibility.

All of them settled in #294

@kings177 kings177 added the enhancement New feature or request label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants