# Can I export some particular C bindings for GPU drivers to see?

**URL:** <https://discourse.julialang.org/t/can-i-export-some-particular-c-bindings-for-gpu-drivers-to-see/94852>\
**Category:** General Usage\
**Tags:** gpu, c\
**Created:** [February 18, 2023, 8:58pm UTC](https://discourse.julialang.org/t/can-i-export-some-particular-c-bindings-for-gpu-drivers-to-see/94852 "2023-02-18T20:58:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![heyx3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heyx3/32/29811_2.png) [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Post date:** [February 18, 2023, 8:58pm UTC](https://discourse.julialang.org/t/can-i-export-some-particular-c-bindings-for-gpu-drivers-to-see/94852/1 "2023-02-18T20:58:51Z")

</div>

I’m trying to use ModernGL.jl to make a graphics program. However, my NVidia driver keeps using my integrated graphics instead of my discrete card. I can manually fix this in my driver settings, but I don’t want to have to manually do that on every machine which might run this program (plus that setting isn’t working for me).

Both NVidia and AMD offer a way to tell the driver that your program should default to discrete GPU instead of integrated GPU. You must export a specific constant in your executable:

```julia
    _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
    _declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;

```

Can I use Clang.jl or CBinding.jl to do this? I am not very experienced in the interactions between Julia and its underlying compiler.
