提交 75e0e721 编写于 作者: J Jonathan Calmels

Include driver headers

上级 bcf69c6c
......@@ -22,7 +22,6 @@ export libdbgdir = $(prefix)/lib/debug$(libdir)
export includedir = $(prefix)/include
export pkgconfdir = $(libdir)/pkgconfig
export CUDA_DIR ?= /usr/local/cuda-8.0
export PKG_DIR ?= $(CURDIR)/pkg
export SRCS_DIR ?= $(CURDIR)/src
export DEPS_DIR ?= $(CURDIR)/deps
......@@ -117,7 +116,7 @@ LDFLAGS := -Wl,-zrelro -Wl,-znow -Wl,-zdefs -Wl,--gc-sections $(LDFLAGS)
LDLIBS := $(LDLIBS)
# Library flags (recursively expanded to handle target-specific flags)
LIB_CPPFLAGS = -DNV_LINUX -isystem $(CUDA_DIR)/include -isystem $(DEPS_DIR)$(includedir) -include $(BUILD_DEFS)
LIB_CPPFLAGS = -DNV_LINUX -isystem $(DEPS_DIR)$(includedir) -include $(BUILD_DEFS)
LIB_CFLAGS = -fPIC
LIB_LDFLAGS = -L$(DEPS_DIR)$(libdir) -shared -Wl,-soname=$(LIB_SONAME)
LIB_LDLIBS_STATIC = -l:libnvidia-modprobe-utils.a
......
......@@ -2,20 +2,9 @@ ARG IMAGESPEC=amazonlinux:2
FROM ${IMAGESPEC}
ARG IMAGESPEC=amazonlinux:2
SHELL ["/bin/bash", "-c"]
COPY mk/cuda.repo /etc/yum.repos.d/
# XXX: CUDA doesn't officially support Amazon Linux, we just need the driver headers though
RUN distrib=rhel7 && \
arch=$(uname -m) && \
echo $distrib > /etc/yum/vars/distrib && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/${distrib}/${arch}/7fa2af80.pub > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
yum install -y \
RUN yum install -y \
bzip2 \
createrepo \
cuda-misc-headers-8-0-8.0.61-1 \
cuda-nvml-dev-8-0-8.0.61-1 \
elfutils-libelf-devel \
gcc \
git \
......
......@@ -2,19 +2,9 @@ ARG IMAGESPEC=centos:7
FROM ${IMAGESPEC}
ARG IMAGESPEC=centos:7
SHELL ["/bin/bash", "-c"]
COPY mk/cuda.repo /etc/yum.repos.d/
RUN distrib=rhel${IMAGESPEC##*:} && \
arch=$(uname -m) && \
echo $distrib > /etc/yum/vars/distrib && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/${distrib}/${arch}/7fa2af80.pub > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
yum install -y \
RUN yum install -y \
bzip2 \
createrepo \
cuda-misc-headers-8-0-8.0.61-1 \
cuda-nvml-dev-8-0-8.0.61-1 \
elfutils-libelf-devel \
gcc \
git \
......
......@@ -2,23 +2,11 @@ ARG IMAGESPEC=debian:9.2
FROM ${IMAGESPEC}
ARG IMAGESPEC=debian:9.2
SHELL ["/bin/bash", "-c"]
# XXX: CUDA doesn't officially support debian, we just need the driver headers though
RUN distrib=ubuntu1604 && \
arch=$(uname -m); arch=${arch/le/el} && \
apt-get update && apt-get install -y --no-install-recommends curl ca-certificates gnupg2 && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/${distrib}/${arch}/7fa2af80.pub | apt-key add - && \
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/${distrib}/${arch} /" > /etc/apt/sources.list.d/cuda.list && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
bmake \
build-essential \
bzip2 \
cuda-misc-headers-8-0=8.0.61-1 \
cuda-nvml-dev-8-0=8.0.61-1 \
devscripts \
dh-make \
fakeroot \
......
......@@ -2,22 +2,11 @@ ARG IMAGESPEC=ubuntu:16.04
FROM ${IMAGESPEC}
ARG IMAGESPEC=ubuntu:16.04
SHELL ["/bin/bash", "-c"]
RUN distrib=${IMAGESPEC//[.:]} && \
arch=$(uname -m); arch=${arch/le/el} && \
apt-get update && apt-get install -y --no-install-recommends gnupg2 curl ca-certificates && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/${distrib/1804/1604}/${arch}/7fa2af80.pub | apt-key add - && \
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/${distrib/1804/1604}/${arch} /" > /etc/apt/sources.list.d/cuda.list && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
bmake \
build-essential \
bzip2 \
cuda-misc-headers-8-0=8.0.61-1 \
cuda-nvml-dev-8-0=8.0.61-1 \
devscripts \
dh-make \
fakeroot \
......
[cuda]
name=cuda
baseurl=http://developer.download.nvidia.com/compute/cuda/repos/$distrib/$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA
此差异已折叠。
......@@ -17,8 +17,8 @@
#include <string.h>
#include <unistd.h>
#include <cuda.h>
#include <nvml.h>
#include "cuda.h"
#include "nvml.h"
#pragma GCC diagnostic push
#include "driver_rpc.h"
......
......@@ -7,9 +7,10 @@
#include <dlfcn.h>
#include <errno.h>
#include <cuda.h>
#include <libelf.h>
#include <nvml.h>
#include "cuda.h"
#include "nvml.h"
#include "error.h"
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册