mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 17:59:00 +08:00
make Linux+NVidia fix fail gracefully
This commit is contained in:
parent
261945b469
commit
7f5fb5813b
14
cura_app.py
14
cura_app.py
@ -46,11 +46,15 @@ import faulthandler
|
|||||||
if Platform.isLinux(): # Needed for platform.linux_distribution, which is not available on Windows and OSX
|
if Platform.isLinux(): # Needed for platform.linux_distribution, which is not available on Windows and OSX
|
||||||
# For Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826
|
# For Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826
|
||||||
linux_distro_name = platform.linux_distribution()[0].lower()
|
linux_distro_name = platform.linux_distribution()[0].lower()
|
||||||
# TODO: Needs a "if X11_GFX == 'nvidia'" here. The workaround is only needed on Ubuntu+NVidia drivers. Other drivers are not affected, but fine with this fix.
|
# The workaround is only needed on Ubuntu+NVidia drivers. Other drivers are not affected, but fine with this fix.
|
||||||
import ctypes
|
try:
|
||||||
from ctypes.util import find_library
|
import ctypes
|
||||||
libGL = find_library("GL")
|
from ctypes.util import find_library
|
||||||
ctypes.CDLL(libGL, ctypes.RTLD_GLOBAL)
|
libGL = find_library("GL")
|
||||||
|
ctypes.CDLL(libGL, ctypes.RTLD_GLOBAL)
|
||||||
|
except:
|
||||||
|
# GLES-only systems (e.g. ARM Mali) do not have libGL, ignore error
|
||||||
|
pass
|
||||||
|
|
||||||
# When frozen, i.e. installer version, don't let PYTHONPATH mess up the search path for DLLs.
|
# When frozen, i.e. installer version, don't let PYTHONPATH mess up the search path for DLLs.
|
||||||
if Platform.isWindows() and hasattr(sys, "frozen"):
|
if Platform.isWindows() and hasattr(sys, "frozen"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user