我使用Ubuntu 19.10,希望在docker中使用OpenCL。在docker容器中,我安装了opencl-headers、ocl-icd-opencl-dev和clinfo。当我在docker之外的机器上运行clinfo时,我得到以下响应:
Number of platforms 1
Platform Name NVIDIA CUDA
Platform Vendor NVIDIA Corporation
Platform Version OpenCL 1.2 CUDA 10.2.159
...
当在Docker中运行相同程序时:
Number of platforms 0
我认为Docker container应该能够使用我的显卡,但不确定是否/如何允许它。感谢您的一些见解
1条答案
按热度按时间bqf10yzr1#
您需要使用
--gpus all
选项启动docker,例如:您也可以只公开特定的
gpu
:点击此处阅读更多信息:https://docs.docker.com/config/containers/resource_constraints/