microsoft / antares

Antares: an automatic engine for multi-platform kernel generation and optimization. Supporting CPU, CUDA, ROCm, DirectX12, GraphCore, SYCL for CPU/GPU, OpenCL for AMD/NVIDIA, Android CPU/GPU backends.
Other
435 stars 45 forks source link

Fail to compile, when I use "AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares" #365

Closed Looong01 closed 1 year ago

Looong01 commented 1 year ago

Hey, there are my problems: image

And when I input this: image It returns this: image

Andinstalled, automatic this things: rocm-clang-ocl/focal,now 0.5.0.50401-84~20.04 amd64 [installed,automatic] rocm-cmake/focal,now 0.8.0.50401-84~20.04 amd64 [installed,automatic] rocm-core/focal,now 5.4.1.50401-84~20.04 amd64 [installed,automatic] rocm-dbgapi/focal,now 0.68.0.50401-84~20.04 amd64 [installed,automatic] rocm-debug-agent/focal,now 2.0.3.50401-84~20.04 amd64 [installed,automatic] rocm-dev/focal,now 5.4.1.50401-84~20.04 amd64 [installed] rocm-device-libs/focal,now 1.0.0.50401-84~20.04 amd64 [installed,automatic] rocm-dkms/focal,now 5.4.1.50401-84~20.04 amd64 [installed] rocm-gdb/focal,now 12.1.50401-84~20.04 amd64 [installed,automatic] rocm-llvm/focal,now 15.0.0.22465.50401-84~20.04 amd64 [installed,automatic] rocm-ocl-icd/focal,now 2.0.0.50401-84~20.04 amd64 [installed,automatic] rocm-opencl-dev/focal,now 2.0.0.50401-84~20.04 amd64 [installed] rocm-opencl/focal,now 2.0.0.50401-84~20.04 amd64 [installed,automatic] rocm-smi-lib/focal,now 5.0.0.50401-84~20.04 amd64 [installed,automatic] rocm-utils/focal,now 5.4.1.50401-84~20.04 amd64 [installed,automatic] rocminfo/focal,now 1.0.0.50401-84~20.04 amd64 [installed, automatic]

I succeed to use this: image

Looong01 commented 1 year ago

Ok, I use this: image

And then this: image It returns this: image

Looong01 commented 1 year ago

作者你好,如果你愿意用中文的话,还是中文我理解得比较好😂

Looong01 commented 1 year ago

Actually, I can quote "cmath" to compile things. image image

ghostplant commented 1 year ago

Have you installed CXX development dependencies in WSL? e.g.

sudo apt install g++
sudo apt install g++-mingw-w64-x86-64
Looong01 commented 1 year ago

Have you installed CXX development dependencies in WSL? e.g.

sudo apt install g++
sudo apt install g++-mingw-w64-x86-64

Yes.

ghostplant commented 1 year ago

Is this command successful in WSL?

echo -e '#include <cmath>\nint main() {}' > main.cpp && x86_64-w64-mingw32-g++ main.cpp
Looong01 commented 1 year ago

Is this command successful in WSL?

echo -e '#include <cmath>\nint main() {}' > main.cpp && x86_64-w64-mingw32-g++ main.cpp

It returned nothing, and generate an "a.exe" file. image

ghostplant commented 1 year ago

This is not an Antares environmental issue, but ROCm issue for HIP versions >= 5.3.0. Please use ROCm < 5.3.0 or follows: https://github.com/RadeonOpenCompute/ROCm/issues/1843

Looong01 commented 1 year ago

This is not an Antares environmental issue, but ROCm issue for HIP versions >= 5.3.0. Please use ROCm < 5.3.0 or follows: RadeonOpenCompute/ROCm#1843

Thank you! Now I have succeeded to install these and to run "AMDGFX=gfx1031 BACKEND=c-rocm_win64 Antares".

image

Does this mean I have successfully configured related environment for PyTorch for ROCm?

Now, how can I test if I have done this correctly? Command "rocminfo" still cannot work.

And I used "pip install" to install a ROCm version of PyTorch in anaconda virtual environment. And I encountered errors when I try to use "torch.cuda.is_available()". It returned:

/home/dragons/anaconda3/envs/PyTorch/lib/python3.9/site-packages/torch/cuda/init.py:88: UserWarning: HIP initialization: Unexpected error from hipGetDeviceCount(). Did you run some cuda functions before calling NumHipDevices() that might have already set an error? Error 101: hipErrorInvalidDevice (Triggered internally at ../c10/hip/HIPFunctions.cpp:110.) return torch._C._cuda_getDeviceCount() > 0