pycuda: fix opengl runpath

This is required for CUDA functionality, since libcuda.so.1 is loaded
from /run/opengl-driver/lib
This commit is contained in:
Ryan Burns 2021-04-22 17:40:58 -07:00
parent 96f048e3d0
commit f52daac15c

View File

@ -1,4 +1,5 @@
{ buildPythonPackage { buildPythonPackage
, addOpenGLRunpath
, fetchPypi , fetchPypi
, fetchFromGitHub , fetchFromGitHub
, Mako , Mako
@ -40,6 +41,13 @@ buildPythonPackage rec {
ln -s ${compyte} $out/${python.sitePackages}/pycuda/compyte ln -s ${compyte} $out/${python.sitePackages}/pycuda/compyte
''; '';
postFixup = ''
find $out/lib -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
echo "setting opengl runpath for $lib..."
addOpenGLRunpath "$lib"
done
'';
# Requires access to libcuda.so.1 which is provided by the driver # Requires access to libcuda.so.1 which is provided by the driver
doCheck = false; doCheck = false;
@ -47,6 +55,10 @@ buildPythonPackage rec {
py.test py.test
''; '';
nativeBuildInputs = [
addOpenGLRunpath
];
propagatedBuildInputs = [ propagatedBuildInputs = [
numpy numpy
pytools pytools