Can Jenkins run an .exe file requiring OpenGL drivers?

Hi everyone!

I’m trying to test an executable as part of a pipeline build process and Jenkins is displaying the following message in the logs:

pipeline {
    agent any
    stages {
         stage ('Unit-test executable') {
                          steps {
                                bat '''C:\\Users\\<username>\\AppData\\Local\\Jenkins\\.jenkins\\\\workspace\\<workspace-name>\\image\\windows\\<directory-name>\\bin_x64\\application.exe'''

It appears to run perfectly fine if I run it through CMD and/or PWS, but Jenkins doesn’t like it! Anything to do with JRE?

Thanks! :blush:

Jenkins shouldn’t really care.

I’m not super familiar with windows, but is it possible that the account running the build agent is some sort of service account that isn’t allowed to access hardware? or some library isn’t installed globally? or missing some env variables?

Hi @halkeye! :blush:

How can I check if a library is installed globally?

That’s a good point about the environment variables! However, I’m not sure which ones that I need? %PATH% appears to be OK?

Thank you so much for the feedback! :wink:

yea sadly thats outside my windows knowledge. I’m a windows user, but I mostly developer on linux.

There are lots of windows users on here so hopefully they can speak up.

In general though, run set (is there a printenv in windows?) in the working and non working environments, and see what the differences are. Compare usernames as well.

Aw! I appreciate that you’re a Linux developer trying to help out a Windows issue!

Do I compare environment variables from CMD and Jenkins?

What does ‘compare usernames as well’ mean? :thinking:

Thanks for the feedback @halkeye! :blush:

in your jenkins job


(confirmed at least windows 11 has whoami)

Then do the same as the cli

usually jenkins windows installs run as a service account. In linux different accounts have different permissions and env variables and stuff, so that often is the cause cli but not jenkins works.

How are you running your Jenkins agent on the Windows machine? Can you run it a command line window in foreground to see what it says?

( c# - OpenGL rendering from Windows Service - Stack Overflow might be relevant here )