This commit is contained in:
Wei CUI 2022-11-04 01:54:36 +08:00
Родитель 5f28cfa3ee
Коммит cf369c9fcf
2 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -98,14 +98,16 @@ namespace ab {
if (!_gpu_arch.size()) {
hipDeviceProp_t prop;
CHECK_OK(0 == hipGetDeviceProperties(&prop, _current_device));
_gpu_arch = std::to_string(prop.gcnArch);
_gpu_arch = "gfx" + std::to_string(prop.gcnArch);
}
auto code = get_between(source, "\n#define __AMDGFX__ ", "\n");
if (code.size() == 0)
code = "gfx" + _gpu_arch;
std::vector<std::string> codes = { get_between(source, "\n#define __AMDGFX__ ", "\n") };
if (codes[0].size() == 0)
codes[0] = _gpu_arch;
std::vector<std::string> compile_args = {"/opt/rocm/bin/hipcc", path, "--genco", "-O2", ("--amdgpu-target=" + code), "-Wno-ignored-attributes", "-o", (path + ".out")};
std::vector<std::string> compile_args = {"/opt/rocm/bin/hipcc", path, "--genco", "-O2", "-Wno-ignored-attributes", "-o", (path + ".out")};
for (auto &code: codes)
compile_args.push_back("--amdgpu-target=" + code);
#endif
ab_utils::Process(compile_args, 30);

Просмотреть файл

@ -19,13 +19,14 @@ RUN apt-get update && apt install -y --no-install-recommends git ca-certificates
RUN curl -L https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add -
RUN printf "deb [arch=amd64] http://repo.radeon.com/rocm/apt/4.2/ xenial main" | tee /etc/apt/sources.list.d/rocm_hip.list && \
RUN printf "deb [arch=amd64] http://repo.radeon.com/rocm/apt/5.3/ ubuntu main" | tee /etc/apt/sources.list.d/rocm_hip.list && \
apt update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
rocm-dev rocblas hipsparse rccl rocfft hipfft rocrand miopen-hip rocthrust hip-rocclr && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN /bin/echo -e "set backspace=indent,eol,start\nset nocompatible\nset ts=4" > /etc/vim/vimrc.tiny
RUN pip3 install --upgrade antares && mkdir -p /root/.local/antares && ln -s $(antares pwd)/../3rdparty /root/.local/antares/3rdparty
RUN pip3 install --upgrade antares && mkdir -p /root/.local/antares && mv $(antares pwd)/../3rdparty /root/.local/antares/3rdparty && pip3 uninstall antares -y
RUN echo 'exec /antares/main.py "$@"' > /usr/local/bin/antares && chmod a+x /usr/local/bin/antares
# OpenCL has been included in ROCm already
RUN rm -rf /usr/lib/x86_64-linux-gnu/libOpenCL.so.1*