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 87e7a13 commit 31f2d62
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
Expand Up @@ -500,6 +500,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/nvidia/cuda_context.py
Expand Up @@ -16,11 +16,14 @@
from xpra.util import engs, print_nested_dict, envint, envbool, 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, is_WSL
from xpra.os_util import load_binary_file, is_WSL, 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:
if is_WSL() and not envbool("XPRA_PYCUDA_WSL", False):
raise ImportError("refusing to import pycuda on WSL, use XPRA_PYCUDA_WSL=1 to override")
Expand Down

0 comments on commit 31f2d62

Please sign in to comment.