We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
##设置继承镜像 FROM nvidia/cuda:11.6.1-devel-ubuntu20.04 ##下面开始运行更新命令 RUN apt update ##设置为非交互模式 ENV DEBIAN_FRONTEND=noninteractive ##install ncnn dependencies RUN apt install -y --fix-missing build-essential git cmake libprotobuf-dev protobuf-compiler libomp-dev libvulkan-dev vulkan-tools libopencv-dev && apt clean ##add vulkan package ADD vulkansdk-linux-x86_64-1.2.198.1 /workspace/ncnn/vulkansdk-linux-x86_64-1.2.198.1 ENV VULKAN_SDK=/workspace/ncnn/vulkansdk-linux-x86_64-1.2.198.1/x86_64 ENV PATH=$VULKAN_SDK/bin:$PATH ENV LD_LIBRARY_PATH=$VULKAN_SDK/lib:$LD_LIBRARY_PATH
##!/bin/bash
##宿主机上的库路径 HOST_LIB_PATH="/usr/lib/x86_64-linux-gnu"
##Docker 容器中对应的库路径 CONTAINER_LIB_PATH="/usr/lib/x86_64-linux-gnu"
##构建映射参数 VOLUME_ARGS=""
##查找所有与 Nvidia 相关的库 for file in $(find $HOST_LIB_PATH -name "libnvidia.so*"); do VOLUME_ARGS="$VOLUME_ARGS -v $file:$CONTAINER_LIB_PATH/$(basename $file)" done ##echo $VOLUME_ARGS docker run -itd --gpus all -v /home/dj/workspace/:/workspace -w /workspace --name dj_ncnn_cuda_11.6.1 $VOLUME_ARGS -v /usr/share/vulkan/icd.d/nvidia_icd.json:/etc/vulkan/icd.d/nvidia_icd.json -e VK_ICD_FILENAMES=/etc/vulkan/icd.d/nvidia_icd.json ncnn_cuda:11.6.1 /bin/bash
The text was updated successfully, but these errors were encountered:
可能提到docker那边更好?
Sorry, something went wrong.
参考 https://stackoverflow.com/questions/74965945/vulkan-is-unable-to-detect-nvidia-gpu-from-within-a-docker-container-when-using
No branches or pull requests
detail | 详细描述 | 詳細な説明
Dockerfile如下:
##设置继承镜像
FROM nvidia/cuda:11.6.1-devel-ubuntu20.04
##下面开始运行更新命令
RUN apt update
##设置为非交互模式
ENV DEBIAN_FRONTEND=noninteractive
##install ncnn dependencies
RUN apt install -y --fix-missing build-essential git cmake libprotobuf-dev protobuf-compiler libomp-dev libvulkan-dev vulkan-tools libopencv-dev
&& apt clean
##add vulkan package
ADD vulkansdk-linux-x86_64-1.2.198.1 /workspace/ncnn/vulkansdk-linux-x86_64-1.2.198.1
ENV VULKAN_SDK=/workspace/ncnn/vulkansdk-linux-x86_64-1.2.198.1/x86_64
ENV PATH=$VULKAN_SDK/bin:$PATH
ENV LD_LIBRARY_PATH=$VULKAN_SDK/lib:$LD_LIBRARY_PATH
docker启动脚本如下:
##!/bin/bash
##宿主机上的库路径
HOST_LIB_PATH="/usr/lib/x86_64-linux-gnu"
##Docker 容器中对应的库路径
CONTAINER_LIB_PATH="/usr/lib/x86_64-linux-gnu"
##构建映射参数
VOLUME_ARGS=""
##查找所有与 Nvidia 相关的库
for file in $(find $HOST_LIB_PATH -name "libnvidia.so*"); do
VOLUME_ARGS="$VOLUME_ARGS -v $file:$CONTAINER_LIB_PATH/$(basename $file)"
done
##echo $VOLUME_ARGS
docker run -itd --gpus all -v /home/dj/workspace/:/workspace -w /workspace --name dj_ncnn_cuda_11.6.1
$VOLUME_ARGS
-v /usr/share/vulkan/icd.d/nvidia_icd.json:/etc/vulkan/icd.d/nvidia_icd.json
-e VK_ICD_FILENAMES=/etc/vulkan/icd.d/nvidia_icd.json
ncnn_cuda:11.6.1 /bin/bash
The text was updated successfully, but these errors were encountered: