Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building AWS AMI with Packer results in link error while manual built starting with identical AMI is working #3365

Closed
revilokeb opened this issue Mar 18, 2016 · 2 comments

Comments

@revilokeb
Copy link

I would like to automate building an AWS AMI using Packer starting with my publicly available AMI ami-3bc24748 (Ireland).

Manual approach: after instantiating the above AMI I execute three commands:

  • cd deepdetect/build
  • cmake .. -DUSE_CUDNN=ON
  • make

This results in flawless build of the software tool:
160318-manual_deepdetect_build

Using Packer for doing the same: do the same starting from the same AMI by invoking: packer build -var 'aws_access_key=...' - var 'aws_secret_key=...' dede.json (see https://gist.github.com/revilokeb/d9d90998edd7c1dc6ac7)

This results in the following linking error in the very last step (output below red line is different from manual built):
160318-packer_deepdetect_build

When using Packer, the linker seems to be unable to find CUDA libraries such as libcudart.so.7.5 which are indeed in /usr/local/cuda/lib64/ (I have checked), also LD_LIBRARY_PATH (set to /usr/local/cuda/lib64/) seems to get ignored.

Any hints what can be done to automatically build the tool are appreciated!

@revilokeb
Copy link
Author

Ok, the issue can be solved by adding one line to my gist, i.e. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64.

Is this by design that LD_LIBRARY_PATH needs to be set for building when using Packer (although it is correcty set in .bashrc)? Sorry for my limited understanding of Packer...

@cbednarski
Copy link
Contributor

Thanks for opening an issue. Please take a look at the documentation for the remote shell provisioner which explains how environment variables are passed to the remote command.

Packer does not include .bashrc or .bash_profile on the remote side because use of these files varies between different operating systems and the way the user logs into the machine, so you will need to create the environment you expect in your packer configuration.

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants