
Don't forget to run chmod +x path/to/file to mark it executable.įound this useful? Does this work on other systems and setups too? Comment below! by Starbeamrainbowlabs 25-10-2020 at 09:00 am Linux, Ubuntu, Graphics, Terminal Permanent Link 15134 views 10 comments Share via: It looks like this: #!/usr/bin/env bashĮxport the above to somewhere in your PATH (e.g. Given that I know I'll be wanting to use this regularly, I've created a script in my bin folder for it. Thanks to this Ask Ubuntu post for the answer! The solution is to set the above environment variables instead of DRI_PRIME=1. LibGL error: failed to load driver: nouveau If you forget the latter here or try using DRI_PRIME=1 instead of both of these (as I advise in my previous post about AMD dedicated graphics cards), you'll get an error like this: libGL error: failed to create dri screen In short, the _NV_PRIME_RENDER_OFFLOAD environment variable must be set to 1, and the _GLX_VENDOR_LIBRARY_NAME environment variable must be set to nvidia. Then, to launch a program on your Nvidia dedicated graphics card, do this: _NV_PRIME_RENDER_OFFLOAD=1 _GLX_VENDOR_LIBRARY_NAME=nvidia command_name arguments In the NVIDIA X Server Settings, go to PRIME Profiles, and then ensure NVIDIA On-Demand mode is selected. and then there will be an application-specific menu you'll need to navigate to tell it which device to use.įor traditional graphical programs, the process is different. For CUDA applications, you need to install the nvidia-cuda-toolkit package: sudo apt install nvidia-cuda-toolkit With Nvidia cards, it depends greatly on what you want to run as to how you go about doing this. If not, consult your distribution's documentation on how to install and enable this. The initial operating system installation went ok (Ubuntu 20.10 Groovy Gorilla is my Linux distribution of choice here), but after I'd done a bunch of configuration and initial setup tasks it inevitably came around to the point in time that I wanted to run an application on my dedicated Nvidia graphics card.ĭoing so is actually really quite easy - it's figuring out the how that was the hard bit! To that end, this is a quick post to document how to do this so I don't forget next time.īefore you continue, I'll assume here that you're using the Nvidia propriety drivers. I've got a new laptop, and in it I have an Nvidia graphics card. Run a Program on your dedicated Nvidia graphics card on Linux
