Skip to content

Commit

Permalink
avoid pycuda import warnings on win32
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 24, 2022
1 parent 2085ea1 commit 18cff56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packaging/MSWindows/MINGW_BUILD.sh
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@ if [ "${BUNDLE_DESKTOPLOGON}" == "1" ]; then
done
fi

if [ "${DO_CUDA}" == "1" ]; then
#pycuda wants a CUDA_PATH with "/bin" in it:
mkdir "${DIST}/bin"
fi

if [ "${DO_VERPATCH}" == "1" ]; then
for exe in `ls dist/*exe | grep -v Plink.exe`; do
tool_name=`echo $exe | sed 's+dist/++g;s+Xpra_++g;s+Xpra-++g;s+_+ +g;s+-+ +g;s+\.exe++g'`
Expand Down
7 changes: 5 additions & 2 deletions xpra/codecs/cuda_common/cuda_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
from xpra.util import engs, print_nested_dict, envint, csv, first_time
from xpra.platform.paths import (
get_default_conf_dirs, get_system_conf_dirs, get_user_conf_dirs,
get_resources_dir,
get_resources_dir, get_app_dir,
)
from xpra.os_util import load_binary_file
from xpra.os_util import load_binary_file, WIN32
from xpra.log import Logger

if WIN32 and not os.environ.get("CUDA_PATH"):
os.environ["CUDA_PATH"] = os.path.join(get_app_dir(), "bin")

with numpy_import_lock:
import pycuda #@UnresolvedImport
from pycuda import driver #@UnresolvedImport
Expand Down

0 comments on commit 18cff56

Please sign in to comment.