Created
August 28, 2017 13:38
-
-
Save jsimmons/1f3e006f753a81da08ae119945292807 to your computer and use it in GitHub Desktop.
How to use dGPU in Optimus systems via Rust
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(link_args)] | |
// Don't try and do this via cargo it's a huge disaster, | |
// just ignore the ominous warnings about link_args being | |
// broken. (requires nightly, too, hurray) | |
#[cfg(target_os="windows")] | |
#[link_args="/EXPORT:NvOptimusEnablement"] | |
extern {} | |
#[allow(non_upper_case_globals)] | |
#[no_mangle] | |
pub static NvOptimusEnablement: u32 = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment