Skip to content

Commit 1b9ba2b

Browse files
committed
Nobody expects the Red Team
Too many changes to list, but broadly: * Remove Intel GPU support from the compiler * Add AMD GPU support to the compiler * Remove Intel GPU host code * Add AMD GPU host code * More device instructions. From 40 to 68 * More host functions. From 48 to 184 * Add proof of concept implementation of OptiX framework * Add minimal support of cuDNN, cuBLAS, cuSPARSE, cuFFT, NCCL, NVML * Improve ZLUDA launcher for Windows
1 parent 60d2124 commit 1b9ba2b

File tree

762 files changed

+252017
-39027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

762 files changed

+252017
-39027
lines changed

.cargo/config.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
[target."x86_64-pc-windows-gnu"]
2-
rustflags = ["-C", "link-self-contained=y"]
1+
[target."x86_64-unknown-linux-gnu"]
2+
rustflags = ["-C", "target-cpu=x86-64-v2"]
3+
4+
[target."x86_64-pc-windows-msvc"]
5+
rustflags = ["-C", "target-cpu=x86-64-v2"]
6+
7+
[alias]
8+
xtask = "run --package xtask --"

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# syntax = devthefuture/dockerfile-x
2+
3+
# This duplicate FROM is here purely to make dev containers happy,
4+
# Otherwise it tries to parse the file (whyyy???) and chokes on custom syntax
5+
FROM ubuntu:22.04
6+
INCLUDE ./Dockerfile-common

.devcontainer/Dockerfile-common

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
WORKDIR /root
2+
3+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4+
ca-certificates \
5+
nano \
6+
wget \
7+
curl \
8+
gnupg \
9+
ripgrep \
10+
ltrace \
11+
file\
12+
python3-minimal \
13+
build-essential \
14+
git \
15+
cmake \
16+
ninja-build
17+
ENV PATH="${PATH}:/opt/rocm/bin:/opt/rocm/llvm/bin:/usr/local/cuda/bin/"
18+
19+
20+
ARG CUDA_VERSION=11-8
21+
ENV NVIDIA_VISIBLE_DEVICES all
22+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
23+
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb && \
24+
dpkg -i cuda-keyring_1.0-1_all.deb && \
25+
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
26+
nvidia-headless-no-dkms-515 \
27+
nvidia-utils-515 \
28+
cuda-cudart-${CUDA_VERSION} \
29+
cuda-compiler-${CUDA_VERSION} \
30+
libcufft-dev-${CUDA_VERSION} \
31+
libcusparse-dev-${CUDA_VERSION} \
32+
libcublas-dev-${CUDA_VERSION} \
33+
cuda-nvml-dev-${CUDA_VERSION} \
34+
libcudnn8-dev
35+
36+
ARG RUST_VERSION=1.66.1
37+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=${RUST_VERSION}
38+
RUN . $HOME/.cargo/env && cargo install bindgen-cli --locked
39+
40+
ARG ROCM_VERSION=5.7.3
41+
RUN echo "Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600" > /etc/apt/preferences.d/rocm-pin-600
42+
RUN mkdir --parents --mode=0755 /etc/apt/keyrings && \
43+
sh -c 'wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null' && \
44+
sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${ROCM_VERSION} jammy main > /etc/apt/sources.list.d/rocm.list' && \
45+
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
46+
rocminfo \
47+
rocm-gdb \
48+
rocprofiler \
49+
rocm-smi-lib \
50+
hip-runtime-amd \
51+
comgr \
52+
hipblaslt-dev \
53+
hipfft-dev \
54+
rocblas-dev \
55+
rocsolver-dev \
56+
rocsparse-dev \
57+
miopen-hip-dev \
58+
rocm-device-libs && \
59+
echo 'export PATH="$PATH:/opt/rocm/bin"' > /etc/profile.d/rocm.sh && \
60+
echo '/opt/rocm/lib' > /etc/ld.so.conf.d/rocm.conf && \
61+
ldconfig
62+
63+
# Default to a login shell
64+
CMD ["bash", "-l"]

.devcontainer/Dockerfile-el8_8

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
FROM rockylinux:8.8
2+
3+
WORKDIR /root
4+
5+
RUN dnf -y --setopt=install_weak_deps=False install \
6+
nano \
7+
wget \
8+
curl \
9+
ltrace \
10+
file \
11+
python3 \
12+
git \
13+
gcc \
14+
gcc-c++ \
15+
cmake
16+
17+
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
18+
rpm -ivh epel-release-latest-8.noarch.rpm && \
19+
dnf -y --setopt=install_weak_deps=False install 'dnf-command(config-manager)' && \
20+
crb enable && \
21+
dnf -y --setopt=install_weak_deps=False install \
22+
ripgrep \
23+
ninja-build
24+
25+
ARG CUDA_VERSION=11-8
26+
ENV NVIDIA_VISIBLE_DEVICES all
27+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
28+
RUN dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo && \
29+
dnf -y --setopt=install_weak_deps=False module install \
30+
nvidia-driver:515 && \
31+
dnf -y --setopt=install_weak_deps=False install \
32+
cuda-cudart-${CUDA_VERSION} \
33+
cuda-compiler-${CUDA_VERSION} \
34+
libcufft-devel-${CUDA_VERSION} \
35+
libcusparse-devel-${CUDA_VERSION} \
36+
libcublas-devel-${CUDA_VERSION} \
37+
cuda-nvml-devel-${CUDA_VERSION} \
38+
libcudnn8-devel
39+
40+
ARG RUST_VERSION=1.66.1
41+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=${RUST_VERSION}
42+
RUN . $HOME/.cargo/env && cargo install bindgen-cli --locked
43+
44+
ARG ROCM_VERSION=5.7.1
45+
RUN sh -c 'echo -e "[ROCm-${ROCM_VERSION}]\n\
46+
name=ROCm${ROCM_VERSION}\n\
47+
baseurl=https://repo.radeon.com/rocm/rhel8/${ROCM_VERSION}/main\n\
48+
enabled=1\n\
49+
priority=50\n\
50+
gpgcheck=1\n\
51+
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key"' \
52+
> /etc/yum.repos.d/rocm.repo && \
53+
dnf -y --setopt=install_weak_deps=False install \
54+
rocminfo \
55+
rocm-gdb \
56+
rocprofiler \
57+
rocm-smi-lib \
58+
hip-runtime-amd \
59+
comgr \
60+
hipblaslt-devel \
61+
hipfft-devel \
62+
rocblas-devel \
63+
rocsolver-devel \
64+
rocsparse-devel \
65+
miopen-hip-devel \
66+
rocm-device-libs && \
67+
echo 'export PATH="$PATH:/opt/rocm/bin"' > /etc/profile.d/rocm.sh && \
68+
echo '/opt/rocm/lib' > /etc/ld.so.conf.d/rocm.conf && \
69+
ldconfig
70+
71+
# Default to a login shell
72+
CMD ["bash", "-l"]

.devcontainer/Dockerfile-xgboost

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# syntax = devthefuture/dockerfile-x
2+
FROM ubuntu:22.04
3+
INCLUDE ./Dockerfile-common
4+
5+
ARG XGBOOST_VERSION=2.0.3
6+
RUN git clone --branch "v${XGBOOST_VERSION}" --recurse-submodules https://github.com/dmlc/xgboost.git && \
7+
cd xgboost && \
8+
# Broken test, segfaults on normal CUDA
9+
sed -i 's/TEST(Allocator, OOM) {/TEST(Allocator, OOM) { GTEST_SKIP();/g' tests/cpp/common/test_device_helpers.cu && \
10+
mkdir build && \
11+
cd build && \
12+
cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DUSE_CUDA=ON -GNinja && \
13+
ninja
14+
15+
#
16+

.devcontainer/devcontainer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// For format details, see https://aka.ms/devcontainer.json
2+
{
3+
"name": "ZLUDA",
4+
"build": {
5+
"dockerfile": "Dockerfile"
6+
},
7+
"securityOpt": [
8+
"seccomp=unconfined"
9+
],
10+
// Make NVIDIA and AMD GPUs available
11+
"runArgs": [
12+
// Uncomment on newer docker/podman
13+
//"--runtime=nvidia",
14+
"--device=/dev/kfd",
15+
"--device=/dev/dri",
16+
"--group-add=video"
17+
],
18+
// Cache cargo packages and compiled ZLUDA kernels
19+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.cargo/git ${localEnv:HOME}/.cargo/registry ${localEnv:HOME}/.cache/ZLUDA",
20+
"mounts": [
21+
{
22+
"source": "${localEnv:HOME}/.cargo/git",
23+
"target": "/root/.cargo/git",
24+
"type": "bind"
25+
},
26+
{
27+
"source": "${localEnv:HOME}/.cargo/registry",
28+
"target": "/root/.cargo/registry",
29+
"type": "bind"
30+
},
31+
{
32+
"source": "${localEnv:HOME}/.cache/ZLUDA",
33+
"target": "/root/.cache/ZLUDA",
34+
"type": "bind"
35+
}
36+
],
37+
// Rootless docker requires logging as root: https://aka.ms/dev-containers-non-root.
38+
"remoteUser": "root"
39+
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ext/** linguist-vendored
2+
atiadlxx-sys/include/* linguist-vendored
3+
*.ptx linguist-language=Assembly

.github/workflows/rust.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.gitmodules

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
[submodule "ext/spirv-tools"]
2-
path = ext/spirv-tools
3-
url = https://github.com/KhronosGroup/SPIRV-Tools
4-
branch = master
5-
[submodule "ext/spirv-headers"]
6-
path = ext/spirv-headers
7-
url = https://github.com/KhronosGroup/SPIRV-Headers
1+
[submodule "ext/llvm-project"]
2+
path = ext/llvm-project
3+
url = https://github.com/llvm/llvm-project.git
4+
branch = release/15.x
5+
shallow = true

0 commit comments

Comments
 (0)