Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
89eb79ae
Unverified
Commit
89eb79ae
authored
Feb 14, 2019
by
Rémi Verschelde
Committed by
GitHub
Feb 14, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25879 from hpvb/fix-25629
Detect when primusrun/optirun is in use
parents
c6c78858
84627140
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
os_x11.cpp
platform/x11/os_x11.cpp
+31
-2
No files found.
platform/x11/os_x11.cpp
View file @
89eb79ae
...
...
@@ -243,8 +243,37 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
// maybe contextgl wants to be in charge of creating the window
#if defined(OPENGL_ENABLED)
if
(
getenv
(
"DRI_PRIME"
)
==
NULL
)
{
print_verbose
(
"Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic."
);
int
use_prime
=
detect_prime
();
int
use_prime
=
-
1
;
if
(
getenv
(
"PRIMUS_DISPLAY"
)
||
getenv
(
"PRIMUS_libGLd"
)
||
getenv
(
"PRIMUS_libGLa"
)
||
getenv
(
"PRIMUS_libGL"
)
||
getenv
(
"PRIMUS_LOAD_GLOBAL"
)
||
getenv
(
"BUMBLEBEE_SOCKET"
))
{
print_verbose
(
"Optirun/primusrun detected. Skipping GPU detection"
);
use_prime
=
0
;
}
if
(
getenv
(
"LD_LIBRARY_PATH"
))
{
String
ld_library_path
(
getenv
(
"LD_LIBRARY_PATH"
));
Vector
<
String
>
libraries
=
ld_library_path
.
split
(
":"
);
for
(
int
i
=
0
;
i
<
libraries
.
size
();
++
i
)
{
if
(
FileAccess
::
exists
(
libraries
[
i
]
+
"/libGL.so.1"
)
||
FileAccess
::
exists
(
libraries
[
i
]
+
"/libGL.so"
))
{
print_verbose
(
"Custom libGL override detected. Skipping GPU detection"
);
use_prime
=
0
;
}
}
}
if
(
use_prime
==
-
1
)
{
print_verbose
(
"Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic."
);
use_prime
=
detect_prime
();
}
if
(
use_prime
)
{
print_line
(
"Found discrete GPU, setting DRI_PRIME=1 to use it."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment