Comments (49)
This allows you execute __global__ function
based source code on windows. It means, you can use driver-level programming for Win64 execution to make ROCm kernels run efficiently just with native RX6700 driver for Windows.
Antares treats ROCm for Windows as a special-hardware backend, and can generate any IR-based efficient kernel to build up that __global__ function
, e.g. MatMul/Transpose/Conv/..
from antares.
/opt/rocm/bin/hipcc ~/.cache/antares/cache/_/my_kernel.cc --genco -O2 --amdgpu-target=gfx1031 -Wno-ignored-attributes -o /tmp/out.hsaco
am i supposed to get nothing?
from antares.
from antares.
Have you installed with pip3 install --upgrade antares
in wsl2? After that, antares cmd will be available in PATH. Secondly, you don't need to compile it from source. Just run BACKEND=c-rocm_win64 antares
for a trial.
BTW, in wsl2, you need to install rocm compiler according to 'https://sep5.readthedocs.io/en/latest/Installation_Guide/Installation-Guide.html#performing-an-opencl-only-installation-of-rocm', making sure command /opt/rocm/bin/hipcc
is installed in wsl successfully.
from antares.
it seems restarting ubuntu in wls2 helped, the BACKEND=c-rocm_win64 antares gave me [Antares] Incorrect compute kernel from evaluator. I havent installed the rocm compiler, i will proceed to do so
from antares.
Is this command working?
/opt/rocm/bin/hipcc ~/.cache/antares/cache/_/my_kernel.cc --genco -O2 --amdgpu-target=gfx1031 -Wno-ignored-attributes -o /tmp/out.hsaco
from antares.
Is this command working?
/opt/rocm/bin/hipcc ~/.cache/antares/cache/_/my_kernel.cc --genco -O2 --amdgpu-target=gfx1031 -Wno-ignored-attributes -o /tmp/out.hsaco
i haven't installed rocm yet, do i need to install a previous version?, or do i install the newest 5.1.1 which has support for gfx1030
from antares.
Have you installed with
pip3 install --upgrade antares
in wsl2? After that, antares cmd will be available in PATH. Secondly, you don't need to compile it from source. Just runBACKEND=c-rocm_win64 antares
for a trial.BTW, in wsl2, you need to install rocm compiler according to 'https://sep5.readthedocs.io/en/latest/Installation_Guide/Installation-Guide.html#performing-an-opencl-only-installation-of-rocm', making sure command
/opt/rocm/bin/hipcc
is installed in wsl successfully.
from antares.
Have you installed with
pip3 install --upgrade antares
in wsl2? After that, antares cmd will be available in PATH. Secondly, you don't need to compile it from source. Just runBACKEND=c-rocm_win64 antares
for a trial.
BTW, in wsl2, you need to install rocm compiler according to 'https://sep5.readthedocs.io/en/latest/Installation_Guide/Installation-Guide.html#performing-an-opencl-only-installation-of-rocm', making sure command/opt/rocm/bin/hipcc
is installed in wsl successfully.
These two packages dkms
rocm-dkms
is not needed for WSL. Please install the rest packages and finally ensure command /opt/rocm/bin/hipcc
can work.
from antares.
ok i installed rocm-opencl-dev and rocm-dev afterthat i got this
from antares.
That's great. Next you need to install an upgrade antares version.
pip3 install --upgrade antares==0.3.13.1 # If it fails, it means the PYPI repo is not up-to-date, please re-run this command until it succeed.
# Then, try show the output for this command:
AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares
from antares.
i have succesfully updated, however i got a hip error no binary for gpu :c
That's great. Next you need to install an upgrade antares version.
pip3 install --upgrade antares==0.3.13.1 # If it fails, it means the PYPI repo is not up-to-date, please re-run this command until it succeed. # Then, try show the output for this command: AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares
from antares.
gfx1031 is possibly not the corresponding spec name for your GPU.
Or your AMD driver for Windows is not up-to-date,
or not in the worst case, not supporting this spec.
from antares.
gfx1031 is possibly not the corresponding spec name for your GPU.
how can i know?
from antares.
My GPU is an RX 6800m which it's pretty much a rx6700 xt with tdp limit of 145, ubuntu said it was a gfx 1031 when i installed it
from antares.
Please guess and try other numbers like 1030, 1010, etc.
from antares.
Please guest and try other numbers like 1030, 1010, etc.
i have 2 amd gpu doe, the rx 6800m and a vega one that is integrated, do i need to specify that?
from antares.
What is the gfx number for the vega one?
from antares.
What is the gfx number for the vega one?
is there a command to check that?
from antares.
What is the full model name of Vega GPU?
from antares.
it literally just says amd radeon tm graphics, according to the wiki its a vega 8 gpu
from antares.
the rx6800m says it's navi22 XTM
from antares.
Maybe you can temporarily disable the Vega GPU in windows device manager for this test.
from antares.
Maybe you can temporarily disable the Vega GPU in windows device manager for this test.
i do not have a mux switch, i will try to select ubuntu or wsl to use the rx6800m
from antares.
from antares.
Maybe you can temporarily disable the Vega GPU in windows device manager for this test.
from antares.
Maybe you can temporarily disable the Vega GPU in windows device manager for this test.
Nop, rocminfo is not the suitable test command. I don't think the "new error" is related to our topic. After you disable Vega GPU in "Windows Device Manager", Please try:
antares clean
AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares
from antares.
Maybe you can temporarily disable the Vega GPU in windows device manager for this test.
Nop, rocminfo is not the suitable test command. I don't think the "new error" is related to our topic. After you disable Vega GPU in "Windows Device Manager", Please try:
antares clean AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares
i fear that if i disable it i won't have a screen input, since the vega 8 gpu is the one connected to the laptop display, not the rx6800m
from antares.
OK, since you don't know which GPU is the enabled one.
Firstly please try which of the following typical spec settings can work:
antares clean
AMDGFX=gfx803 BACKEND=c-rocm_win64 antares
AMDGFX=gfx900 BACKEND=c-rocm_win64 antares
AMDGFX=gfx902 BACKEND=c-rocm_win64 antares
AMDGFX=gfx906 BACKEND=c-rocm_win64 antares
AMDGFX=gfx908 BACKEND=c-rocm_win64 antares
AMDGFX=gfx1010 BACKEND=c-rocm_win64 antares
AMDGFX=gfx1030 BACKEND=c-rocm_win64 antares
from antares.
OK, since you don't know which GPU is the enabled one.
Firstly please try which of the following typical spec settings can work:
antares clean AMDGFX=gfx803 BACKEND=c-rocm_win64 antares AMDGFX=gfx900 BACKEND=c-rocm_win64 antares AMDGFX=gfx902 BACKEND=c-rocm_win64 antares AMDGFX=gfx906 BACKEND=c-rocm_win64 antares AMDGFX=gfx908 BACKEND=c-rocm_win64 antares AMDGFX=gfx1010 BACKEND=c-rocm_win64 antares AMDGFX=gfx1030 BACKEND=c-rocm_win64 antares
Nothing, not a single one worked
from antares.
OK, since you don't know which GPU is the enabled one.
Firstly please try which of the following typical spec settings can work:
antares clean AMDGFX=gfx803 BACKEND=c-rocm_win64 antares AMDGFX=gfx900 BACKEND=c-rocm_win64 antares AMDGFX=gfx902 BACKEND=c-rocm_win64 antares AMDGFX=gfx906 BACKEND=c-rocm_win64 antares AMDGFX=gfx908 BACKEND=c-rocm_win64 antares AMDGFX=gfx1010 BACKEND=c-rocm_win64 antares AMDGFX=gfx1030 BACKEND=c-rocm_win64 antares
does it affect that i'm, in wsl2?
from antares.
Please open this file via vim:
vi ~/.local/lib/python3.8/site-packages/antares_core/backends/c-rocm_win64/include/backend.hpp
For the content, please fully replace the original init function with this updated function:
void init(int dev) {
ab::hLibDll = LoadLibrary(AMDHIP64_LIBRARY_PATH);
CHECK(hLibDll, "Cannot find `" AMDHIP64_LIBRARY_PATH "` !\n");
int gpu_count = -1;
LOAD_ONCE(hipGetDeviceCount, int (*)(int*));
CHECK(0 == hipGetDeviceCount(&gpu_count), "Failed to run hipGetDeviceCount().");
fprintf(stderr, "@@ hipGetDeviceCount = %d\n", gpu_count);
LOAD_ONCE(hipSetDevice, int (*)(int));
CHECK(0 == hipSetDevice(dev), "Failed initialize AMD ROCm device with `" AMDHIP64_LIBRARY_PATH "` (No AMDGPU installed or enabled?).");
_current_device = dev;
}
After saving, please re-run AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares
and show the output of logging, which will include whether Windows ROCm driver detects at least 1 GPU.
from antares.
If you see @@ hipGetDeviceCount = 0
, it means the current Windows ROCm driver doesn't even recognize at least 1 GPU from two you have. If it is @@ hipGetDeviceCount = 1
, it means it is supported, but the gfx number is incorrect.
from antares.
If you see
@@ hipGetDeviceCount = 0
, it means the current Windows ROCm driver doesn't even recognize at least 1 GPU from two you have. If it is@@ hipGetDeviceCount = 1
, it means it is supported, but the gfx number is incorrect.
from antares.
2 means both 2 gpu will be supported. (Vega 8 and RX6700). Thus, you need to link to correct GPU ID and correct GFX number:
Please re-open this file via vim:
vi ~/.local/lib/python3.8/site-packages/antares_core/backends/c-rocm_win64/include/backend.hpp
Similarly, for the content, please fully replace the original init function with this updated function:
void init(int dev) {
ab::hLibDll = LoadLibrary(AMDHIP64_LIBRARY_PATH);
CHECK(hLibDll, "Cannot find `" AMDHIP64_LIBRARY_PATH "` !\n");
LOAD_ONCE(hipSetDevice, int (*)(int));
CHECK(0 == hipSetDevice(1), "Failed initialize AMD ROCm device with `" AMDHIP64_LIBRARY_PATH "` (No AMDGPU installed or enabled?).");
_current_device = dev;
}
After saving, please re-run AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares
.
The main difference is that this will use the 2nd GPU for a trial.
from antares.
i don't know if this helps but this is what the rx6800m says in the amd driver
from antares.
2 means both 2 gpu will be supported. (Vega 8 and RX6700). Thus, you need to link to correct GPU ID and correct GFX number:
Please re-open this file via vim:
vi ~/.local/lib/python3.8/site-packages/antares_core/backends/c-rocm_win64/include/backend.hpp
Similarly, for the content, please fully replace the original init function with this updated function:
void init(int dev) { ab::hLibDll = LoadLibrary(AMDHIP64_LIBRARY_PATH); CHECK(hLibDll, "Cannot find `" AMDHIP64_LIBRARY_PATH "` !\n"); LOAD_ONCE(hipSetDevice, int (*)(int)); CHECK(0 == hipSetDevice(1), "Failed initialize AMD ROCm device with `" AMDHIP64_LIBRARY_PATH "` (No AMDGPU installed or enabled?)."); _current_device = dev; }After saving, please re-run
AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares
.The main difference is that this will use the 2nd GPU for a trial.
from antares.
How did you get "a hip error no binary"? The new change will in the wost case throw that error again.
https://user-images.githubusercontent.com/95400651/164879095-88be9121-a4c3-4afb-8f94-491f5447adae.png
Can you re-update antares with "pip3 install antares --upgrade" (possibly multiple times if fails)?
from antares.
How did you get "a hip error no binary"? The new change will in the wost case throw that error again. https://user-images.githubusercontent.com/95400651/164879095-88be9121-a4c3-4afb-8f94-491f5447adae.png
Can you re-update antares with "pip3 install antares --upgrade" (possibly multiple times if fails)?
to get that error i did this
That's great. Next you need to install an upgrade antares version.
pip3 install --upgrade antares==0.3.13.1 # If it fails, it means the PYPI repo is not up-to-date, please re-run this command until it succeed. # Then, try show the output for this command: AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares
from antares.
How did you get "a hip error no binary"? The new change will in the wost case throw that error again. https://user-images.githubusercontent.com/95400651/164879095-88be9121-a4c3-4afb-8f94-491f5447adae.png
Can you re-update antares with "pip3 install antares --upgrade" (possibly multiple times if fails)?
i managed to recreate it, i did "pip3 install antares --upgrade", then i ran AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares, and i got this
(ghostplant said:)OK, this is a good state, but the init function are reverted as well, you need to re-edit that into:
void init(int dev) {
ab::hLibDll = LoadLibrary(AMDHIP64_LIBRARY_PATH);
CHECK(hLibDll, "Cannot find `" AMDHIP64_LIBRARY_PATH "` !\n");
LOAD_ONCE(hipSetDevice, int (*)(int));
CHECK(0 == hipSetDevice(1), "Failed initialize AMD ROCm device with `" AMDHIP64_LIBRARY_PATH "` (No AMDGPU installed or enabled?).");
_current_device = dev;
}
from antares.
Yes, it successful utilize RX6700 for computation.
from antares.
i have my kernel.hip.cpp and source .cpp files, how can i compile them? (i'm literally new to this)
from antares.
Yes, it successful utilize RX6700 for computation.
for example with rocm in ubuntu (no wsl) this would be the command
/opt/rocm/hip/bin/hipcc source.cpp kernel.hip.cpp -o libbm3dhip.so -shared -fPIC -std=c++17 -O3 -I/home/comp/vapoursynth/include -Wno-unused-result --offload-arch=gfx1031 $(/opt/rocm/hip/bin/hipconfig --cxx_config), what do i change to do it with antares?
from antares.
hip info even though it is compiled it fails
from antares.
This allows you execute
__global__ function
based source code on windows. It means, you can use driver-level programming for Win64 execution to make ROCm kernels run efficiently just with native RX6700 driver for Windows.Antares treats ROCm for Windows as a special-hardware backend, and can generate any IR-based efficient kernel to build up that
__global__ function
, e.g. MatMul/Transpose/Conv/..
Can native hip kernels be compiled in antares to run hip code in windows without the need of wsl?
from antares.
You need to compile the hip kernels in wsl since hipcc is from wsl only, After that, hipcc will produce HSACO binary code for AMDGPU, this file can be directly loaded by Win64 program and no need to use wsl.
Briefly, you need wsl to compile all hip kernels to many HSACO files, and then you can detach wsl and write clean Win64 host program
to interact with AMDGPU using these HSACOs.
from antares.
Please add more documentation.
from antares.
Is this command working?
/opt/rocm/bin/hipcc ~/.cache/antares/cache/_/my_kernel.cc --genco -O2 --amdgpu-target=gfx1031 -Wno-ignored-attributes -o /tmp/out.hsaco
And when I input this:
It returns this:
Andinstalled, automatic this things:
rocm-clang-ocl/focal,now 0.5.0.50401-8420.04 amd64 [installed,automatic]20.04 amd64 [installed,automatic]
rocm-cmake/focal,now 0.8.0.50401-84
rocm-core/focal,now 5.4.1.50401-8420.04 amd64 [installed,automatic]20.04 amd64 [installed,automatic]
rocm-dbgapi/focal,now 0.68.0.50401-84
rocm-debug-agent/focal,now 2.0.3.50401-8420.04 amd64 [installed,automatic]20.04 amd64 [installed]
rocm-dev/focal,now 5.4.1.50401-84
rocm-device-libs/focal,now 1.0.0.50401-8420.04 amd64 [installed,automatic]20.04 amd64 [installed]
rocm-dkms/focal,now 5.4.1.50401-84
rocm-gdb/focal,now 12.1.50401-8420.04 amd64 [installed,automatic]20.04 amd64 [installed,automatic]
rocm-llvm/focal,now 15.0.0.22465.50401-84
rocm-ocl-icd/focal,now 2.0.0.50401-8420.04 amd64 [installed,automatic]20.04 amd64 [installed]
rocm-opencl-dev/focal,now 2.0.0.50401-84
rocm-opencl/focal,now 2.0.0.50401-8420.04 amd64 [installed,automatic]20.04 amd64 [installed,automatic]
rocm-smi-lib/focal,now 5.0.0.50401-84
rocm-utils/focal,now 5.4.1.50401-8420.04 amd64 [installed,automatic]20.04 amd64 [installed, automatic]
rocminfo/focal,now 1.0.0.50401-84
from antares.
Is this command working?
/opt/rocm/bin/hipcc ~/.cache/antares/cache/_/my_kernel.cc --genco -O2 --amdgpu-target=gfx1031 -Wno-ignored-attributes -o /tmp/out.hsaco
And then this:
It returns this:
from antares.
Related Issues (20)
- gfx 1031 hip kernel crash HOT 1
- Running ROCm computations on Windows over AMD GPU HOT 14
- This repo is missing important files
- Change the cache directory HOT 4
- [BUG] Tune a bert-base-fp16 failed HOT 1
- [Help Request] How can Antares IR support stride size > 1 's Slice operation? HOT 3
- Can antares assign specified gpus for evaluation? HOT 1
- how can antares surport loop which index doesn't start with 0 HOT 5
- Benchmarks HOT 3
- is it possible c-ocl_*_win64 HOT 15
- Not an issue but a question due to lack of docs. HOT 1
- Fail to compile, when I use "AMDGFX=gfx1031 BACKEND=c-rocm_win64 antares" HOT 9
- The residue of the last issue (#365)
- [Error] error: ‘CHECK_EQ’ was not declared in this scope; did you mean ‘CHECK_OK’? HOT 17
- Assertion error: SDK for `c-rocm_win64` is not configured correctly, HOT 3
- Is this project based on AI? What is the goal of this project? HOT 3
- will this project replace torch-directml? HOT 2
- Is ROCm no longer supported by 0.9.x? HOT 16
- Lack operator implementation for DirectX: torch.abs() HOT 2
- Is there any document for performance benchmark result vs pytorch2.1 compile mode? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antares.