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

Fix host code and update to CUDA 12.4 #299

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,28 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && DEBIAN_FRONTEND=noninter
python3 \
ripgrep \
git \
ltrace
ltrace \
# required by llvm 17
lsb-release software-properties-common gnupg

ARG LLVM_VERSION=17
RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh ${LLVM_VERSION}

# Feel free to change to a newer version if you have a newer verison on your host
ARG CUDA_VERSION=12-4
ARG CUDA_PKG_VERSION=12-4
# Docker <-> host driver version compatiblity is newer host <-> older docker
# We don't care about a specific driver version, so pick oldest 5XX
ARG CUDA_DRIVER=515
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# CUDA headers need it for interop
libgl-dev libegl-dev libvdpau-dev \
nvidia-utils-${CUDA_DRIVER} \
cuda-cudart-${CUDA_VERSION}
cuda-cudart-dev-${CUDA_PKG_VERSION} \
cuda-cudart-${CUDA_PKG_VERSION} \
cuda-profiler-api-${CUDA_PKG_VERSION} \
cuda-nvcc-${CUDA_PKG_VERSION}

ARG ROCM_VERSION=6.2.2
RUN mkdir --parents --mode=0755 /etc/apt/keyrings && \
Expand All @@ -29,9 +41,11 @@ RUN mkdir --parents --mode=0755 /etc/apt/keyrings && \
rocminfo \
rocm-gdb \
rocm-smi-lib \
hip-runtime-amd && \
rocm-llvm-dev \
hip-runtime-amd && \
hip-dev && \
echo '/opt/rocm/lib' > /etc/ld.so.conf.d/rocm.conf && \
ldconfig

ENV PATH=$PATH:/opt/rocm-6.2.2/bin
ENV PATH=$PATH:/opt/rocm-${ROCM_VERSION}/bin

4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//"hostRequirements": { "gpu": "optional" }
"customizations": {
"vscode": {
"extensions": [ "mhutchie.git-graph" ],
"extensions": [ "mhutchie.git-graph" ]
}
}
}
}
7 changes: 0 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
[submodule "ext/spirv-tools"]
path = ext/spirv-tools
url = https://github.com/KhronosGroup/SPIRV-Tools
branch = master
[submodule "ext/spirv-headers"]
path = ext/spirv-headers
url = https://github.com/KhronosGroup/SPIRV-Headers
[submodule "ext/llvm-project"]
path = ext/llvm-project
url = https://github.com/llvm/llvm-project
Expand Down
51 changes: 24 additions & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
[workspace]

resolver = "2"

members = [
"ext/hip_runtime-sys",
"ext/amd_comgr-sys",
"comgr",
"cuda_base",
"cuda_types",
"detours-sys",
"level_zero-sys",
"level_zero",
"spirv_tools-sys",
"zluda",
"zluda_dump",
"zluda_lib",
"zluda_inject",
"zluda_redirect",
"zluda_ml",
"ptx",
"ptx_parser",
"ptx_parser_macros",
"ptx_parser_macros_impl",
]

default-members = ["zluda_lib", "zluda_ml", "zluda_inject", "zluda_redirect"]
[workspace]

resolver = "2"

members = [
"ext/hip_runtime-sys",
"ext/amd_comgr-sys",
"comgr",
"cuda_base",
"cuda_types",
"detours-sys",
"zluda",
"zluda_dump",
"zluda_inject",
"zluda_redirect",
"zluda_ml",
"ptx",
"ptx_parser",
"ptx_parser_macros",
"ptx_parser_macros_impl",
"zluda_bindgen",
]

default-members = ["zluda", "zluda_ml", "zluda_inject", "zluda_redirect"]
4 changes: 2 additions & 2 deletions cuda_base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
name = "cuda_base"
version = "0.0.0"
authors = ["Andrzej Janik <[email protected]>"]
edition = "2018"
edition = "2021"

[dependencies]
quote = "1.0"
syn = { version = "1.0", features = ["full", "visit-mut"] }
syn = { version = "2.0", features = ["full", "visit-mut"] }
proc-macro2 = "1.0"
rustc-hash = "1.1.0"

Expand Down
1 change: 0 additions & 1 deletion cuda_base/README

This file was deleted.

6 changes: 5 additions & 1 deletion cuda_base/build/wrapper.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#define __CUDA_API_VERSION_INTERNAL
#include <cuda.h>
#include <cudaGL.h>
#include <cudaProfiler.h>
#include <cudaGL.h>
#include <cudaEGL.h>
#include <vdpau/vdpau.h>
#include <cudaVDPAU.h>
Loading